Skip to content

Simple interactive 15-puzzle game in Clojure for presentation at WWC Toronto event

License

Notifications You must be signed in to change notification settings

ylebedeva/wwc-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wwc-clojure

Simple interactive 15-puzzle game in Clojure for presentation at Women Who Code Toronto event.

This project was intended as a demonstration of Clojure programming language in action. It is a learning tool.

As an introduction to Clojure syntax try this guide.

Install IDE

Please install IntelliJ IDEA and Cursive plugin for it. Both are available under free license.

Import project

In IntelliJ IDEA import this project: File → New → Project from Version Control → GitHub.

Use the repository URL:

[email protected]:jlebedeva/wwc-clojure.git

Code

The project has a single namespace wwc-clojure.core. The implementation allows to play the 15-puzzle game in REPL.

Code contains detailed comments.

Run the game

  1. Right-click project.clj file in the Project panel on the left and select Run 'REPL for wwc-clojure'. When the message "nREPL server started..." appears in the REPL output area it is ready to interact with. At the bottom of REPL panel input area will be accepting new statements.

  2. Open file src → wwc_clojure → core.clj.

  3. Right-click anywhere inside the editor panel and select REPL → Load file in REPL. Note the instructions being printed: "To play: call...".

  4. In REPL input area, type or paste in:

    (def play! (wwc-clojure.core/new-game))
    
  5. Check your board and make a move using another expression, for example to "move" the "empty" tile displayed as '*' (star) one position up:

    (play! :up)
    

About

Simple interactive 15-puzzle game in Clojure for presentation at WWC Toronto event

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published