etimo / diamonds Goto Github PK
View Code? Open in Web Editor NEWProgram a bot and compete to get the highest score ๐ค ๐ท
Home Page: http://diamonds.etimo.se/
License: MIT License
Program a bot and compete to get the highest score ๐ค ๐ท
Home Page: http://diamonds.etimo.se/
License: MIT License
As of now you can join more than one board using your bot token.
Some kind of information (perhaps link to github readme) regarding how to get started and where to find implementation information. A link in the game gui?
Scripts that have been left "hanging" due to crashes, timeouts etc.
On several occasions the bot has got stuck on the top row constantly trying to move up north. If we can verify and fix this quickly, do it, otherwise it's not critical since it doesn't happen frequently.
Postgres? Cosmos?
Pretty simple, and we might save some bandwidth from it!
We want to display our data as fast as possible, therefore we should move the wait times from calling our api to after we've done the request rather than before as we have right now.
Implement POST (or should it be PUT?) /boards/{boardId}/join
Should return board, valid token should also be returned...
We want to be able to see visually what happens on the board and not allow one bot to perform 1000 moves instantly and overload the api.
diamonds.etimo.se?
challenge.etimo.se?
If a bot moves say 10 steps between a visual update in GUI it would be nice to see a visual representation of all moves done since last update. Would make it easier to follow game play.
Receives 403 after trying to move on the board it's no longer a member of =>
Traceback (most recent call last):
File "simple.py", line 147, in
board = Board(result.json())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Should determine result when moving, track score, current diamonds etc.
POST to /bots should return a persistent token that can be reused for multiple playing sessions
Right now we generate new diamonds as soon as one is picked up. We should instead wait until there are only a few left and then generate new ones up to a specific limit.
Since each bot is unique we should probably overwrite the bot's previous highscore with the new one (if better).
When time expires a bot should be given a score and added to high score list. How should this be determined, automatically with timer or by bot calling a /score endpoint or similar?
Persists bots, boards, highscores
Could be because position is struct and not class? If changed to class, need to override Equals
Azure? Docker? Both? Other alternatives?
PUT /boards/{boardId}/move + logic in game engine
Example run:
POST /bots {'name': 'Testbot', 'email': '[email protected]'}
<<< 200 {"id":null,"name":"Testbot","email":"[email protected]","token":"c1bb670c-fb46-4203-a96c-c669eebc1b90","boardToken":null}
Received token c1bb670c-fb46-4203-a96c-c669eebc1b90
POST /bots {'name': 'Testbot', 'email': '[email protected]'}
<<< 200 {"id":null,"name":"Testbot","email":"[email protected]","token":"a0d74eed-5cd4-4d5f-a3c8-6cdf9b04ab4a","boardToken":null}
Received token a0d74eed-5cd4-4d5f-a3c8-6cdf9b04ab4a
Should receive 409 status from second POST.
Environment:
MemoryStorage
Could include maze on board, possibility to walk thorugh walls etc.
api_1 |
api_1 | Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
api_1 | at Diamonds.Rest.Controllers.BoardsController.<>c__DisplayClass9_0.b__0(BoardBot b) in /app/Diamonds.Rest/Controllers/BoardsController.cs:line 114
api_1 | at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func
2 predicate)
api_1 | at Diamonds.Rest.Controllers.BoardsController.OnBotExpire(Object stateObj) in /app/Diamonds.Rest/Controllers/BoardsController.cs:line 114
api_1 | at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
api_1 | at System.Threading.TimerQueueTimer.CallCallback()
api_1 | at System.Threading.TimerQueueTimer.Fire()
api_1 | at System.Threading.TimerQueue.FireNextTimers()
Cleared database and restarted environment. Ran 1 bot for a minute and received exception.
Bots that have been left hanging due to timeouts, crashes etc. Remove from mongodb.
Implement /boards GET
Currently there should always be one active board.
Should not mutate state in GET
Now highscores is a global collection from all games on all boards. Not anything to worry about while having one board but it would give a false picture when comparing games from a 10x10 board with 3 players vs a 100x100 board with 20 players.
This will only be necessary once we want to host more than one project on etimo-app-server that needs to use port 80, right now we can live with what we have in production.
The docker script seems to be working for etimo-app-server only.
Right now we always draw it as 10x10 even if it's smaller
Make sure
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.