mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Convencience function for random + entropy function.
This commit is contained in:
@@ -69,10 +69,8 @@ fn void Game.update(Game *game, int guess)
|
||||
|
||||
fn void! main()
|
||||
{
|
||||
Lcg128Random rand;
|
||||
random::seed(&rand, clock::now());
|
||||
int high = 100;
|
||||
int answer = random::next(&rand, high) + 1;
|
||||
int answer = rand(high) + 1;
|
||||
Game game = { .answer = answer, .high = high };
|
||||
(void)game.play();
|
||||
io::printfn("Finished in %d guesses.", game.guesses);
|
||||
|
||||
Reference in New Issue
Block a user