Created
October 18, 2025 21:59
-
-
Save dgulino/6aa9471216002c61e93414c0fabf5bf4 to your computer and use it in GitHub Desktop.
Prints random integers
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
| #!/usr/bin/env sbcl --script | |
| ;; Seed the random number generator | |
| (setf *random-state* (make-random-state t)) | |
| ;; The main loop | |
| (loop | |
| (let ((random-int (+ 1 (random 1000)))) | |
| (format t "~a~%" random-int) | |
| ;; Force the output to appear immediately | |
| (finish-output) | |
| ;; Wait for 1 second | |
| (sleep 1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment