Skip to content

Instantly share code, notes, and snippets.

@bootandy
Last active April 27, 2016 13:12
Show Gist options
  • Save bootandy/7e0b6267e8bfc467db3b to your computer and use it in GitHub Desktop.
Save bootandy/7e0b6267e8bfc467db3b to your computer and use it in GitHub Desktop.
Ideas for simple programming puzzles
Simple:
2 people get married - adjust names, also double barrelled names
Replace word X with word Y
Normal:
Reverse String
Reverse words in String
Guess the Number between 1 - 100. Run both ways round with computer guesser and computer generator. Generate stats by plugging guesser into a loop.
(bubble) sort
Sum 2 biggest numbers in string. No using sort or max(). Later run in O(n) time.
Hedger -> If we are £A exposed on one horse and need to reduce exposure to Y how much do we back horse if (digital) odds are Z.
Rot 3 encoder -> encode & decode letters a->z with rot3
Calc fibnanci.
wordsearch solver - use words file in linux eg: find words begining with 'x' then matching a user input like: a_e_
ubuntu: /usr/share/dict/british-english mac: /usr/share/dict/words
helicopter - each iteration move heli n/e/s/w and print location. draw heli on 10X10 ASCII grid. Move heli to landing pad. Add trail to indicate where heli went.
obstacle race - Each person moves a speed X. takes Y to move an obstacle. Speeds decay or are relative to each other.
OOP:
car shop - object car, create functions to add cars to shop, list them, list by make
turtle control to build tiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment