Skip to content

Instantly share code, notes, and snippets.

@dgulino
Created October 18, 2025 21:59
Show Gist options
  • Select an option

  • Save dgulino/6aa9471216002c61e93414c0fabf5bf4 to your computer and use it in GitHub Desktop.

Select an option

Save dgulino/6aa9471216002c61e93414c0fabf5bf4 to your computer and use it in GitHub Desktop.
Prints random integers
#!/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