With the recent coding games presented by @NataliaKazakiev and @DefendyPug, I present to you… Code Arranger!
How it Works
This game is inspired by the indie game Move Code Lines, where you simply move lines of code to find a desired output.
In a levels-based system, it progressively gets harder to solve. Instead of taking turns like in these other games, the player who answers the problem first gets a point and gets to create the next puzzle. Whoever gets to ten points first wins!
How to Play
As soon as the next puzzle is posted, you can begin working on a solution. To solve the puzzle, you need to move the provided code lines around, whether that be to a different line or inside of a function, to eventually log the expected output. You are not allowed to alter any lines provided, create, or delete lines, and every line must be used.
The solution does not need to be in the provided puzzle language, but the translation must be accurate to the original, and you should state the language when providing your solution.
Always use the preformatted text option, or backticks when providing code, as it makes the solution much easier to read. Also, using your language’s syntax highlighting is a nice touch
If you want some more information about submitting code, @not-ethan’s guide is great!
Creating Puzzles
If you answer the puzzle correctly first, you will receive a point and the right to create the next puzzle. Any language will do, preferably one that is well-known and easy to test, like Python and JavaScript. I will also accept Psuedocode and other languages that well represent the problem and a logical way to solve it, but make sure to provide the language along with your puzzle.
A puzzle should have code lines, which can be mixed in any order, and the expected output. The output must be possible to obtain with the provided code lines, or the puzzle may be unsolvable. Make sure to keep track of the answer to compare with a user’s answer.
Also, just because a user’s answer doesn’t match yours doesn’t mean its wrong! There could be some alternative solutions that you were not aware of.
When creating a puzzle, a few rules are in place.
- Don’t import any modules, only built-in functions are allowed. (Using built-in modules like Python’s
os
andtime
are allowed, but modules installed usingpip
and other tools are not.) - The puzzles should get progressively harder, don’t jump up from a beginner to a senior developer difficulty.
- All puzzles should be readable and well-tested.
- Have fun! Implement some lesser-known features of your language, or add-on to a well-known feature.
Here’s a very simple example puzzle, and the puzzle we will use to start us off.
Code (in Python):
print(a)
a = 4
Expected Output:
4
Have fun! Scores posted below will be updated daily.
@OmegaOrbitals: 1 Point
@Idkwhttph: 3 Point
@QwertyQwerty88: 2 Points
@dragonhunter1: 1 Point
@ParanormalCoder: 1 Point
@SnakeyKing: 1 Point