The Dollar Game - (best played Full Screen) [New Game] to start a new Game, then ... Click anywhere under the pink line to create a vertex (hold the mouse down to fine tune a vertex's location), then [Spots Done?] when you think you have enough, then Click any 2 vertices to create a connecting Line. When you think you have enough, click [Lines Done?], when you can then relocate any of your Vertices by clicking on them and dragging them to a new spot. When you're happy with how it looks click [Play?] to begin Play, which you do by clicking a Spot. Each vertex (Spot) has a number of "Dollars", associated with it. Some of them will be in Debt (-ve). In play the clicked vertex has to donate $1 to each vertex it is connected to it. This may cause it to go into Debt even if it wasn't. Each clicked vertex constitutes a move. To WIN you must arrange it so that nobody is in Debt. All games created by this project are winnable! [Replay?] lets you Replay the Game you just won or Restart the Game you are in the middle of playing. [New $$ ?] - Replay same Game with New $ Values. [/\] - Upload a previously saved Game Code. [\/] - Creates a Game Code for the current Game [Menu] - shows a list of preset Games you can play After deciding which of the [Menu] games you'd like to play, click a [Tick] Box to the right to select that Game. NOTE: There are now no vacant slots in the [Menu] but I may still swap one on mine out, for one of yours, if I think it's better than mine. Click on the (?) slot in the [Menu] to see the "Rules" for inclusion of your Game. Here's a simple one you can triple-click to copy and paste with [/\] to see how it works, that I used in all my testing while developing this enhancement: 6$-4$-177$77$4$-84$97$-3$2$71$3$-133$-83$-4$-32$-84$7$-85$40$8$1$2$2$3$3$5$5$4$4$1$2$6$1$5$4$3$3$ I just took 26 moves to solve it, see if you can beat it? Works very nicely on touch screen devices!
Created by @gregatku for use in Coding Classes for Kids Unlimited, for whom I work as a Coding teacher. Thanks to @KU-James, a Chess Coach colleague, for bringing this game to my attention. He told me it would be my next obsession, and so it was. He also pointed out an excellent explanation of the game and most importantly how to ensure only winnable games are created with this project. It can be found here: https://www.youtube.com/watch?v=U33dsEcKgeQ According to the Numberphile video, the mathematics of how to solve it in the minimum number of moves, has not really been fully nutted out. Have fun with it! And a very big thank you to not only for encouraging me to extend the game to include Game Codes that could be saved and uploaded, but also to include a menu of preset Games so we could all play the same games if we wanted to. But his most important contribution to this project was showing me how to make all the Coin clones move simultaneously. And one more most interesting discovery made. He found that once you find a particular solution to a particular Game, if you record how many times you hit each Spot, then you can repeat that Game in an identical number of moves, by clicking each Spot the recorded number of times, in any order you like! I have proven his theory many times over on most of the 10 Games in the Menu, including the 3 with the highest Record Scores, and I can repeat those Record Scores exactly by clicking the Spots the required number of times, in the most obscure order you could imagine. If you are wondering why most of the $ values assigned to each vertex seem to be between -4 and 4, but more often than not there is one, whose value is outside that range. Well each Game's solvability depends on there being enough money in the Game. The Game generates a random value between -4 & 4 for all but the last spot, and its value is calculated so as to ensure a solvable Game. Each Game has what's known as its Genus, which is # Lines - # Spots + 1 If the sum of all the vertices' $ Values < Genus, then the Game is unsolvable. So it sets the Value of the last Spot (that you placed on the Stage) to whatever it needs to be so that the Total Sum of money in the Game is equal to its Genus. NOTE: The game is limited to a maximum of 200 vertices (spots). If you try to create a 200th one, it will ignore you and assume you hit [Lines Done?]. That's because the game needs 1 clone for each Vertex/Spot, and Scratch has an upper limit of 300 clones. That allows for a maximum of 100 coins to be sent in one move, which should be plenty. June 2021 Update: I finally fixed a bug that's been annoying me since I created the project, namely that if you touched an existing Vertex, when placing them, a new Vertex would be created at the same Spot that you couldn't actually see! It can't happen now. Also got rid of the Value Sprite by making a whole heap of Values costumes for the Vertices. This actually simplified some of the vertex code too and most importantly enabled me to fix a few more bugs. You can also now Play an uploaded or Menu game straight away without having to click [Play] first. Oct 2022 Update: The warning for clicking a Spot too quickly should never be displayed now, because it now ignores Spots clicked until all moving coins have stopped moving & all Spot values have been updated accordingly. Also fixed a couple of other annoying issues, such spots appearing & then disappearing when action buttons across the top or down the right side, are clicked. Enjoy! Regards Greg