Skip to content
/ 2048.idr Public

Game 2048 written in a language with dependent types.

Notifications You must be signed in to change notification settings

Kraks/2048.idr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#2048 in Idris

Author: Guannan Wei

This project aims to learn & show dependent type programming in Idris.

I implemented two versions of game 2048:

  • 2048.idr shows how to achieve it in Idris just using traditional type system.

  • 2048-dependent.idr is the version using dependent type. The most important data structure is dependent list Vect, and it also utilize built-in proof to ensure pre-conditions and post-conditions are satisfied.

Build

You should have installed Idris (version 0.11 or later), see Idris Documentation.

  • run make all to compile both two versions,

  • run make 2048 to compile ordinary version,

  • run make 2048-dep to compile the dependent type version.

How to play

  • w and press enter for move up,
  • a for move left,
  • s for move down,
  • d for move right,
  • and q to quit the game.

Have fun!

About

Game 2048 written in a language with dependent types.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published