zigster64 / zig-zag-zoe Goto Github PK
View Code? Open in Web Editor NEWMultiplayer TicTacToe - in Zig - using HTMX for that zero-javascript experience
Home Page: http://zig-zag-zoe.com
License: MIT License
Multiplayer TicTacToe - in Zig - using HTMX for that zero-javascript experience
Home Page: http://zig-zag-zoe.com
License: MIT License
Like when node serve prints the available addresses for the current app, need to get this and print it on boot
sometimes a login doesnt set the player ID ??
or maybe its just the client i was using was caching an old version - dont know
keep an eye out for it happening again
There remains 1 teeny memory leak, which I think is related to having the resReqPool growing when the pool is full.
It does correctly free the resources at the end - but maxis remains bumped. Unless there is something else being allocated inside a response or request that is not being freed ? Hard to tell
Running an experiment now with the pool-overflow branch of http.zig, set the pool size to 32, and shrink the audio files down so that the response buffers can be shrunk as well
Experimenting on local, this gives me a build that has zero allocations - even during DOS attack, so lets run this up on AWS for a week and see how it copes
Do a video blog walkthrough of the code
Generate a deck of cards, shuffle them, and hand them out to users
Each user has a hand of cards that are displayed on their console.
When its their turn, they can select to play a card - this removes the card from their hand for the rest of thegame
cards could be things like -
Memory usage is a LOT better, but its still growing at a slow but steady rate.
See https://github.com/zigster64/pthread-test for a deeper dive into getting memory stats based on pthread usage
Add special ability to reverse the flow of play
useless in a 2 player game, but useful in 3 or more players
add soundeffects to the app
Its a bit lame having a plaintext player_id embedded in the HTML to get the player ID on PUT requests
Change this so that the HTML only stores a single thing - being a UUID generated by the backend
Call this X-SESSION, and include it in all the post headers
Then on the backend, have a hashtable that associates these UUIDs with session details - including the player id, some TTL duration / expiry date, etc
When the game state returns to init, then invalidate all the sessions
That way, a user cant simply replay an old UUID, or try to guess a new valid UUID
Also means that a bunch of state can be attached to the UUID, and only stored at the backend, not placed on the frontend where it can be easily hacked.
On iOS, still getting some audio issues
main screen ting notifications work fine, but zero wing, bomb and victory audio is not playing
Make the game clear itself and restart after an idle timeout
If no incoming traffic with valid X-SESSION ids have been seen for some duration, then kill the game and reset it
be able to group players into teams, so they can collaborate against an enemy team to win
Make it so there are between 0 and 3 teams max
default is 0
If teams is between 1-3, then on choosing a login, choose a team as well
When playing in Team Mode, then denote the boxes with the team color rather than the player color
Need a way of signalling all existing event handlers to be terminated
.. i think anyway, might need to check whether this is happening automatically when the client end goes away
some squares can randomly contain landmines that explode when entered
Allow shapes other than simple straight lines to be victorious, as options
Apply a custom dispatcher to automate all request logging
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.