Skip to content

jasonyapri/2048-haskell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048 GAME

This project is a simple implementation of the 2048 Game using Haskell. The game is played on a 4x4 grid, where the player combines tiles with the same numbers to achieve the tile with the number 2048.

Features

  • Console-based gameplay
  • Leaderboard to track high scores
  • Multiple players with individual high scores (Use Switch Player feature)
  • Move the tiles up, down, left, and right to merge and create higher-value tiles
  • Random tile generation after each move
  • Hack Leaderboard - Modify Player's Score
  • Hack Leaderboard - Remove Player from Leaderboard (Cannot remove Current Player | Need to switch player first)
  • Hack Leaderboard - Reset all scores in Leaderboard to 0
  • Keep logs of every menu that user chosed in logs.txt
  • Load leaderboard data from leaderboard.txt when starting the app
  • Save leaderboard data to leaderboard.txt when exiting the app

Getting Started

To run the game, you need to have Haskell installed on your system. Follow these steps to get started:

  1. Clone the repository:
git clone https://github.com/jasonyapri/2048-haskell.git
  1. Navigate to the src project directory:
cd 2048-haskell
  1. Build the Project and Run the App
cabal build
cabal run

Step by Step Walkthrough

  1. After running the game, first thing you need to do is enter your name.
  2. Then you will be greeted with the Main Menu (8 options)
  3. Choose your desired action entering the number on the Main Menu
  4. Enter '9' to Show How To Play (?)
  5. Enter '1' to Start Playing



  • Enter 'w' to move the tile up
  • Enter 'a' to move the tile left
  • Enter 's' to move the tile down
  • Enter 'd' to move the tile right
  • Enter 'q' to go back to the main menu
  1. Enter '2' to Show Leaderboard

  2. Enter '3' to Switch Player

  3. Enter '4' to Hack Leaderboard (Modify)

  • We cannot enter a name that doesn't exist in the leaderboard yet.
  • Use Switch Player to input a new Player's name

  1. Enter '5' to Hack Leaderboard (Remove)
  • We cannot remove a player that doesn't exist in the leaderboard.
  • Use Switch Player to input a new Player's name
  • You cannot remove current Player's score.
  • In my case, I cannot delete Stefan's score, as I am playing using Stefan.


  • Deleted Jason's score. View the changes by entering '2' (Show Leaderboard)
  1. Enter '6' to Hack Leaderboard (Reset)

  2. Enter '0' to Exit Game

Created by

Jason Yapri
https://linkedin.com/in/jasonyapri/
https://jasonyapri.com

Reference

https://play2048.co/
(Created by Gabriele Cirulli)
2048 Game on Website

About

2048 Game using Haskell Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published