Guest User

Level Selector PicoLisp

a guest
Sep 5th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.63 KB | None | 0 0
  1. (de menu (Options)
  2.    (let S 1 Exit NIL
  3.       (loop
  4.          (for (I . V) Options
  5.             (if (= S I)
  6.                (call 'tput "setaf" 10) (call 'tput "setaf" 15))
  7.             (prinl V)
  8.             (call 'tput "setaf" 15))
  9.          (case (key)
  10.             (" " (inc 'S) )
  11.             ("e" (setq Exit T))
  12.             ("n" (dec 'S)))
  13.          (when (> S (length Options)) (setq S 1))
  14.          (T Exit S)
  15.          (call 'tput "cuu" (length Options))
  16.          )))
  17.  
  18. (prinl "Since you don't know the keys yet, I made the navigation into: Thumb=GoDown, Pinkey=GoUp, MiddleFinger=GoInto")
  19.  
  20. (prinl (menu '("Level1" "Level2")))
Advertisement
Add Comment
Please, Sign In to add comment