![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_RANDOM_SEED opcode for seeding the random number generator in the VM. More...
Go to the source code of this file.
Functions | |
| if (seed.type !=VAL_INT) | |
| srand ((unsigned int) seed.i) | |
| free_value (seed) | |
| push_value (vm, make_int(0)) | |
Variables | |
| case | OP_RANDOM_SEED |
| break | |
Implements the OP_RANDOM_SEED opcode for seeding the random number generator in the VM.
This file handles the OP_RANDOM_SEED instruction, which seeds the random number generator with a specified value. The seed is popped from the stack.
Behavior:
Error Handling:
Example: // Bytecode: OP_RANDOM_SEED // Stack before: [42] // Stack after: []
Definition in file random_seed.c.
| free_value | ( | seed | ) |
| if | ( | seed.type ! | = VAL_INT | ) |
Definition at line 32 of file random_seed.c.
| push_value | ( | vm | , |
| make_int(0) | ) |
| srand | ( | (unsigned int) seed. | i | ) |
| break |
Definition at line 39 of file random_seed.c.
| case OP_RANDOM_SEED |
Definition at line 30 of file random_seed.c.