Giter VIP home page Giter VIP logo

hex's Introduction

The Hex Game

Play the game of Hex (or Con-Tac-Tix) (game presentation, rules).

This repo consists of 2 main parts:

  • A web application, also hosting the API and a terminal-based version of the game - See the README
  • A mobile application, client to the API - See the README

Prerequisites

  • Make
  • Docker & Docker Compose

Running the app

Configure the project for first launch

$ make init

Start the apps in dev mode (using docker-compose)

$ make start

Stop and remove the containers and volumes

$ make stop

hex's People

Contributors

atilbian avatar clebiez avatar djhi avatar fzaninotto avatar mchaffotte avatar slax57 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hex's Issues

Do not share gameService between tests in `games.service.spec.ts`

Clebiez On PR #38
Your gameService is a variable which will mutate between different tests.

It's a bad practice and you should avoid that.

Each it function should be completely independant, obviously you can use "beforeEach" and "afterEach" but you must never be able to grab a variable which is updated from another test.

If you have a test with no call to updateGameState, but you assert something, this assert pass but the feature doesn't work because the board that you expected is wrong.
Also you can't be certified that every tests runs will run your test in the same order.
Prefer setting the game in a beforeEach by calling getBoardStateFromFile every time.

Fix this, either using a beforeEach or by calling getBoardStateFromFile every time

Mobile-app: board is truncated right

The game board is truncated on the right of the screen, no matter the resolution or the zoom.

It is especially visible on small board sizes.

Probably has to do with the calculation of the board width.

image

Admin: first login leads to an error being displayed in the Games List

When logging in as admin for the first time, RA seems to redirect to the GamesList page but then displays an error.
A refresh is sufficient to make the page work again, and afterwards the whole app works great.
Subsequent log out / log in also work fine...

The issue is reproduced in the production environment only.

To reproduce manually, one can remove the "jwt" key in the browser's local storage, and then refresh the page.

Hereby is a demo of the bug:
hex-admin-login-bug

Mobile app: fix error while playing twice at the same position

Mobile app currently allows to play twice at the same position, resulting in an error since the API won't allow it.

Stacktrace:

Board.tsx:19 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at Board (Board.tsx:19:1)
    at renderWithHooks (react-dom.development.js:14985:1)
    at updateFunctionComponent (react-dom.development.js:17356:1)
    at beginWork (react-dom.development.js:19063:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at beginWork$1 (react-dom.development.js:23964:1)
    at performUnitOfWork (react-dom.development.js:22779:1)
    at workLoopSync (react-dom.development.js:22707:1)
    at renderRootSync (react-dom.development.js:22670:1)
    at performSyncWorkOnRoot (react-dom.development.js:22293:1)
    at react-dom.development.js:11327:1
    at unstable_runWithPriority (scheduler.development.js:468:1)
    at runWithPriority$1 (react-dom.development.js:11276:1)
    at flushSyncCallbackQueueImpl (react-dom.development.js:11322:1)
    at flushSyncCallbackQueue (react-dom.development.js:11309:1)
    at scheduleUpdateOnFiber (react-dom.development.js:21893:1)
    at dispatchAction (react-dom.development.js:16139:1)

We should

  • Make the non-empty cells non-clickable
  • Have better handling of API errors

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.