You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To improve Functional Programming skills, I decided to implement (Git Repo) the card game of Indian Rummy.
I would welcome any comments on making the code more idiomatic. I struggled a lot to come up with non-imperative code, often using the first functional pattern that worked.
It is a work-in-progress, but one non trivial function works - Given a Hand of 13 cards, produces all plausible melds in order of points (less is better). There is minimally tested code in src/game.ts to model the game.
The goal with this repo is to flesh out simulate_game.ts so that a few types of bots with different strategies can play against one another, and observe their success rates. I am not sure I can go as far as using reinforcement learning to improve strategies.
I am separately working on a React front and and a node backend so my friends/family/anyone can play this game online. It will all be open source of course.
Probably the bigger goal is to build it into a good real world fp-ts application. I definitely would need a lot of advice to make it a good model of functional and strongly typed code.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
To improve Functional Programming skills, I decided to implement (Git Repo) the card game of Indian Rummy.
I would welcome any comments on making the code more idiomatic. I struggled a lot to come up with non-imperative code, often using the first functional pattern that worked.
It is a work-in-progress, but one non trivial function works - Given a Hand of 13 cards, produces all plausible melds in order of points (less is better). There is minimally tested code in
src/game.ts
to model the game.The goal with this repo is to flesh out
simulate_game.ts
so that a few types of bots with different strategies can play against one another, and observe their success rates. I am not sure I can go as far as using reinforcement learning to improve strategies.I am separately working on a React front and and a node backend so my friends/family/anyone can play this game online. It will all be open source of course.
Probably the bigger goal is to build it into a good real world fp-ts application. I definitely would need a lot of advice to make it a good model of functional and strongly typed code.
Beta Was this translation helpful? Give feedback.
All reactions