Giter Site home page Giter Site logo

hic-hac-hoe's Introduction

About me

Times I removed/added a goal: 4

hic-hac-hoe's People

Contributors

blastwind avatar

Watchers

 avatar

hic-hac-hoe's Issues

Winning and keeping score

It's time for players to win.

  • add _stats to Game. _stats contains player1 and player2 scores, and matches played.
  • Display stats in widget.
  • On win, award one point. Tying does nothing. Both refreshes the board.

Backlog

Interesting* things I want to try out

  • Learn about how to distribute haskell packages, deliver this game so it can run without ghc.
  • Refactor using lenses.
  • Pattern match on record fields directly. https://joshbohde.com/blog/pattern-matching-on-records-in-haskell/
  • Refactor adding two-dimensional tuples with this: https://stackoverflow.com/questions/69422567/add-elements-of-two-tuples-in-haskell
  • Refactor direction vector with Map
  • Refactor zip with enumerate
  • Learn about ghc profiling and profile commit 43336e2 against 0c4c428. These two are consecutive commits, but the latter seemed a lot slower in ghci, probably due to the huge refactoring of nested data types and excessive pattern matching.
  • Anyway to suspend drawing thread during pause screen?
  • Support more than 1 player mode
  • multiplayer networking

Highlight cell and move cell with arrow keys

The app needs a new field! It can keep track of the location of the current cell to highlight with a highlightLocation :: (Int, Int) record field, defaulting to (0, 0).

Tasks:

  • First, for highlightLocation (x, y), actually highlight it!
  • Then, make arrow events update highlightLocation.

Deliverables

This is an informal list of things I want to implement.

  1. Two modes: 1v1, player vs bot Bots move randomly.
  2. Two screens: Home screen and play screen.
  3. Home screen has "play 1v1", "play vs bots", and "quit" options. Users navigate these using ↑ and ↓.
  4. Play screen is where you see a tic tae toe board and play. You choose a move by using the arrows keys and then pressing enter to plant your move. You can see where you will plant your move thanks to a highlighted boarder.
  5. In the play screen, you can type q + enter to go back to the home screen and r + enter to restart.

Users can make move.

Currently, user can control the highlighted cell to move around. Time to allow users can actually make moves

  • Display _curPlayer in a widget.
  • Pressing Enter actually plants the move.
  • Unsuccessful moves are ignored
  • Successful moves also switches _curPlayer.

UI Finalizations

  • There should be a little that shows which option in the home screen we are on
  • Pressing Esc in the play screen displays the exit menu (two options: continue or exit).
  • The exit menu should also have the little .
  • Challenge: Flicker the little . I think I can use forkIO and bricks.bChan to do this.

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.