Monty & Randy– the dynamic
Ultimate Tic Tac Toe duo
Niclas Jern
njern
Co-Founder @ www.walkbase.com
Tools used
The challenge
• There are 8 sexdecillion 837 quindecillion 965 quattuordecillion
761 tredecillion 661 duodecillion 276 und...
Solutions #1
• Use a Monte Carlo Search Tree (MCST)
based bot (Monty) and his assistant (Randy)
– “Stupid” in the beginnin...
Solutions #2
• Pick a language based on speed /
HackerRank execution time.
– C/C++ is fast, but only gets two seconds
– Py...
Solutions #2
• Ruthlessly benchmark and optimize:
– Slowest function is checking which moves are
available.
• With optimiz...
Solutions #3 (not implemented)

• Idea: save successful search trees
– Add CBR (Case-based reasoning)
– Augment generated ...
Thoughts about “Code it”
• A lot of fun
– Would love to participate again!
– Good mix of algorithmic and more dynamic
chal...
Thoughts about “Code it”
• Good reason to sit down and learn new
algorithms, tools and techniques
– The S.W Sloan point-in...
Thank you
• And hope to see you again during the next
Code It!
Upcoming SlideShare
Loading in …5
×

Aaalto ES CodeIt 2013 - Ultimate Tic-tac-toe submission slides

709 views

Published on

The slides I used when presenting Monty - my submission for the CodeIt 2013 Ultimate Tic-tac-toe challenge.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
709
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Aaalto ES CodeIt 2013 - Ultimate Tic-tac-toe submission slides

  1. 1. Monty & Randy– the dynamic Ultimate Tic Tac Toe duo Niclas Jern njern Co-Founder @ www.walkbase.com
  2. 2. Tools used
  3. 3. The challenge • There are 8 sexdecillion 837 quindecillion 965 quattuordecillion 761 tredecillion 661 duodecillion 276 undecillion 634 decillion 907 nonillion 936 octillion 847 septillion 827 sextillion 420 quintillion 932 quadrillion 210 trillion 688 billion possible ways to play UTTT – If you can express save game in 100 bytes, you have approximately 21 million billion billion billion truckloads of 16 gig USB sticks with game data  • The AI has limited execution time • You can only upload the code (no training data)
  4. 4. Solutions #1 • Use a Monte Carlo Search Tree (MCST) based bot (Monty) and his assistant (Randy) – “Stupid” in the beginning, but grows smarter the further into the game you get (smaller search space) – Playing against Randy (RandomBot) – wins 100% – Against itself – ties 80%, wins 13%/7% – Improves linearly with execution time
  5. 5. Solutions #2 • Pick a language based on speed / HackerRank execution time. – C/C++ is fast, but only gets two seconds – Python gets 16 seconds, but is quite slow – Java is fast, but warming up the JVM eats into it’s five seconds. – Golang gets a generous six seconds and is comparable to C/C++
  6. 6. Solutions #2 • Ruthlessly benchmark and optimize: – Slowest function is checking which moves are available. • With optimization, checking an empty board (worst case) went from 15000 nanoseconds (initial version) to 4000 nanoseconds (final version) on i7 laptop.
  7. 7. Solutions #3 (not implemented) • Idea: save successful search trees – Add CBR (Case-based reasoning) – Augment generated search trees with saved ones for fun & profit – Using real game history would be more realistic than simulating random games with Randy
  8. 8. Thoughts about “Code it” • A lot of fun – Would love to participate again! – Good mix of algorithmic and more dynamic challenges.
  9. 9. Thoughts about “Code it” • Good reason to sit down and learn new algorithms, tools and techniques – The S.W Sloan point-in-poly algorithm (too slow for Polygon challenge ) – MCST (Monty) – Probability mapping (Battleship)
  10. 10. Thank you • And hope to see you again during the next Code It!

×