Code Arranger Game

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 :slight_smile:

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 and time are allowed, but modules installed using pip 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

6 Likes

Here’s the answer!

a = 4
print(a)
1 Like

Great job! You can start working on creating your own puzzle now.

1 Like

Also, can I move as much code lines as I want when making a puzzle?

2 Likes

Yes! Add as many lines as you want in whatever order you think is best.

2 Likes

It’s a bit complicated, but it’ll do, I think.

(Python)

else:
  print("Smaller than 10!")
if number > 10:
  number = int(input("Enter a number! "))
  print("Greater than 10!")
3 Likes

That’s creative! Ordering the code and then actually getting input. Say, what is the expected output?

2 Likes
number = int(input("Enter a number! "))

if number > 10:
  print("Greater than 10!")
else:
  print("Smaller than 10!")
#uwu im done whats next uwu! :3

uwu! whe-were is m-muh pwoint! uwu!

1 Like

Uwu! twy awd swolev theis!
uwu!

#uwu!
#@solved by uwu!
#made by uwu!
#uwu!


#uwu!
case 'uwu!':
  print('OWO')
  match uwu:
    uwu = input('Come on lets go for uwu!! party! uwu!')
    case 'UWU!':
      print('Blush')
#UWU! FAT LITTLE HINT! uwu! uwu! uwu! it is uwu! uwu is uwu! uwu != uwu! but uwu == uwu! if statements == uwu! 

UWU! EXPWECTED AWPPOOT: OWO/Blush

1 Like

uwu! AI LWOVE PWOINT! ty for WON POINT uwu!

1 Like

Is that a real puzzle?

3 Likes

yes and ignore the lines that are in the hashtag

1 Like

Good job, that’s correct.

2 Likes

That has a lot of errors…

Did you actually test that?

2 Likes

uwu omega-chaaann twank yuuu uwu!

1 Like

uh huh yes i did it uses match/case because if statements are very bad

1 Like

One of the quotes is unclosed.

Also please stop spamming “uwu”.

2 Likes

:scream: s-sorry omega-chan
also i fixed the unclosed quote

1 Like

@bobastley where is muh point i have been waiting for 7 yrs

1 Like

Wait for it. Also, please stop sending unnecessary messages.

3 Likes