# SameGame

SameGame (さめがめ) is a tile-matching puzzle video game originally released under the name CHAIN SHOT in 1985 by Kuniaki "Morisuke" Moribe. It has since been ported to numerous computer platforms, handheld devices, and even TiVo, with new versions as of 2016.

## History

SameGame was originally created as Chain Shot! in 1985 by Kuniaki Moribe. It was distributed for Fujitsu's FM-8 and FM-7 platforms in a Japanese monthly personal computer magazine called Gekkan ASCII. In 1992, the game was ported as SameGame to Unix platforms by Eiji Fukumoto, to the NEC PC-9801 series by Wataru Yoshioka, and to Macintosh as ChainShot! by Eiichiro Mawatari. In 1993, it was ported to Windows 3.1 by Ikuo Hirohata. This version was translated into English by Hitoshi Ozawa, and is still available from his software archive. In 1994, Takahiro Sumiya ported it to Macintosh. This version has some gameplay differences—a choice of between two and five colors—and is probably the most widely distributed of the original series. It was the basis for the Same Gnome and KSame variations created for Linux.
In 2001, Biedl et al. proved that deciding the solvability (whether all blocks can be removed) of 1-column (or 1-row) 2-colour Clickomania can be done in linear time. Deciding the solvability of 2-column, 5-colour Clickomania is NP-Complete. Deciding the solvability of 5-column 3-colour Clickomania is also NP-Complete. Follow-up work in 2015 by Adler et al. proved that deciding the solvability of Clickomania is hard even in the 2-column 2-colour case, as well as Parameterized complexity results on determining whether an instance of size n is solvable in k or fewer clicks.

## Gameplay
### Game mechanics

SameGame is played on a rectangular field, typically initially filled with four or five kinds of blocks placed at random. By selecting a group of adjoining blocks of the same color, a player may remove them from the screen. Blocks that are no longer supported will fall down, and a column without any blocks will be trimmed away by other columns always sliding to one side (often the left). The goal of the game is to remove as many blocks from the playing field as possible.
In most versions, there are no time constraints during the game. However, some implementations gradually push the rows upward or drop blocks from above. Sometimes the player can control the number and timing of blocks that drop from above in certain ways. For example, on some implementations for the iOS, this can be done by shaking the device. The game ends if a timer runs out or if no more blocks can be removed. Some versions, including some versions for Windows Mobile, include both portrait and landscape orientations.

#### Variations

In one variation, the game starts with no blocks on the field. Blocks fall down to the playing field, and must be removed before they reach the top. If they reach the top and overflow, the game is over. In some variations, such as Bubble Bang, circles or balls are used instead of blocks—which alters the gameplay, as the balls form different shapes than square blocks.
In three-dimensional variants, the playing field is a cube (containing smaller cubes) instead of a rectangle, and the player has the ability to rotate the cube. "Cubes" for iPhone OS uses this approach.
Some versions allow the player to rotate the playing field 90 degrees clockwise or counter-clockwise, which causes one of two things to happen:
* The left and right sides become the bottom and the top, and the blocks fall to the new bottom. The orientation switches between portrait and landscape. NeoSameGame for iPhone OS uses this approach.
* The blocks fall to the left or right side, but the player must rotate the field back to portrait orientation (which is fixed). Bubblets Tilt for iPhone OS uses this approach.
In some variations, blocks can be removed when connected to blocks of the same color diagonally, not just horizontally and vertically. Some versions introduce new types of blocks. The different types of blocks interact in various ways with the play field; for example, one type might remove all the blocks in a row. An example of this is the "Revenge mode" in PocketPop Revenge (PocketFun) for iPhone OS.

#### Rules variations

* The game ends when the playing field is cleared, or if the remaining blocks cannot be removed. At the end of play, the player receives a score.
* When the playing field is cleared, instead of ending the game, a new level appears—usually harder, with more block types or lower time limits, or both. The condition for winning may vary between levels. Instead of clearing the whole level, for example, a certain score or a certain number of removed blocks must be reached. When the needed score is reached, in most versions the player is allowed to clear the rest of the level. If the player cannot reach the needed score—or if the timer runs out—the game ends, and the player receives a final score.
* In an "endless" variant, the game starts with an empty field. The blocks or balls start falling down; but if they reach the top, new blocks stop falling, so they do not overflow—thus, the game never ends. The player can end the game at any time by waiting for blocks to reach the top, then performing a special action (for example, right-click instead of left-click).
* Some versions have player lives. If a player reaches a losing condition one time, the game does not end; instead, a life is lost. If all lives are lost, the game ends.
* In the "continuous" variant, whenever a vertical set of blocks has been cleared and the remaining blocks have shifted to one side, a new, randomly selected column of blocks will pop up on the other side, thereby allowing a game to be played for an extended amount of time.
* In the "shift" variant, when a set of blocks has been cleared, all remaining blocks to the top and left will shift down and to the right.
* The "megashift" variant is a combination of the rules of the "continuous" and "shift" variations.

