This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* Database configuration and so on...*/ | |
| $todo_list = $database->retrieve_all_todos(); | |
| <ul> | |
| foreach($todo_list as $todo) { | |
| echo "<li> Task number $todo['id'] -> $todo['description'] </li>"; | |
| } | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Seed = 10 | |
| Kernel.srand 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generate_random_uid | |
| # Generate a random value between 0 and 1 000 000 | |
| base_pseudo_random_value = rand(1_000_000) | |
| uid = evil_maths(base_pseudo_random_value) | |
| return uid | |
| end | |
| if first_launch? | |
| uid = generate_random_uid() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First 3 pseudo random numbers | |
| 10 | |
| 12 | |
| 14 | |
| # Second 3 pseudo random numbers | |
| 18 | |
| 20 | |
| 22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PseudoRandomness | |
| # This is the constructor used to instantiate a PseudoRandomness object | |
| def initialize(seed) | |
| @instance_seed = seed | |
| end | |
| def change_seed | |
| @instance_seed = @instance_seed + 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PseudoRandomness | |
| # This is the constructor used to instantiate a PseudoRandomness object | |
| def initialize(seed) | |
| @instance_seed = seed | |
| end | |
| def change_seed | |
| @instance_seed = @instance_seed + 1 |
NewerOlder