diff options
author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-20 22:38:47 +0100 |
---|---|---|
committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2023-12-20 22:38:47 +0100 |
commit | 0f717faf2fddb67d935dce057cbdbdc6a6925e83 (patch) | |
tree | c530d86f7a4c0b22c12e07e3278ae4173e252262 /stage3 | |
parent | 42c69b59e1fdcf70219bc04a3124d2f35d9463ac (diff) | |
download | cuddles-0f717faf2fddb67d935dce057cbdbdc6a6925e83.tar.xz |
love: add rng
Diffstat (limited to 'stage3')
-rw-r--r-- | stage3/shell.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/stage3/shell.c b/stage3/shell.c index 6aca52d..d67ca57 100644 --- a/stage3/shell.c +++ b/stage3/shell.c @@ -137,10 +137,18 @@ static void cmd_clear(str arg) font_clear_screen(); } +int rand() +{ + static unsigned long int next = 1; + + next = next * 1103515245 + 12345; + return (unsigned int) (next/65535) % 32768; +} + static void cmd_love(str arg) { if (arg.len == 0) - arg = S("anna"); + arg = (rand()%2) ? S("anna") : S("floof"); str f = fs_read(S("uwu.txt")); if (f.data == nil) { |