MCPcopy Create free account
hub / github.com/3rfaan/courses / PlayGame

Function PlayGame

C#/ReturnMethods/Program.cs:14–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12}
13
14void PlayGame()
15{
16 var play = true;
17
18 while (play)
19 {
20 var target = GetTarget();
21 var roll = RollDice();
22
23 Console.WriteLine($"Roll a number greater than {target} to win!");
24 Console.WriteLine($"You rolled a {roll}");
25 Console.WriteLine(WinOrLose(roll, target));
26 Console.WriteLine("\nPlay again? (Y/N)");
27
28 play = ShouldPlay();
29 }
30}
31
32int GetTarget()
33{

Callers 1

Program.csFile · 0.85

Calls 4

GetTargetFunction · 0.85
RollDiceFunction · 0.85
WinOrLoseFunction · 0.85
ShouldPlayFunction · 0.85

Tested by

no test coverage detected