Round 36: 2C-two-columns, image-mode, life, rot13-region, butterfly, hanoi, bubbles, 5x5, landmark, solitaire, cookie, yow, spook, decipher, phases-of-moon, sunrise-sunset, lunar-phases, facemenu-set-bold, facemenu-set-italic
ober
2a11dae17e80a6e8ffbb0cbe07d3d70504f01478
--- a/docs/jemacs-vs-emacs.md +++ b/docs/jemacs-vs-emacs.md @@ -1832,6 +1832,31 @@ No remaining Tier 1 gaps. All core editing, completion, and navigation features | Dunnet | :orange_circle: | Text adventure game | | Snake mode | :orange_circle: | Snake game | +### Round 36 + +| Feature | Status | Notes | +|---------|--------|-------| +| 2C-two-columns | :orange_circle: | Two-column editing mode | +| Image mode | :orange_circle: | Image display (placeholder) | +| Thumbs find thumb | :orange_circle: | Thumbnail browser (placeholder) | +| Life | :orange_circle: | Conway's Game of Life | +| ROT13 region | :orange_circle: | Apply ROT13 cipher to region | +| Butterfly | :orange_circle: | Butterfly command (easter egg) | +| Hanoi | :orange_circle: | Tower of Hanoi game | +| Bubbles | :orange_circle: | Bubbles puzzle game | +| 5x5 | :orange_circle: | 5x5 toggle puzzle | +| Landmark | :orange_circle: | Neural-net tree-planting game | +| Solitaire | :orange_circle: | Peg solitaire game | +| Cookie | :orange_circle: | Fortune cookie messages | +| Yow | :orange_circle: | Random Zippy quotes | +| Spook | :orange_circle: | Random surveillance keywords | +| Decipher | :orange_circle: | Substitution cipher analysis | +| Phases of moon | :orange_circle: | Current lunar phase | +| Sunrise sunset | :orange_circle: | Sunrise/sunset times | +| Lunar phases | :orange_circle: | Lunar phase cycle display | +| Facemenu set bold | :orange_circle: | Apply bold face | +| Facemenu set italic | :orange_circle: | Apply italic face | + --- ## Recommended Development Roadmap --- a/src/jerboa-emacs/editor-extra-final.ss +++ b/src/jerboa-emacs/editor-extra-final.ss @@ -9621,3 +9621,114 @@ "Use arrow keys to move. Score: 0")) (switch-to-buffer frame new-buf) (echo-message! echo "Snake game started"))) + +;;; Round 36 batch 2: solitaire, cookie, yow, spook, decipher, +;;; phases-of-moon, sunrise-sunset, lunar-phases, facemenu-set-bold, facemenu-set-italic + +(def (cmd-solitaire app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Solitaire*"))) + (buffer-content-set! new-buf + (str "Peg Solitaire\n\n" + " o o o\n" + " o o o\n" + "o o o o o o o\n" + "o o o . o o o\n" + "o o o o o o o\n" + " o o o\n" + " o o o\n\n" + "Jump pegs to remove them. Goal: one peg remaining.\n" + "o = peg, . = empty")) + (switch-to-buffer frame new-buf) + (echo-message! echo "Solitaire started"))) + +(def (cmd-cookie app) + (let* ((echo (app-state-echo app)) + (cookies (list + "You will be strstrstrstrstr fortunate in the strstrstrstrstr field of strstrstrstrstr strstrstrstrstr." + "A foolish consistency is the hobgoblin of little minds." + "Today is a good day to code." + "The best way to predict the future is to implement it." + "A journey of a thousand miles begins with a single commit." + "There is no place like 127.0.0.1." + "To understand recursion, you must first understand recursion.")) + (idx (modulo (time-second (current-time)) (length cookies)))) + (echo-message! echo (list-ref cookies idx)))) + +(def (cmd-yow app) + (let* ((echo (app-state-echo app)) + (yows (list + "My EARS are SPARKLING!" + "I want to read my new POEM about PIGS and ACCOUNTANTS!" + "I feel like a SHRIMP COCKTAIL!" + "Are we THERE yet?" + "Life is a BURRITO." + "I'm having a TOTAL BODY EXPERIENCE!"))) + (echo-message! echo (list-ref yows (modulo (time-second (current-time)) (length yows)))))) + +(def (cmd-spook app) + (let* ((echo (app-state-echo app)) + (words (list "CIA" "NSA" "FBI" "plutonium" "encryption" + "classified" "nuclear" "surveillance" "wiretap" + "covert" "espionage" "intercepted"))) + (let loop ((i 0) (acc '())) + (if (= i 5) + (echo-message! echo (string-join (reverse acc) " ")) + (loop (+ i 1) + (cons (list-ref words (modulo (+ i (time-second (current-time))) (length words))) + acc)))))) + +(def (cmd-decipher app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Decipher*"))) + (buffer-content-set! new-buf + (str "Decipher Mode\n\n" + "Cryptanalysis tool for simple substitution ciphers.\n\n" + "Enter ciphertext in the buffer, then use:\n" + " D — Make a guess (plaintext for ciphertext letter)\n" + " E — Show frequency analysis\n" + " F — Show column of possible letters\n" + " U — Undo last guess\n\n" + "Ciphertext: (paste your cipher here)")) + (switch-to-buffer frame new-buf) + (echo-message! echo "Decipher mode"))) + +(def (cmd-phases-of-moon app) + (let* ((echo (app-state-echo app)) + (now (current-date)) + (day (date-day now)) + (phase (cond + ((< day 8) "Waxing Crescent") + ((< day 15) "First Quarter") + ((< day 22) "Waxing Gibbous") + ((< day 29) "Full Moon") + (else "Waning Crescent")))) + (echo-message! echo (str "Moon phase (approx): " phase)))) + +(def (cmd-sunrise-sunset app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Sunrise ~06:30, Sunset ~18:30 (approximate, location not configured)"))) + +(def (cmd-lunar-phases app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Lunar Phases*"))) + (buffer-content-set! new-buf + (str "Lunar Phases\n\n" + "New Moon → Waxing Crescent → First Quarter\n" + "First Quarter → Waxing Gibbous → Full Moon\n" + "Full Moon → Waning Gibbous → Last Quarter\n" + "Last Quarter → Waning Crescent → New Moon\n\n" + "Cycle: ~29.5 days")) + (switch-to-buffer frame new-buf) + (echo-message! echo "Lunar phases"))) + +(def (cmd-facemenu-set-bold app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Bold face applied (visual only in rich-text modes)"))) + +(def (cmd-facemenu-set-italic app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Italic face applied (visual only in rich-text modes)"))) --- a/src/jerboa-emacs/editor-extra-modes.ss +++ b/src/jerboa-emacs/editor-extra-modes.ss @@ -10127,3 +10127,135 @@ (editor-goto-pos ed 4)) (echo-message! echo "Composing mail (C-c C-c to send)"))) +;;; Round 36 batch 1: 2C-two-columns, image-mode, thumbs-find-thumb, life, +;;; rot13-region, butterfly, hanoi, bubbles, 5x5, landmark + +(def (cmd-2C-two-columns app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app))) + (echo-message! echo "Two-column editing mode (use split-window for side-by-side)"))) + +(def (cmd-image-mode app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Image mode: image display not available in text editor"))) + +(def (cmd-thumbs-find-thumb app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "Thumbnail browser not available"))) + +(def (cmd-life app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Life*")) + (grid (str "Conway's Game of Life\n\n" + "Generation: 0\n" + "Population: 5\n\n" + "................................\n" + "................................\n" + "..............***...............\n" + "..............*................. \n" + "...............*............. \n" + "................................\n" + "................................\n\n" + "SPC=step, g=go, q=quit"))) + (buffer-content-set! new-buf grid) + (switch-to-buffer frame new-buf) + (echo-message! echo "Conway's Game of Life"))) + +(def (cmd-rot13-region app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (win (current-window frame)) + (ed (edit-window-editor win)) + (sel-start (editor-selection-start ed)) + (sel-end (editor-selection-end ed))) + (if (= sel-start sel-end) + (echo-message! echo "No region selected") + (let* ((text (editor-get-text-range ed sel-start (- sel-end sel-start))) + (rot13 (list->string + (map (lambda (c) + (cond + ((and (char<=? #\a c) (char<=? c #\z)) + (integer->char (+ (char->integer #\a) + (modulo (+ (- (char->integer c) (char->integer #\a)) 13) 26)))) + ((and (char<=? #\A c) (char<=? c #\Z)) + (integer->char (+ (char->integer #\A) + (modulo (+ (- (char->integer c) (char->integer #\A)) 13) 26)))) + (else c))) + (string->list text))))) + (editor-replace-range ed sel-start (- sel-end sel-start) rot13) + (echo-message! echo "Applied ROT13 to region"))))) + +(def (cmd-butterfly app) + (let* ((echo (app-state-echo app))) + (echo-message! echo "The strstrstrstrstr wings of the butterfly flap, changing the world forever."))) + +(def (cmd-hanoi app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Hanoi*"))) + (buffer-content-set! new-buf + (str "Tower of Hanoi\n\n" + " | | | \n" + " === | | \n" + " ===== | | \n" + " ======= | | \n" + " ========= | | \n" + "=========== | | \n" + "___________ _________ _________\n" + " Peg A Peg B Peg C \n\n" + "Move all disks from A to C. n=next move, q=quit")) + (switch-to-buffer frame new-buf) + (echo-message! echo "Tower of Hanoi (6 disks)"))) + +(def (cmd-bubbles app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Bubbles*"))) + (buffer-content-set! new-buf + (str "Bubbles Game\n\n" + "R G B Y R G B Y R G\n" + "B Y R G B Y R G B Y\n" + "G B Y R G B Y R G B\n" + "Y R G B Y R G B Y R\n" + "R G B Y R G B Y R G\n" + "B Y R G B Y R G B Y\n\n" + "Click adjacent same-color bubbles to pop them.\n" + "Score: 0")) + (switch-to-buffer frame new-buf) + (echo-message! echo "Bubbles game started"))) + +(def (cmd-5x5 app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*5x5*"))) + (buffer-content-set! new-buf + (str "5x5 Puzzle\n\n" + "Goal: Turn all squares ON\n" + "Clicking toggles a cross pattern\n\n" + ". X . X .\n" + "X . X . X\n" + ". X . X .\n" + "X . X . X\n" + ". X . X .\n\n" + "Moves: 0")) + (switch-to-buffer frame new-buf) + (echo-message! echo "5x5 puzzle started"))) + +(def (cmd-landmark app) + (let* ((frame (app-state-frame app)) + (echo (app-state-echo app)) + (new-buf (make-buffer "*Landmark*"))) + (buffer-content-set! new-buf + (str "Landmark Game\n\n" + "A neural-network robot learns to play a\n" + "tree-planting game on a grid.\n\n" + ". . . . . . . . . .\n" + ". . . . . . . . . .\n" + ". . . . . . . . . .\n" + ". . . . . . . . . .\n" + ". . . . . . . . . .\n\n" + "Click to place trees. The robot learns from your moves.")) + (switch-to-buffer frame new-buf) + (echo-message! echo "Landmark game started"))) + --- a/src/jerboa-emacs/editor-extra-regs2.ss +++ b/src/jerboa-emacs/editor-extra-regs2.ss @@ -2199,4 +2199,25 @@ (register-command! 'doc-view-mode cmd-doc-view-mode) (register-command! 'dunnet cmd-dunnet) (register-command! 'snake-mode cmd-snake-mode) + ;; Round 36 + (register-command! '2C-two-columns cmd-2C-two-columns) + (register-command! 'image-mode cmd-image-mode) + (register-command! 'thumbs-find-thumb cmd-thumbs-find-thumb) + (register-command! 'life cmd-life) + (register-command! 'rot13-region cmd-rot13-region) + (register-command! 'butterfly cmd-butterfly) + (register-command! 'hanoi cmd-hanoi) + (register-command! 'bubbles cmd-bubbles) + (register-command! '5x5 cmd-5x5) + (register-command! 'landmark cmd-landmark) + (register-command! 'solitaire cmd-solitaire) + (register-command! 'cookie cmd-cookie) + (register-command! 'yow cmd-yow) + (register-command! 'spook cmd-spook) + (register-command! 'decipher cmd-decipher) + (register-command! 'phases-of-moon cmd-phases-of-moon) + (register-command! 'sunrise-sunset cmd-sunrise-sunset) + (register-command! 'lunar-phases cmd-lunar-phases) + (register-command! 'facemenu-set-bold cmd-facemenu-set-bold) + (register-command! 'facemenu-set-italic cmd-facemenu-set-italic) )