Code Monkey home page Code Monkey logo

project-memory's People

Contributors

thejhh avatar

Watchers

 avatar

project-memory's Issues

TASK Implement embedded static game frontend

Goal

Embed the game frontend into the backend so that it is possible to just release a binary for the game server.

Subtasks

  • Move to use /api/v1 in the backend
  • Serve static files from /

TASK initial stateless backend service

Goal

Stateless backend for the memory matching game. It will utilize cryptography to pass the game state back to the frontend. It will not have any kind of authentication or state.

This will be private source code, Github repository at hangovergames/memory.

Subtasks

  • Implement a game request dto
  • Implement a game state dto
  • Implement a game state encryption and decryption
  • Implement a new game starting and card visibility
  • Implement a step in the game to match cards
  • Implement creation and update times
  • Document the API in the README
  • Manual test it

TASK Refactor ConsecutiveMatchBonus to not be static

Description

Improve the bonus to be a level based, and it should give more bonus for higher levels always.

There are seven levels of combos:

  • Level 0: One pair in a row, total of eight available
  • Level 1: Two pairs in a row, total of four available
  • Level 2: Three pairs in a row, total of two available
  • Level 3: Four pairs in a row, total of two available
  • Level 4: Five pairs in a row, total of one available
  • Level 5: Six pairs in a row, total of one available
  • Level 6: Seven pairs in a row, total of one available
  • Level 7: Eight pairs in a row, total of one available

Except for level 7, player would need to fail between combos to archieve maximum amount for the level.

TASK Implement client for the backend in the frontend

Goal

Implement TypeScript client library for our stateless Memory Matching backend.

API documentation

@hangovergames/memory

Backend for Hangover Games' Matching Game Project

Manual testing with Curl

Starting a game

Request body:

{
  "nextIndex": 0, 
}

Command:

curl -i -d '{"nextIndex": 0}' http://localhost:3001

Response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 07 Apr 2024 23:41:23 GMT
Content-Length: 436
{
  "score":0,
  "cards":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
  "private":"Y1aU4hhRmV1Puc+05E/apHN5gdAaaXI9px4fOEcvkiGYG4Po6Gp8eO+ZzUduanmX0yWPY6ChVZk+TW7QPO99XgtcoqJjHAwJy0EcV5v54elYflk1Ltr9kBCQqQEP5Tf3WsmB+zinXaFxr6Jkc+mDLLY/VKqMVmkP/qELOLVnMOnuxkCXdzXONYAOYU0u7IEMRtB2lC6fvAjoy6s9wWJFWvp526aFcAnTUN31gIWJbWI6nJu92WJIVu0+wxs9E8AbOBhEG0hXpM72hmH8bBXml5s8Z9S9UxMLpv8ZqaZd5fzCLN1G4ctuLmUC/f5fKhJLAGMhHyMnYLL6zgaf8FkdbvQn3DL/9F1dMmdb",
  "lastCard":1
}

Continuing a game

Request body:

{
  "nextIndex": 1, 
  "gameState": {
    "score":0,
    "cards":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
    "private":"Y1aU4hhRmV1Puc+05E/apHN5gdAaaXI9px4fOEcvkiGYG4Po6Gp8eO+ZzUduanmX0yWPY6ChVZk+TW7QPO99XgtcoqJjHAwJy0EcV5v54elYflk1Ltr9kBCQqQEP5Tf3WsmB+zinXaFxr6Jkc+mDLLY/VKqMVmkP/qELOLVnMOnuxkCXdzXONYAOYU0u7IEMRtB2lC6fvAjoy6s9wWJFWvp526aFcAnTUN31gIWJbWI6nJu92WJIVu0+wxs9E8AbOBhEG0hXpM72hmH8bBXml5s8Z9S9UxMLpv8ZqaZd5fzCLN1G4ctuLmUC/f5fKhJLAGMhHyMnYLL6zgaf8FkdbvQn3DL/9F1dMmdb",
    "lastCard":1,
    "lastIndex": 15
  }
}

Command:

curl -i -d '{"nextIndex": 1, "gameState": {"score":0,"cards":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"private":"Y1aU4hhRmV1Puc+05E/apHN5gdAaaXI9px4fOEcvkiGYG4Po6Gp8eO+ZzUduanmX0yWPY6ChVZk+TW7QPO99XgtcoqJjHAwJy0EcV5v54elYflk1Ltr9kBCQqQEP5Tf3WsmB+zinXaFxr6Jkc+mDLLY/VKqMVmkP/qELOLVnMOnuxkCXdzXONYAOYU0u7IEMRtB2lC6fvAjoy6s9wWJFWvp526aFcAnTUN31gIWJbWI6nJu92WJIVu0+wxs9E8AbOBhEG0hXpM72hmH8bBXml5s8Z9S9UxMLpv8ZqaZd5fzCLN1G4ctuLmUC/f5fKhJLAGMhHyMnYLL6zgaf8FkdbvQn3DL/9F1dMmdb","lastCard":1,"lastIndex": 15}}' http://localhost:3001

Response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 07 Apr 2024 23:42:07 GMT
Content-Length: 436
{
  "score":0,
  "cards":[0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,4],
  "private":"YTUi5aJQjyCqbEBVf1gxNB+KZmkXnzQg0jiqfkJfECE18esg+q+hODgwz3s0lNb5v7oTLRanO/VK22Ppl3zAcCEk6aObarfBJMeGgcw7RdWXUZ19f6pBgz9rp1baVM9CkmPyc/kqqdEZOKFms89dzefhKbY/tUqP6IwLQ5Se3zHT6DsI0YAjbx2JLWcbwUW17vRWMkNibuNpFVgC4H6UwPQLnvNJkJGRjq8Zl6t/xaUIhaEyLMRMF0nVuO6aHQfgel6W/tDMDN2e8CJIlOMpu9zWcJDaRQb+p9Ojk2GtSsQUm90ectElWy/gQ66Rgi8B6mi5hby3kGS6Y8KSBNKbR05F9Sr/sEf196ff",
  "lastCard": 4,
  "lastIndex": 1
}

TASK Add unit tests for gamestate

Goal

Write unit tests to improve the game

Subtasks

  • gamestate.go coverage 97,1%, remaining not important cases
    • Write tests for NewGameState
    • Write tests for ToggleCard
    • Write tests for UpdateScore

TASK Implement a leaderboard for single player version

Leader board of last 100 best results

Subtasks

  • Setup PostgreSQL for development
  • Design PostgreSQL database table for scores
  • Implement basic PostgreSQL support
  • Implement a test query for database so that we detect database problems at start up
  • Implement API end point to fetch leaderboard results
  • Implement API and view for player name
  • Implement view for leaderboard results in frontend
  • Setup PostgreSQL for production

TASK Initial frontend app

Goal

Implement initial ReactJS and TypeScript frontend for the game. Uses plain colors as cards initially.

Subtasks

  • Initialize TypeScript ReactJS project
  • Update dependencies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.