Skip to content

moquist/twenty-forty-eight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twenty-forty-eight

A Clojure implementation of the game 2048, currently playable only in the REPL.

Usage

(require 'twenty-forty-eight.core)
(in-ns 'twenty-forty-eight.core)
(def b (atom (init-board)))
(swap! b move :u)
(swap! b move :d)
(swap! b move :l)
(swap! b move :r)

I've been working on simple heuristic "AI" players, to see how different simple heuristics perform. If you want to try them out (in order of goodness):

(time (play-ai->stats a-stubborn 1000)) ; Worse than random!
(time (play-ai->stats a-not-i 1000)) ; random null model
(time (play-ai->stats ai-pref-dir 1000)) ; better
(time (play-ai->stats ai-pref-dir-watch-blanks 1000)) ; best heuristic so far
(play-ai (human-intelligence))

License

Copyright © 2014 Matt Oquist [email protected]

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

My implementation of the game 2048

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published