robstallion / chess-elm Goto Github PK
View Code? Open in Web Editor NEWCreating a chess game with elm.
Creating a chess game with elm.
@RobStallion I'm really excited to see the progress on this project and feel that it's a really good showcase of both your Elm and critical reasoning skills! I would add it to your CV as a "spare time learning" project. Hiring/Engineering/HR Managers want to see that you are learning new skills in your own time not just "on the clock" ... it's a massive differentiator between you and your less proactive peers.
At present a person viewing your GH profile, sees only one thing:
But when they click to view the repo, it's kinda bare: https://github.com/RobStallion/chess-elm
If it is your only showcased repo on your profile, I would highly recommend that you make
it a showcase of your skills. You touched upon this fact in #2 but have instead dived into figuring out the Pawn moving algo. (I can see the appeal of diving into solving one of the challenges rather than documenting it ... but you must demonstrate Document-Driven Development if you want to show that skill to an observer...)
You don't need to have a fully formed UI, you can borrow one from https://chessui.com
Just having a chess board in your readme is a night-and-day difference from a blank one.
And with a bit of photoshop ("smoke and mirrors") you can illustrate the issue #1 you are currently working on; "available moves for king's pawn on home square with no obstructions":
Ultimately "as a reader" of our GH profile I want to be "wowed" by what you've been working on. π
Need to create the logic that will allow "en passant" captures.
For this I will need to have something in the state that stores whether or if a pawns last move was a "two tile move" (I don't think that there is a name for this. If there is please comment with it π)
This will probably be best stored in each pawn.
At the moment the a piece is made up of the following...
type alias Piece =
{ pieceType : PieceType
, team : Team
, status : PieceStatus
}
type PieceType
= King
| Queen
| Rook
| Bishop
| Knight
| Pawn
The PieceType
type is currently fairly simple. If I am going to store if a pawn is able to be captured "en passant" in each pawn I am likely going to have to update the PieceType
Pawn
.
As a person that plays IRL chess and wants to play remote chess
I need a way of saving the moves made in the game,
so that my remote partner/opponent can see them and make their next move!
I know this is on your mental list, but it's something someone
else
might be able to help with,
so capturing it in an issue means the requirement(s) can be discussed and progress made ... π
players
sessions (for authentication ... could just use https://github.com/dwyl/auth if it was ready ...? π€)
get_user_agent_string
)games
moves
Would you store just the "move" e.g: "Bb5" or the complete board on each move (FEN) ?
Authentication using:
Example of game using Algebraic Notation:
https://www.chess.com/article/view/magnus-carlsen-s-biggest-secret
In drafting a (suggested) schema to store moves in a game, I consulted the following SO Q/A:
Edits | View issue history |
---|---|
View History: http://localhost:4000/issues/388144218 |
putting this issue here as I didn't want to clutter the cs repo. Can copy over afterwards if needed
relates to #10
Msg
type that will send the selected Piece
and tileIndex
to update
update
that will take the Piece,
tileIndexand
model.board` and will return an updated boardI am not going to allow captures at this point or worry about move order. They will come later.
Need to create logic that checks if a king is in check.
If so it restricts the possible moves that other pieces can make so that it only allows moves that either:
Update model to keep track of which side's turn it is.
Spend some time to see if move file can be refactored. Seemed to be a lot of duplication first time round.
display the range of moves by color grading (brighter highlights are better moves) it would "win the internet"!
Taken from this comment
Keep track of the previous move.
Relates to #26
Look into logic that will be needed for capture
Edits | View issue history |
---|---|
View History: http://localhost:4000/issues/387354004 |
Displaying the possible moves on the board.
Idea of what it could look like taken from @nelsonic 's comment in #9
Decide what action causes possible moves to display
At the moment the Readme say to type the following command to run the project
elm-live src/Main.elm --open --dir=public -- --output=public/js/elm.js --debug
However I was too lazy to found out how to install elm-live π . I would suggest to make the demo of the project as easy/smooth as possible if you want people to play or contribute with elm-chess
elm-live looks like a good tool when developing:
A flexible dev server for Elm
Live reload included!
Maybe you could create a section "How to contribute" which explain how to run the project for development (learn elm at http://github.com/dwyl/learn-elm/, install elm-live with npm, ...).
And another section "Play now" which explain how to directly run the latest compiled version of the game (you'll need to run elm make
each time a PR is merged into master maybe). And the best solution would be to host elm-chess
on a Github page for example (or Heroku). I've done something like this for the elm-criteria package
Project looks nice otherwise π
Test time management apps so I can learn to manage my time more effectively.
How much time I spend cooking in a day, how much time I spend replying to issues in a working week, how much time I spend watching TV in a month, how much time I work on personal projects, etc...
Easily is KEY!!!!!!!!!!!!!!!!!!!!!!!!!!!!! to this. I NEED to be able to do this with minimal effort. So little effort that I don't even think about it otherwise I won't want to do it.
The reason I want to rank my tasks is so that I can focus on things that are more important.
There are things that are important, for example seeing friends, but I do not want to do that everyday for 5 hours a day. I also think personal 'unwinding' time is important (watching tv, playing ps etc...) but are these things taking up too much time and stopping me from doing other things I want to achieve, like BUILDING THIS APP?
Going to use this app first and see what I think of it. Will capture my thoughts in this issue.
Need to create a way to store current game state in local storage. Do not want games "lost" because of a browser refresh.
If local storage has a game state saved when a users comes to the site then they will be able to pick up where they left off
Stretch goals
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.