A Competitive Coding Game Where Players Write Arbitrary Code
I wanted to think of a two player game where players write arbitrary code on their turns, and then compete to achieve some objective first. Here's what I've come up with:
As a sort of pie rule, player 1 picks an integer, and then player 2 gets to decide if they take the first "coding" turn, or if player 1 gets to instead. Let's say player 2 decides to do the first coding turn.
They then write a function that takes any and only integers and returns for each some other integer, and they put in their own integer, and it must output the integer that player 1 picked. Now player 2 must do the same thing.
Player 2 gets a score which is the number of programming "tokens" (like "while" or "max") used in the function's definition, minus the number of programming tokens that player 1 used. The length of the input integer in base 2 is also added to one's score. Any other explicit numbers in one's definition are also actually counted for their length in base 2 when scoring, and not just as one token. Also, each token or number that player 2 uses that player 1 also used counts for double the points (as a way to encourage player 2 to have a different solution than player 1).
After this, player 2 gets to put their own input integer into the function that they just wrote, and they get a new integer. Now player 2 must write another function that outputs that same integer using the same rules as before, and then player 1 must. Things keep going back and forth like that.
So far I've only tried playing with ChatGPT using a coding plugin, and ChatGPT played some rather uninspiring moves that were not very difficult to defeat. But I still think that the game could be interesting.