Skip to content

The ubiquitous puzzle, in machine- and lolcat-readable format ๐Ÿ—๏ธ

License

Notifications You must be signed in to change notification settings

ItsNickBarry/hanoi-lol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Towers of Hanoi, in LOLCODE

This repository contains an implementation of Towers of Hanoi in LOLCODE, the alleged language of LOLCATS.

The code is amusingly human-readable.

To run it, use Justin Meza's LOLCODE interpreter, lci.

Highlights

Comments in LOLCODE are expressed in an unassuming manner:

BTW too heavy

Nobody can be expected to read multi-line comments:

OBTW
  The main game loop.

  Very fun.
TLDR

One must be polite to the LOLCODE interpreter:

HAI 1.2
  BTW code goes here
KTHXBYE

Because LOLCODE does not support arrays, the states of the towers are represented by strings:

I HAS A TOWERLEFT ITZ "SMALLMEDIUMBIG"
I HAS A TOWERMIDDLE ITZ "EMPTY"
I HAS A TOWERRIGHT ITZ "EMPTY"

Because LOLCODE does not support string manipulation beyond concatenation, "WTF?" statements are required to determine the state of the towers and act accordingly:

FROM, WTF?
  OMG "SMALLMEDIUMBIG"
    NEWFROM R "MEDIUMBIG"
    GTFO
  OMG "MEDIUMBIG"
    NEWFROM R "BIG"
    GTFO
  OMG "SMALLBIG"
    NEWFROM R "BIG"
    GTFO
  OMG "SMALLMEDIUM"
    NEWFROM R "MEDIUM"
    GTFO
  OMG "SMALL"
    NEWFROM R "EMPTY"
    GTFO
  OMG "MEDIUM"
    NEWFROM R "EMPTY"
    GTFO
  OMG "BIG"
    NEWFROM R "EMPTY"
    GTFO
  OMG "EMPTY"
    GTFO  BTW this shouldn't happen
OIC

About

The ubiquitous puzzle, in machine- and lolcat-readable format ๐Ÿ—๏ธ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published