### Scoring

Most versions of the game give $(n-k)^{2}$ points for removing $n$ tiles at once, where $k=1$ or $2$, depending on the implementation. For instance, Insane Game for Texas Instruments calculators uses $(n-1)^{2}$; Ikuo Hirohata's implementation uses the formula $n^{2}-3n+4$. The Bubble Breaker implementation for Windows Mobile uses the $n(n-1)$ formula. The 2001 version released by Jeff Reno uses the formula $n(n-2)$.
Some versions also offer a large bonus for removing all blocks from the screen, or leaving no more than a certain number of blocks. Others reduce the final score based on the number of blocks remaining at the end of the game. Some game versions award bonus points for clearing the field quickly, encouraging faster play. The faster the player finishes the level, the bigger the bonus. Still others offer combination, or chain, bonuses for clearing the same color of blocks two or more times in succession.
Another scoring technique awards bonus points for each chain of a certain color that has a certain number of blocks (for example, two red blocks or 11 blue blocks). After receiving the bonus once, sometimes the bonus condition changes. BPop uses this scoring variation.
Some versions have a simple scoring system: each block removed is worth one point, and there is no bonus for removing more than two blocks at a time. This is seen in the Same Pets and Same Hearths variants.

#### Goal-based scoring

Some versions award scores based on the attainment of goals. This is typically seen in multi-level versions of the game. There are four primary scoring systems for such games.
In one variation, each level has a target score. The player's score starts at zero, and the player must reach the target score. At the beginning of each level, the player's score is reset to zero; the target score increases with each level.
Other versions have a cumulative target score. In these versions, the player's score carries over from level to level. As a result, if the player substantially exceeds the target score on a given level, they may enter the subsequent level having already met that level's target score, as well. BPop has a cumulative target score.
Some versions maintain the same target score for each level; such variations can be played indefinitely. In such games, the player typically loses due to poor planning or a lapse in concentration. Examples of such games are Same Pets and Same Hearths.
In games without a goal score, like Bonkers for iPhone and SameGameBros for iPhone, the goal is to clear the level completely. The game ends when the player fails to do so.

## Visuals

Blocks typically appear as colored squares, circles, or spheres. Some variations use gradient shading to give the illusion of dimensionality. Other tile themes, or skins, include animals, hearts, stars, faces, Lego blocks, and jelly bears. Designs may follow a theme, such as Christmas or monochrome. Most games have only one skin, but others allow choosing from multiple skins.
There is a special visual aspect in some versions; instead of separate blocks, games like iDrops and SameGameManiak feature bordered areas for adjacent blocks of the same color. Some have elaborate tile graphics, featuring pictures or patterns inside the tile, like KSame and Same GNOME.

### Variations
#### Reveal the picture

    The SameGame concept can be extended to a "Reveal the picture" game. A picture or photo is behind the blocks; it becomes increasingly visible as blocks are removed, until it is completely revealed. Examples include Same Pets, Same Hearts and the Nissan Cube promotional app for iPhone.

#### Animation

    Some games feature animation of one or more game events, such as cleared tiles bursting or exploding, or scoring animations (BPop, Bubblets Tilt).

#### Block highlighting

    Some versions display which blocks are selected with a border around them (BPop), jittering of the blocks (BPop), or an increase of the size of the selected blocks (Bubblets Tilt). If the blocks are deselected (usually by dragging away from them, or tapping another block chain or a single block), the highlight is removed.

## Versions

