Post Reply 
A simple game with numbers. Get to the goal.
04-15-2018, 12:46 PM (This post was last modified: 04-15-2018 12:53 PM by pier4r.)
Post: #1
A simple game with numbers. Get to the goal.
--------------------
The game.

It is a basic idea, that I guess can be greatly extended to be really interesting (ex: matrix operations) but for the moment I don't see how.

One could call it "competing methods to reach the goal".

- The game is based on integer numbers and operations that returns integer numbers, no decimal number allowed.
- there is a starting integer number S that during the game becomes the current number C due to modifications.
- there is an ending integer number E
- there are a certain amount of units U that can be used to do operations at each round.
- The distance between S and E is bigger than U.
- At each round the order of play is randomized.
- Each round is played as follows.
-- The order of play of the players is decided.
-- A player can use UP units from U, being careful to leave at least 1 unit left for each player that has to play. Note that if at the end of the round there are units left, those gets added to the U value on the next round
-- A player can apply the following operations to C.
Either <C + UP> or <C - UP>
or it can split UP in two integers UP1 and UP2 to do
<C + (or -) UP1*UP2> or <C + (or -) UP1/UP2>
(that result of the * or - should be always an integer number!). Then C is updated with the result.
-- The result should be returned using a "small enough" footprint, be it time, or for programs time, memory, used functions and so on (the footprint depends on the device where it runs on). This because one could develop complicated strategies in a program. Instead the allowed programs could be relatively simple.
- The player wins when he applies a valid modification to C so that C=E

-------------------
Example.

Me playing against the sharp 506w where I applied an extra simple approach.
- Pick a random amount of units from the ones available in U.
- sum or subtract them to C to close the gap to E.

Code:

S=361
E=662
U=20

506w    | me
C=361 ; turn 1
        | pick 19
        | C=C+9*10
C=451
pick 1  |
C=C+1   |
C=452 

turn 2
pick 10 |
C=C+10  |
C=462
        | pick 10
        | C=C+5*5
C=487

turn 3
        | pick 19
        | C=C+9*10
C=577 (here against a more complicated strategy it could have been dangerous)
pick 1  |
C=C+1   |
C=578

turn 4
pick 19 |
C=C+19  |
C=597
        | pick 1
        | C=C-1
C=596

turn 5
        | pick 17
        | C=C+6*11
C=662=S

Note that to find the last step (how much to pick, and how to split it) one may use too much resources (time, memory, disallowed functions, etc..) so it is not that of an easy solution.

One may also need to gamble, getting near enough, hoping that the opponent doesn't get the turn.

--------------------
Background / digression / jump this part

I was inspired by calculator the game on android, gladiabots (on android as well). Then some documents from sharp about K-12 tasks with calculators (collected in the hp calc torrent ). Then also the bisection method to find roots (is the bisection method a sort of binary search?) helped.

The idea is to have a game that is not solvable in only one way (or having very similar solutions), like incremental games.
Therefore having a game that allows to play a bit with numbers, to use the calculators, in a dynamic and competitive fashion. Incremental games or games with an end are not bad at all, but they are not competitive or dynamic.

In calculator the game one has to find the right sequence of actions to get to the goal. In gladiabots it is the same, one plans a strategy and send it to battle. Anyway in gladiabots the opponent can change to offer different challenges. That is the interesting part, to have an opponent that affects your environment, and therefore your plan, and can be better than you, but it is not behaving exactly the same every time like a fixed challenge.

The complicated part for me is to find a way to adapt those ideas to mathematical (or arithmetical) problems using simple mathematics. Furthermore avoiding - if possible - problems that can be solved with a "perfect" strategy.

For example bulls and cows is a nice example (as it can be played with numbers). Although the game was solved, one can add constraints that make the game more interesting. Like a time/resource limit to provide an answer. So one would make an engine to test the answers and players can develop plans (or programs) that then fight each other on the behalf of the players.
The problem is that bulls and cows may require some elaborate program to avoid just guessing around and so it is not really fitting the idea of a quick challenge.

--------------------
Opinion

I believe there is a lot of potential for such challenges, but I am not aware of any similar ones already existing. If you know any, please share!

--------------------
Challenge

Please provide your programs or algorithms so they can play against each other / I (we) can play against them.

Example game with conditions:
S=361
E=662
U=20

It can use max 100 Mhz per move. So computed: pick your processor clock (multiply by the number of processors used in the process) and the number of seconds or fractions of seconds used by the algorithm. if you have, for example, a Dm42 running on batteries, at 20Mhz, the program can use up to 5 seconds for each move.
A 50g? Max 1.33 seconds (at 75mhz)
A 71B? Max 161 seconds (at 620 Khz)
A casio 9860G? Max 3.44 seconds (at 29Mhz)

The size really depends on the available functions on the calculator and the memory available. So for the moment it is free. The smaller the better of course (if one doesn't care about readability) and it is better when the programs use built in functions rather than additional ones.

Another limit should be the runtime footprint, as one program may keep in memory a lot of data. Once again, let's keep it free. The smaller the better of course.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)