Share your repls and programming experiences

← Back to all posts
[GAME] Swap — A unique and fun puzzle game
fuzzyastrocat (742)

I've always enjoyed puzzles, but I've noticed a pattern in difficult puzzles — puzzles tend to be difficult because of how much stuff they have. Whether that's tiles, pegs, cubes, or anything else, the difficulty of the puzzle is always due to the amount of things it contains.

So, naturally, I decided to try the opposite: making a difficult puzzle with very few things. In my opinion, I've achieved this goal: I can't even solve my own puzzle sometimes, and it only has 4 tiles! (Yes — a difficult 2x2 tile puzzle!)

Each tile is numbered, and each number corresponds to a correct position. They can also be "flipped" (lighter) or "regular" (darker). The goal of the puzzle is to get each tile to the correct position (tiles will become green when they are in the correct position) and green-side-up (tiles in the correct place but the wrong side up will show up as pinkish-red).
There's instructions in-game: just click the "help" button.

Hope you enjoy! (And yes, all puzzles are solvable — the random initial state is made by repeated random moves, all of which are valid moves.)

EDIT: Proof that it is solvable — by blindly fumbling around I solved it in 52 moves. Can you do better?

EDIT: Current record: 4 moves by @poetaetoes

(Site design inspired by @rjlevy's "Sliders", but all CSS and HTML was written from scratch aside from a little borrowed html from w3schools.com.)

Commentshotnewtop
fuzzyastrocat (742)

If anyone finds a reliable solving method, post it here!

LoganB2 (4)

What does it mean when it turns pink, I got it in the right position, but then 2 blocks turned pink

fuzzyastrocat (742)

@LoganB2

(tiles in the correct place but the wrong side up will show up as pinkish-red)

Each time you move a block, each block that is not diagonal from it (ie, in the same row or column) "flips over". You need to find a way to flip over those bottom two without changing their position (or by changing their position and then moving them back). I would help you if I could, but I honestly don't know how to do that from here. (I know it's possible though, so just mess around and you might figure it out!)

maxyang (77)

arrgh this is so hard, I got 46

maxyang (77)

Great work though, this certainly is unique!

fuzzyastrocat (742)

@maxyang Thanks! I designed it to be hard, so don't feel bad... I have trouble solving it myself! (If you really enjoyed it, feel free to upvote! :D)

SiddhantKcode (2)

Completed

in 11th trial, amazing work buddy !

fuzzyastrocat (742)

@SiddhantKcode Nice! 18's pretty low, I'll add you to the main post.

poetaetoes (284)

@fuzzyastrocat
I BEAT HIM SO YOU BETTER PUT ME UP THERE THIS INSTANT!!
May you please add me on the leaderboard?

fuzzyastrocat (742)

@poetaetoes Sorry about that, I was not on repl talk at the time :)
(If you liked it, feel free to leave an upvote :D)

fuzzyastrocat (742)

@DynamicSquid Thanks! It definitely took a while :D

fuzzyastrocat (742)

I've fixed some bugs along with some stylistic issues (i.e, the scrambling being harsh on the eyes). Enjoy!

JosephSanthosh (1192)

Nice, but it can be sensitive to photosensitive-eplliptic viewers!

fuzzyastrocat (742)

@JosephSanthosh Oh, you mean the scramble? Yeah, I just noticed that — it wasn't happening during testing but now it seems to happen a lot :P I'm trying to fix it, when/if I do I'll get back to you on that!

fuzzyastrocat (742)

@JosephSanthosh I've made the blocks fade away when scrambling and get replaced by a "scrambling..." message. Hope that helps!

poetaetoes (284)

lol
first click any two squares, then spam the other two and...

Bam! Your done!

fuzzyastrocat (742)

@poetaetoes Ha! That usually works, but it's pretty inefficient.

poetaetoes (284)

@poetaetoes

WOW. NOW ME THE LEADER. YEEEEEE

poetaetoes (284)

@poetaetoes
lmfao nobody will beat me,

fuzzyastrocat (742)

@poetaetoes WOW Nicely done! Not sure if it's luck or skill, but regardless I'll put you on the main post!

MemeManHimself (80)

I got 50 and I honestly had no strategy. This game is too hard to have a strategy in! XD

fuzzyastrocat (742)

@MemeManHimself Yeah, I can't seem to find any strategy for it that works reliably. But who knows, maybe someone will!

RolandJLevy (497)

Hey @fuzzyastrocat, well done on your swap game. It's great! It's much harder than it looks. I'm still trying to solve it! 😀

fuzzyastrocat (742)

@rjlevy Thanks! I've only solved it once (picture now included in main post), so don't feel bad if you can't solve it yet! :D

RolandJLevy (497)

@fuzzyastrocat haha! thanks. I really like the swap animation - very nice 👍

fuzzyastrocat (742)

@rjlevy Thank you! The CSS animations definitely took a while to get right.

mwilki7 (1104)

it does not say the puzzle is complete

fuzzyastrocat (742)

@mwilki7 That's because all the blocks have to be green-side-up. Notice how when you click on a block it "inverts" the colors of all the blocks except the one diagonally across from it? That's how you can make those two on the bottom become green-side-up. In doing so, you'll move some blocks around, but that's part of the puzzle! :D
Unfortunately, I can't tell you exactly how to solve the puzzle from this position, since I actually don't know how to! (But I know it's possible)

There's more info on this in the in-game help and the post above.