Versions of SameGame :
| Name | Author | Release Date | Platforms | Notes |
| Chain Shot! | Kuniaki Moribe | 1985 | Fujitsu FM 8/7 · PC-8801 · PC-9800 · N5200 (1988) · Macintosh (1992) | The original iteration of the game had a 20×10 playing field and four colors. |
| Same Game | Eiji Fukumoto | 1992 | Unix | The first version titled Same Game; it increased the number of colors to five. |
| Same Game | Wataru Yoshioka (W. Yossi) | | PC-9801 | |
| Same Game | Ikuo Hirohata (Japanese) Hitoshi Ozawa (tr. English) | 1993 | Windows 3.1 | Added an optional large field of 25×15. The large field requires an 800×600 desktop resolution. |
| KSame Same Gnome Swell Foop | | | | Based on Takahiro Sumiya's Macintosh version. |
| Undake 30: Same Game | | 1995 | SNES | Featured Mario franchise-related icons: Mario's head, coins, Super Mushrooms, Fire Flowers, and Yoshi eggs. |
| Same Game Plus | Yuuki | 1995 | X68000 | For SX-WINDOW system software. As featured in the December 1995 issue of Oh! X. |
| Same Game | Shimada Kikaku | 1997 | Game Boy | Published by Hudson. |
| ChainShot Gold | Kuniaki Moribe | 1997 | Windows 3.1/Windows 95 | A remake of ChainShot (1985). |
| ColorFall | Michael LaLena | 1998 | Java/Browser based | Added the concept of levels. Clear levels by removing a fixed number of colors. New colors are added every level. Five different versions are available. |
| Clickomania! | Matthias Schüssler | 1998 | Windows | Board size and number of colors are configurable. Originally the goal was only to clear the playing field, the number of blocks removed in one turn did not affect the score. This is still the default setting. |
| SameGame | Ronald van Dijk | 1999 | Amiga | It has a 15×10 playing field and three colors. |
| Sega Swirl | Scott Hawkins (Sega) | 1999 | Dreamcast · Adobe Shockwave · Palm OS | |
| MacStones | Craig Landrum | 1999 | | Based on Same Gnome. |
| Cascade | | 1999 | Psion Revo | |
| Mahki | | 1999 | Arcade game, Nintendo DS, Wii, Web browser | Included in the Touch Master countertop cabinet arcade game starting with the Touch Master 7000. Re-released with modifications in 2008 as part of TouchMaster 2 for the Nintendo DS, and online as part of "Midway Arcade." |
| Flux | MasterWorks | 2000 | Puzzle/Arcade game, PC | Made using Direct X. |
| Spore Cubes | René Boutin / Spore Productions | 2000 | Web browser, Windows, ActionScript 3, Palm OS, Pocket PC, iOS, Android (operating system) | Inspired by the addictiveness of Clickomania! (see above), this game featured two skill levels which varied the number of colors in the playfield, consisting of 10 x 13 cubes. The original version of the game had randomly selected images behind the cubes, such that when the playfield was cleared, the player could see the entire image. |
| Maki | Christopher G. Stach II | December 2000 | Java applet/Browser based | Based on Mahki. Three difficulty levels, five colors, $(n-2)^{2}$ scoring, cleared board bonus, online high scoring. |
| PocketPop | PocketFun | 2001 | Pocket PC | Won a number of awards, including Best Game, in Pocket PC Magazine 2001. |
| Bomberman 64 | Racjin/Hudson Soft | 2001 | Nintendo 64 | Includes a SameGame minigame that features Bomberman-themed icons and four different field sizes. |
| Jawbreaker | | 2003 | Pocket PC | |
| Bomberman Land 2 | Racjin/Hudson Soft | 2003 | GameCube, PlayStation 2 | An update of the version seen in Bomberman 64, with additional icon sets and field sizes. |
| Bubble Shot | FingerFriendlySoft | | iOS | A Bubble Breaker–compatible game where adjacent bubbles visually melt into larger bubbles. Includes additional "Folding" and "Black Hole" modes and static challenges. |
| Sega Swirl 2 | Scott Hawkins (Sega) | 2006 | Windows | The sequel to Sega Swirl, which was only available through GameTap. |
| bubbles.el | Ulf Jasper | February 2007 | GNU emacs | Can display using graphics or text, according to availability |
| SameGame | Steve and Oliver Baker | 2008 | JavaScript | Online version that allows configuration of board size, number of colors and offers a range of alternative tile themes to play with. |
| Bubble Bang | Decane | January 2009 | Web browser and iOS | Three-dimensional game using balls instead of blocks. The iOS version uses Nvidia PhysX for realistic physics. The web browser version requires Unity. |
| SameGame | Alan Alpert | July 2009 | All supported Qt platforms | Written as a QML/QtQuick demo. |
| Pop'Em Drop'Em SAMEGAME | Hudson Soft | March 23, 2009 | WiiWare | |
| SameGame | Torbjörn Gustafsson | February 2009 | Android (operating system) | |
| Bubble Drop! | Gizmobuddy.com | | Symbian S60 | Includes the ability to selectively remove obstructing bubbles by using "tools", "acid", "fire", or "bomb", and with eight different gameplay modes of three and six colors. Players can submit high scores to a website. |
| ColorBalls | Pistooli | March 2010 | Haiku OS | |
| Click-o-mania HTML | Bugaco | January 2011 | JavaScript | Written in GWT |
| Cube Crush | Gregor Haag | June 2011 2015 2016 | ActionScript 3 Html5 Android (operating system) | Written in OpenFL to be cross-platform. Online Highscores. 3 and 4 color mode. |
| Maki | appsburgers | September 2011 | Android (operating system) | |
| Bubblet | Edouard Thiel | October 2011 | Linux, Mac OS X, Windows | Written in C and included in EZ-Draw |
| Bubblet-js | Benoit Favre | October 2011 | JavaScript | Online version, translated from C using EZ-Draw-js |
| Tapotron | Demura Games | October 2013 | iOS | |
| One More SameGame | Dušan Saiko | October 2014 | QT5 | Online score synchronization, multilanguage, installation packages for Android, Windows, Linux |
| SCRUSH | Zafar Iqbal | December 2016 | Scratch (programming language) | Online, Multi-platform, Highscore |
| samegame1k | Gábor Bata | February 2017 | JavaScript | Online version, in 1024 bytes of JavaScript. An entry for the JS1k 2017 code golfing competition |