User blog:Sinthorion/Lights Out (a wikicode game)

This is version 2.0 of my Lights Out game, coded purely in wikicode (without having to add any Javascript or CSS and without being able to use full HTML). Lights Out is a classical puzzle game. If you click on one field, it will toggle it and all four neighbours from red to green and vice versa. The goal is to make all fields green.

You can play around and try to generate interesting patterns or you can click on the button below to generate a random pattern to solve. The solution generator helps you to find back to the default state from self created patterns, but it is deactivated after applying a random pattern.

Why did I make this game?
The game was a spontan idea that I got while working with custom collapsibles. I did it to challenge myself and to show how much can be done even with a simple markup language that is totally not meant for that. I like the challenge to use tools beyond their meant function.

 ⬛ ⬛  ⬛ ⬛   ⬛ ⬛   ⬛ ⬛   ⬛ ⬛   ⬛ ⬛    ⬛ ⬛   ⬛ ⬛   ⬛ ⬛   ⬛ ⬛   ⬛ ⬛   ⬛ ⬛    ⬛ ⬛   ⬛ ⬛   ⬛ ⬛   ⬛ ⬛  <span class="mw-customtoggle-solution-x5y3 mw-customtoggle-x5y3 mw-customtoggle-congrats-x5y3 mw-customtoggle-x4y3 mw-customtoggle-congrats-x4y3 mw-customtoggle-x6y3 mw-customtoggle-congrats-x6y3 mw-customtoggle-x5y2 mw-customtoggle-congrats-x5y2 mw-customtoggle-x5y4 mw-customtoggle-congrats-x5y4"> ⬛ ⬛  <span class="mw-customtoggle-solution-x6y3 mw-customtoggle-x6y3 mw-customtoggle-congrats-x6y3 mw-customtoggle-x5y3 mw-customtoggle-congrats-x5y3 mw-customtoggle-x6y2 mw-customtoggle-congrats-x6y2 mw-customtoggle-x6y4 mw-customtoggle-congrats-x6y4"> ⬛ ⬛   <span class="mw-customtoggle-solution-x1y4 mw-customtoggle-x1y4 mw-customtoggle-congrats-x1y4 mw-customtoggle-x2y4 mw-customtoggle-congrats-x2y4 mw-customtoggle-x1y3 mw-customtoggle-congrats-x1y3 mw-customtoggle-x1y5 mw-customtoggle-congrats-x1y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x2y4 mw-customtoggle-x2y4 mw-customtoggle-congrats-x2y4 mw-customtoggle-x1y4 mw-customtoggle-congrats-x1y4 mw-customtoggle-x3y4 mw-customtoggle-congrats-x3y4 mw-customtoggle-x2y3 mw-customtoggle-congrats-x2y3 mw-customtoggle-x2y5 mw-customtoggle-congrats-x2y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x3y4 mw-customtoggle-x3y4 mw-customtoggle-congrats-x3y4 mw-customtoggle-x2y4 mw-customtoggle-congrats-x2y4 mw-customtoggle-x4y4 mw-customtoggle-congrats-x4y4 mw-customtoggle-x3y3 mw-customtoggle-congrats-x3y3 mw-customtoggle-x3y5 mw-customtoggle-congrats-x3y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x4y4 mw-customtoggle-x4y4 mw-customtoggle-congrats-x4y4 mw-customtoggle-x3y4 mw-customtoggle-congrats-x3y4 mw-customtoggle-x5y4 mw-customtoggle-congrats-x5y4 mw-customtoggle-x4y3 mw-customtoggle-congrats-x4y3 mw-customtoggle-x4y5 mw-customtoggle-congrats-x4y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x5y4 mw-customtoggle-x5y4 mw-customtoggle-congrats-x5y4 mw-customtoggle-x4y4 mw-customtoggle-congrats-x4y4 mw-customtoggle-x6y4 mw-customtoggle-congrats-x6y4 mw-customtoggle-x5y3 mw-customtoggle-congrats-x5y3 mw-customtoggle-x5y5 mw-customtoggle-congrats-x5y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x6y4 mw-customtoggle-x6y4 mw-customtoggle-congrats-x6y4 mw-customtoggle-x5y4 mw-customtoggle-congrats-x5y4 mw-customtoggle-x6y3 mw-customtoggle-congrats-x6y3 mw-customtoggle-x6y5 mw-customtoggle-congrats-x6y5"> ⬛ ⬛   <span class="mw-customtoggle-solution-x1y5 mw-customtoggle-x1y5 mw-customtoggle-congrats-x1y5 mw-customtoggle-x2y5 mw-customtoggle-congrats-x2y5 mw-customtoggle-x1y4 mw-customtoggle-congrats-x1y4 mw-customtoggle-x1y6 mw-customtoggle-congrats-x1y6"> ⬛ ⬛  <span class="mw-customtoggle-solution-x2y5 mw-customtoggle-x2y5 mw-customtoggle-congrats-x2y5 mw-customtoggle-x1y5 mw-customtoggle-congrats-x1y5 mw-customtoggle-x3y5 mw-customtoggle-congrats-x3y5 mw-customtoggle-x2y4 mw-customtoggle-congrats-x2y4 mw-customtoggle-x2y6 mw-customtoggle-congrats-x2y6"> ⬛ ⬛  <span class="mw-customtoggle-solution-x3y5 mw-customtoggle-x3y5 mw-customtoggle-congrats-x3y5 mw-customtoggle-x2y5 mw-customtoggle-congrats-x2y5 mw-customtoggle-x4y5 mw-customtoggle-congrats-x4y5 mw-customtoggle-x3y4 mw-customtoggle-congrats-x3y4 mw-customtoggle-x3y6 mw-customtoggle-congrats-x3y6"> ⬛ ⬛  <span class="mw-customtoggle-solution-x4y5 mw-customtoggle-x4y5 mw-customtoggle-congrats-x4y5 mw-customtoggle-x3y5 mw-customtoggle-congrats-x3y5 mw-customtoggle-x5y5 mw-customtoggle-congrats-x5y5 mw-customtoggle-x4y4 mw-customtoggle-congrats-x4y4 mw-customtoggle-x4y6 mw-customtoggle-congrats-x4y6"> ⬛ ⬛  <span class="mw-customtoggle-solution-x5y5 mw-customtoggle-x5y5 mw-customtoggle-congrats-x5y5 mw-customtoggle-x4y5 mw-customtoggle-congrats-x4y5 mw-customtoggle-x6y5 mw-customtoggle-congrats-x6y5 mw-customtoggle-x5y4 mw-customtoggle-congrats-x5y4 mw-customtoggle-x5y6 mw-customtoggle-congrats-x5y6"> ⬛ ⬛  <span class="mw-customtoggle-solution-x6y5 mw-customtoggle-x6y5 mw-customtoggle-congrats-x6y5 mw-customtoggle-x5y5 mw-customtoggle-congrats-x5y5 mw-customtoggle-x6y4 mw-customtoggle-congrats-x6y4 mw-customtoggle-x6y6 mw-customtoggle-congrats-x6y6"> ⬛ ⬛   <span class="mw-customtoggle-solution-x1y6 mw-customtoggle-x1y6 mw-customtoggle-congrats-x1y6 mw-customtoggle-x2y6 mw-customtoggle-congrats-x2y6 mw-customtoggle-x1y5 mw-customtoggle-congrats-x1y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x2y6 mw-customtoggle-x2y6 mw-customtoggle-congrats-x2y6 mw-customtoggle-x1y6 mw-customtoggle-congrats-x1y6 mw-customtoggle-x3y6 mw-customtoggle-congrats-x3y6 mw-customtoggle-x2y5 mw-customtoggle-congrats-x2y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x3y6 mw-customtoggle-x3y6 mw-customtoggle-congrats-x3y6 mw-customtoggle-x2y6 mw-customtoggle-congrats-x2y6 mw-customtoggle-x4y6 mw-customtoggle-congrats-x4y6 mw-customtoggle-x3y5 mw-customtoggle-congrats-x3y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x4y6 mw-customtoggle-x4y6 mw-customtoggle-congrats-x4y6 mw-customtoggle-x3y6 mw-customtoggle-congrats-x3y6 mw-customtoggle-x5y6 mw-customtoggle-congrats-x5y6 mw-customtoggle-x4y5 mw-customtoggle-congrats-x4y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x5y6 mw-customtoggle-x5y6 mw-customtoggle-congrats-x5y6 mw-customtoggle-x4y6 mw-customtoggle-congrats-x4y6 mw-customtoggle-x6y6 mw-customtoggle-congrats-x6y6 mw-customtoggle-x5y5 mw-customtoggle-congrats-x5y5"> ⬛ ⬛  <span class="mw-customtoggle-solution-x6y6 mw-customtoggle-x6y6 mw-customtoggle-congrats-x6y6 mw-customtoggle-x5y6 mw-customtoggle-congrats-x5y6 mw-customtoggle-x6y5 mw-customtoggle-congrats-x6y5"> ⬛ ⬛ Click here to see the solution. Click here to hide the solution. To solve the game, click on all fields marked red in the solution. ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛  ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛  ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛  ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛  ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛                                        Congratulations, you solved the game!                                     <div id="mw-customcollapsible-pattern" class="mw-collapsible mw-customtoggle-pattern mw-customtoggle-started mw-customtoggle-solution-hidden    mw-customtoggle-x1y1 mw-customtoggle-congrats-x1y1      mw-customtoggle-x2y1 mw-customtoggle-congrats-x2y1      mw-customtoggle-x3y1 mw-customtoggle-congrats-x3y1      mw-customtoggle-x4y1 mw-customtoggle-congrats-x4y1      mw-customtoggle-x5y1 mw-customtoggle-congrats-x5y1      mw-customtoggle-x6y1 mw-customtoggle-congrats-x6y1      mw-customtoggle-x1y2 mw-customtoggle-congrats-x1y2      mw-customtoggle-x2y2 mw-customtoggle-congrats-x2y2      mw-customtoggle-x3y2 mw-customtoggle-congrats-x3y2      mw-customtoggle-x4y2 mw-customtoggle-congrats-x4y2      mw-customtoggle-x5y2 mw-customtoggle-congrats-x5y2      mw-customtoggle-x6y2 mw-customtoggle-congrats-x6y2      mw-customtoggle-x1y3 mw-customtoggle-congrats-x1y3      mw-customtoggle-x2y3 mw-customtoggle-congrats-x2y3      mw-customtoggle-x3y3 mw-customtoggle-congrats-x3y3      mw-customtoggle-x4y3 mw-customtoggle-congrats-x4y3      mw-customtoggle-x5y3 mw-customtoggle-congrats-x5y3      mw-customtoggle-x6y3 mw-customtoggle-congrats-x6y3      mw-customtoggle-x1y4 mw-customtoggle-congrats-x1y4      mw-customtoggle-x2y4 mw-customtoggle-congrats-x2y4      mw-customtoggle-x3y4 mw-customtoggle-congrats-x3y4      mw-customtoggle-x4y4 mw-customtoggle-congrats-x4y4      mw-customtoggle-x5y4 mw-customtoggle-congrats-x5y4      mw-customtoggle-x6y4 mw-customtoggle-congrats-x6y4      mw-customtoggle-x1y5 mw-customtoggle-congrats-x1y5      mw-customtoggle-x2y5 mw-customtoggle-congrats-x2y5      mw-customtoggle-x3y5 mw-customtoggle-congrats-x3y5      mw-customtoggle-x4y5 mw-customtoggle-congrats-x4y5      mw-customtoggle-x5y5 mw-customtoggle-congrats-x5y5      mw-customtoggle-x6y5 mw-customtoggle-congrats-x6y5      mw-customtoggle-x1y6 mw-customtoggle-congrats-x1y6      mw-customtoggle-x2y6 mw-customtoggle-congrats-x2y6      mw-customtoggle-x3y6 mw-customtoggle-congrats-x3y6      mw-customtoggle-x4y6 mw-customtoggle-congrats-x4y6      mw-customtoggle-x5y6 mw-customtoggle-congrats-x5y6      mw-customtoggle-x6y6 mw-customtoggle-congrats-x6y6  ">Click here to apply a random pattern (You can't use the solution after generating a random pattern) Click here to reload the page to generate a new pattern Some interesting facts:
 * The whole wikicode for the game is over 32,000 characters long.
 * I did not write all of it myself. The code was generated using a ruby script.
 * I'm not good in this game myself. I made a magic table that helps me to find a quick (though not optimal) solution for EVERY random pattern on one glance.
 * There are 68,719,476,735 different possible patterns the generator can generate, although many of them are the same pattern rotated or mirrored. With these duplicates patterns removed there are probably still over 100 millions of different patterns.
 * There is a chance that the generator makes all fields green, directly solving the game. This chance is smaller than winning a jackpot in the lottery.
 * For those who know about : This game uses over 100 custom collapsible classes.