Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace PointExercise
- {
- class DiceGame
- {
- public static void Main(string[] args)
- {
- Die d1, d2;
- d1 = new Die();
- d2 = new Die();
- d1.Roll();
- d2.Roll();
- int i;
- //for (int i = 0; d1.getNum()!=6 || d2.getNum()!=6 ; i++) {
- //for (int i = 0; !(d1.getNum() == 6 && d2.getNum() == 6); i++)
- for (i = 1; (d1.getNum() == 6 && d2.getNum() == 6) == false; i++)
- {
- d1.Roll();
- d2.Roll();
- Console.WriteLine("{0} , {1}", d1.getNum(), d2.getNum());
- }
- Console.WriteLine("rolls count = {0}", i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement