# BrainGame

#### 1.0

braingame.tgz (1.0, unix)

## Overview

### Abstract

BrainGame is a lot like MineSweeper: you have a grid of little buttons which you can click on. However, what happens to the buttons is very different from MineSweeper. In BrainGame, a number on the button is incremented. The numbers rotate 0,1,2,3,0,1,... ad infinatum. Also, the buttons to the cardinal points around the button you click also get rotated. The entire array is scrambled at the beginning of the game, and it is your goal to unscramble (read: set every button to 0) the array.

### Introduction

BrainGame is a really old game (well, not that old. Before the Internet, but after Apple ][s) that I originally wrote for the Amiga; I don't remember where I got the idea from, but I didn't invent this game. I did, however, find it addicting, in the same way that MineSweeper is addicting. I kept meaning to write a Java version of it, but never got around to it while I still loved Java enough to waste time writing little programs like this in that language. While I still like Java, and I still make my living off it, my New Love is Ruby. I hacked this version, GUI and all, together in about two hours (including this documentation). This, above all else, is a testament to the Power of Ruby.

It had been so long since I played the game, that I mis-implemented it. The original game had two boards side-by-side. The right-hand-side was a non-changable map of the play board as it should look when finished. The left-hand-side was the play board. The goal was to make the left look like the right. In my misremembering, I created only one board, and rather than the game being to copy another board, the goal was to set the whole board to 0. Those two versions are really the same game, but with a different interface. Since my new version took up less space than the second, I've left it the way it is.

After I looked at the game the morning after I wrote it, I realized that my version strongly resembles, and may be identical to, another game which I've seen since the original BrainGame. Unfortunately, I can't recall the name of that other game... if you recognise it, please let me know.

I've decided to release this game anyway, since it is written. If you have fun with it, drop me an email.

### Features

Features? We don't need no stinking features.

## Operation

### Installation

Unpack and run it. Really, there isn't much to this program. You must have Ruby installed, as well as the Ruby-FLTK extension, which, of course, itself requires FLTK. They aren't difficult to install. That's it for requirements.

### Usage

You can run the game either in text or GUI mode. The text mode is really unpretty; I wrote it for testing, not for actual use. Still, if you have an itch, you can use it. Run "ruby text.rb" to use the text interface, and "ruby gui.rb" to run the GUI interface. For some real kicks, you can also run the unit tests with "ruby test.rb". There isn't much for you to do with the unit tests, but they're fun to watch. Well, I think they're fun to watch.

Quit by closing the window. The "New" button starts a new game (you have to do this at least once, or else there isn't much point). The "Undo" button will undo your moves as many times as you press it, to the start of the game.

## Status

### Known Bugs

No bugs, AFAIK.

### To Do

Really, all of these are probably two-liners, and it would be faster for me to implement them than write about them... but it turns out that I ran out of space for buttons in the game window, and I haven't figured out menus in FLTK (or even if menus are possible in FLTK), so I haven't added these features yet.
- A rewind button. This truely is a one liner.
- Variable grid size. This would also be really easy.