~/talk

Snake in 10 Lines: Learning More by Coding Less

Talkat JNation 2026 · 2026-05-26..05-27· [creative-coding, kotlin]
links:none on file
slides:none on file

Claims a complete, playable Snake implemented in 10 lines using only the JDK with Kotlin and Swing, solves raw key handling by reading arrow key codes, reduces state by storing snake as a list of integers with a one-dimensional trick (wraps lines visually), movement as “add head remove tail,” eating by regenerating food with generateSequence, fixes opposite-direction and scoring bugs, and leaves a deliberate “kill screen” when no empty cell remains so the minimal game actually runs and is playable.

AI-written summary · about

  1. 0:00Introduction to challenge
  2. 1:09Rules of the 10-line Snake challenge
  3. 3:14Breaking down Snake into six words
  4. 6:04Initial Snake game implementation
  5. 8:33Adding user interaction with Swing
  6. 13:31Learning by doing in coding
  7. 15:16Optimizing Snake movement logic
  8. 19:08Implementing food and growth mechanics
  9. 21:17Adding game over condition
  10. 22:22Simplifying to one-dimensional Snake
  11. 25:31Constraints lead to creative solutions
  12. 27:15Pushing to meet the 10-line goal
  13. 31:05Refactoring for conciseness
  14. 34:13Finalizing the 10-line Snake game
  15. 36:17Evaluating the 10-line Snake game
  16. 37:00Fixing bugs and adding score
  17. 39:46Preventing direction reversal bug
  18. 42:12Adding kill screen feature
  19. 43:34Conciseness brings understanding
  20. 45:18Key lessons from the challenge
  21. 46:23Q&A and GitHub resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.