SGTโ€FLOOD(6)

sgt-flood(6) ๐Ÿฆ‹๐Ÿ’– Flood-filling puzzle ๐Ÿ’…

okay so bestie, welcome to sgt-flood(6) โ€” it's the Games one, and we're doing part 1. Buckle up, because this page is long but lowkey iconic. No cap, we're keeping every single detail. Periodt. โœจ


NAME ๐Ÿ’–

sgt-flood โ€” Flood-filling puzzle. That's the name, that's the vibe.

SYNOPSIS โœจ

sgt-flood [--generate n] [--print wxh [--with-solutions] [--scale n]
[--colour]] [game-parameters|game-ID|random-seed]

sgt-flood --version

That first line is how you launch it, and sgt-flood --version just tells you the version. Slay.

DESCRIPTION ๐ŸŒŠ

So picture this: you get a grid of squares, and they're coloured randomly in multiple colours. Every move, you can flood-fill the top left square with a colour of your choice. Translation? Every square that's reachable from the starting square by an orthogonally connected path of squares all the same colour gets filled in with that new colour. As you do that, more and more of the grid gets connected to the starting square. It's giving chain reaction. ๐Ÿ’…

Your goal is to make the whole grid the same colour in as few moves as possible. The game sets a move limit using its own internal solver, and you win if you can make the whole grid one colour in that many moves or fewer. Easy? No. Iconic? Yes.

I saw this game (with a fixed grid size, fixed number of colours, and fixed move limit) at http://floodit.appspot.com (no longer accessible).

Flood controls ๐ŸŽฎ

Playing Flood is simple: click the mouse in a square. The top left corner and everything connected to it will be flood-filled with the colour of the square you clicked. But if you click a square that's the same colour as the top left corner, nothing happens โ€” so it doesn't count as a move. Bye, wasted moves.

You can also use the cursor keys to move a cursor (outline black square) around the grid. Pressing the return key will fill the top left corner in the colour of the square under the cursor. Keyboard besties, we see you.

(All the actions described below are also available.)

Flood parameters ๐ŸŽจ

These parameters are available from the โ€˜Custom...โ€™ option on the โ€˜Typeโ€™ menu.

  • Width, Height โ€” How big the grid is, measured in squares, bestie.
  • Colours โ€” How many colours fill the grid. Minimum is 3 (because with two colours there would only be one legal move at any stage, hence no choice to make at all), and maximum is 10. So no, you can't do 2 or 11. Sorry.
  • Extra moves permitted โ€” This one controls difficulty by bumping up the move limit. For every new grid, Flood runs its internal solver to make its own solution, and then this number gets added to the length of Flood's solution to get the game's move limit. So 0 means you have to be just as efficient as Flood's automated solver, and a bigger number makes it easier.

Heads up though: Flood's internal solver might not find the absolute shortest possible solution, though I believe it's pretty close. So for a real challenge, set this value to 0 and then try to solve a grid in strictly fewer moves than the limit you're given!

Common actions ๐Ÿ’…

These actions are all available from the โ€˜Gameโ€™ menu and via keyboard shortcuts, in addition to any game-specific actions.

(On Mac OS X, to conform with local user interface standards, these actions are situated on the โ€˜Fileโ€™ and โ€˜Editโ€™ menus instead.)

  • New game (โ€˜Nโ€™, Ctrl+โ€˜Nโ€™) โ€” Fresh start, random initial state, let's go.
  • Restart game โ€” Puts the current game back to how it started. And yes, you can undo this, so don't panic.
  • Load โ€” Opens up a saved game from a file on your disk.
  • Save โ€” Saves your current game state to a file on disk. And the Load and Save combo preserves your entire game history, so you can save, reload, and still Undo and Redo stuff you did before saving. No history lost, periodt.
  • Print โ€” Where it's supported (currently only on Windows), this opens a dialog so you can print any number of puzzles randomly generated from the current parameters, and you can optionally include the current puzzle too. Obviously only for puzzles that make sense to print โ€” it's hard to think of a sensible printable representation of Fifteen! ๐Ÿ’€
  • Undo (โ€˜Uโ€™, Ctrl+โ€˜Zโ€™, Ctrl+โ€˜_โ€™, โ€˜*โ€™) โ€” Takes back one move. You can undo all the way back to the start of the session, so go off.
  • Redo (โ€˜Rโ€™, Ctrl+โ€˜Rโ€™, โ€˜#โ€™) โ€” Puts back a move you undid earlier. The comeback.
  • Copy โ€” Copies your current game state to the clipboard as text, so you can paste it into an e-mail client, a web message board, or wherever you're discussing the game with someone else. (Not every game supports this feature, so if it's missing, that's why.)
  • Solve โ€” Boom โ€” instantly transforms the puzzle into its solved state. Some games (Cube) don't support this at all because it's of no particular use. Other games (like Pattern) use the solved state to give you info, especially if you can't see how a solution can exist at all or you want to know where you made a mistake. Then there are games (like Sixteen) where automatic solution tells you nothing about how to get to the solution, but it does give you a quick way to get there so you can experiment with set-piece moves and transformations. Some games (like Solo) can solve a game ID you typed in from elsewhere. Other games (like Rectangles) cannot solve a game ID they didn't invent themself, but when they did invent the game ID they already know the solution. Still other games (Pattern) can solve some external game IDs, but only if they aren't too difficult. The โ€˜Solveโ€™ command adds the solved state to the end of the undo chain for the puzzle. So if you want to go back to solving it yourself after seeing the answer, just press Undo. No shame.
  • Quit (โ€˜Qโ€™, Ctrl+โ€˜Qโ€™) โ€” Closes the whole app. Bye bestie.
  • Preferences โ€” Where supported, this opens a dialog for personal preferences about a particular game. Some are game-specific, some are common to all games. One common option lets you turn off the one-key shortcuts like โ€˜Nโ€™ for new game or โ€˜Qโ€™ for quit, so you're less likely to hit them by accident. You can still use the same shortcuts with the Ctrl key, so you're not losing anything.

Specifying games with the game ID ๐Ÿงš

Okay so there are two ways to save a game specification from a puzzle and bring it back later, or recreate it in somebody else's copy of the same puzzle. Two paths, same slay.

The โ€˜Specificโ€™ and โ€˜Random Seedโ€™ options in the โ€˜Gameโ€™ menu (or the โ€˜Fileโ€™ menu on Mac OS X) each show a piece of text โ€” a โ€˜game IDโ€™ โ€” that's enough to reconstruct exactly the same game later. Like a screenshot, but for puzzles.

You can paste either of those pieces of text back into the program later using the same โ€˜Specificโ€™ or โ€˜Random Seedโ€™ menu options, and it'll recreate the same game. You can also use either one as a command line argument (on Windows or Unix); more on that below.

The difference? A descriptive game ID is a literal description of the game's initial state, while a random seed is just arbitrary text that was fed to the random number generator that made the puzzle. So here's what that means:

  • Descriptive game IDs are usually longer in many puzzles (though some, like Cube (sgt-cube(6)), only need very short descriptions). So a random seed is often the quicker way to jot down the puzzle you're playing, or tell a friend so they can play the same one as you.
  • Any text at all is a valid random seed. The automatically generated ones are fifteen-digit numbers, but literally anything works โ€” your full name, a word you just made up, whatever. A valid puzzle will generate from it. This is also how two or more people can race to complete the same puzzle: you think of a random seed, everybody types it in at the same time, and nobody has an advantage from having seen the generated puzzle before anyone else. Fair and square, periodt.
  • You can often convert puzzles from other sources (like โ€˜nonogramsโ€™ or โ€˜sudokuโ€™ from newspapers) into descriptive game IDs that work with these programs. Newspaper puzzles, we're making you digital.
  • Random seeds are not guaranteed to give you the same result if you use them with a different version of the puzzle program. Why? Because the generation algorithm might have been improved or modified in later versions of the code, so it'll produce a different result from the same sequence of random numbers. If you aren't sure it'll be used on the same version of the program as yours, use a descriptive game ID instead. Safer, bestie.

(Use the โ€˜Aboutโ€™ menu option to find the version number of the program. Programs with the same version number running on different platforms should still be random-seed compatible.)

A descriptive game ID kicks off with a piece of text that encodes the current game's parameters (like grid size). Then there's a colon, and after that comes the description of the game's initial state. A random seed starts with a similar string of parameters, but then it has a hash sign followed by arbitrary data. That's the structural tea.

If you enter a descriptive game ID, the program can't show you the random seed that generated it, because it wasn't generated from a random seed. But if you enter a random seed, the program can show you the descriptive game ID derived from that random seed. One-way mirror, kinda.

Heads up: the game parameter strings aren't always identical between the two forms. For some games, there's parameter data with the random seed that isn't included in the descriptive game ID. That's because that parameter info only matters when generating puzzle grids, not when playing them. So for example, the difficulty level in Solo (sgt-solo(6)) is not mentioned in the descriptive game ID. It's giving behind-the-scenes only.

Also, these additional parameters are not set permanently just because you typed in a game ID. Example: you have Solo set to โ€˜Advancedโ€™ difficulty, and your friend needs help with a โ€˜Trivialโ€™ puzzle. They read out a random seed specifying โ€˜Trivialโ€™ difficulty, you type it in, and the program gives you the same โ€˜Trivialโ€™ grid your friend was stuck on. But once you finish playing it and ask for a new game, it automatically goes back to the โ€˜Advancedโ€™ difficulty it was previously set on. So it doesn't hijack your settings. Respectful.

๐ŸŽ€ The โ€˜Typeโ€™ menu ๐ŸŽ€

okay so if the โ€˜Typeโ€™ menu is even there, it might contain a whole list of preset game settings. Pick one of those and boom ๐Ÿ’ฅ โ€” you start a new random game with the parameters specified.

The โ€˜Typeโ€™ menu may also contain a โ€˜Customโ€™ option, which is your backstage pass to fine-tune game parameters. The parameters available are specific to each game and are described in the following sections. ๐Ÿ’…


๐Ÿ’– Specifying game parameters on the command line ๐Ÿ’–

(This section does not apply to the Mac OS X version.) ๐Ÿ๐Ÿšซ

The games in this collection deliberately do not ever save information on to the computer they run on: they have no high score tables and no saved preferences. (This is because the author expects at least some people to play them at work, and those people will probably appreciate leaving as little evidence as possible!) ๐Ÿ‘€๐Ÿ’ป

However, if you do want to arrange for one of these games to default to a particular set of parameters, you can specify them on the command line. ๐Ÿซถ

The easiest way to do this is to set up the parameters you want using the โ€˜Typeโ€™ menu (see above), and then to select โ€˜Random Seedโ€™ from the โ€˜Gameโ€™ or โ€˜Fileโ€™ menu (see above). The text in the โ€˜Game IDโ€™ box will be composed of two parts, separated by a hash. The first of these parts represents the game parameters (the size of the playing area, for example, and anything else you set using the โ€˜Typeโ€™ menu). ๐Ÿงš

If you run the game with just that parameter text on the command line, it will start up with the settings you specified. slay. โœจ

For example: if you run Cube (see sgt-cube(6)), select โ€˜Octahedronโ€™ from the โ€˜Typeโ€™ menu, and then go to the game ID selection, you will see a string of the form โ€˜o2x2#338686542711620โ€™. Take only the part before the hash (โ€˜o2x2โ€™), and start Cube with that text on the command line: โ€˜sgt-cube o2x2โ€™. ๐Ÿ’–

If you copy the entire game ID on to the command line, the game will start up in the specific game that was described. This is occasionally a more convenient way to start a particular game ID than by pasting it into the game ID selection box. ๐Ÿ‘‘

(You could also retrieve the encoded game parameters using the โ€˜Specificโ€™ menu option instead of โ€˜Random Seedโ€™, but if you do then some options, such as the difficulty level in Solo, will be missing. See above for more details on this.) ๐ŸŒธ


๐Ÿ’… Unix command-line options ๐Ÿ’…

(This section only applies to the Unix port.) ๐Ÿง

In addition to being able to specify game parameters on the command line (see above), there are various other options: ๐Ÿ”ฅ

  • --game โ€” says the command-line argument is treated as specifying game parameters. ๐ŸŽฎ
  • --load โ€” says the command-line argument is treated as a save file to load. ๐Ÿ’พ
Only one of these should be specified. If neither of these options is specified, a guess is made based on the format of the argument. ๐Ÿ•ต๏ธ
  • --generate n โ€” if this option is specified, instead of a puzzle being displayed, a number of descriptive game IDs will be invented and printed on standard output. This is useful for gaining access to the game generation algorithms without necessarily using the frontend. โœจ

If game parameters are specified on the command-line, they will be used to generate the game IDs; otherwise a default set of parameters will be used.

The most common use of this option is in conjunction with --print, in which case its behaviour is slightly different; see below.

  • --delete-prefs โ€” this option causes the puzzle to delete the configuration file in which its user preferences were stored, if there is one. ๐Ÿ—‘๏ธ
  • --print wxh โ€” if this option is specified, instead of a puzzle being displayed, a printed representation of one or more unsolved puzzles is sent to standard output, in PostScript format. ๐Ÿ–จ๏ธ

On each page of puzzles, there will be w across and h down. If there are more puzzles than wร—*h*, more than one page will be printed.

If --generate has also been specified, the invented game IDs will be used to generate the printed output. Otherwise, a list of game IDs is expected on standard input (which can be descriptive or random seeds; see above), in the same format produced by --generate.

For example:

sgt-net --generate 12 --print 2x3 7x7w | lpr

will generate two pages of printed Net puzzles (each of which will have a 7ร—7 wrapping grid), and pipe the output to the lpr command, which on many systems will send them to an actual printer.

There are various other options which affect printing; see below.

  • --save file-prefix [ --save-suffix file-suffix ] โ€” if this option is specified, instead of a puzzle being displayed, saved-game files for one or more unsolved puzzles are written to files constructed from the supplied prefix and/or suffix. ๐Ÿ’พ

If --generate has also been specified, the invented game IDs will be used to generate the printed output. Otherwise, a list of game IDs is expected on standard input (which can be descriptive or random seeds; see above), in the same format produced by --generate.

For example:

sgt-net --generate 12 --save game --save-suffix .sav

will generate twelve Net saved-game files with the names game0.sav to game11.sav.

  • --version โ€” prints version information about the game, and then quits. ๐Ÿ‘‹

The following options are only meaningful if --print is also specified:

  • --with-solutions โ€” the set of pages filled with unsolved puzzles will be followed by the solutions to those puzzles. โœ…
  • --scale n โ€” adjusts how big each puzzle is when printed. Larger numbers make puzzles bigger; the default is 1.0. ๐Ÿ”
  • --colour โ€” puzzles will be printed in colour, rather than in black and white (if supported by the puzzle). ๐ŸŒˆ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

Full documentation in /usr/share/doc/sgt-puzzles/puzzles.txt.gz. ๐Ÿ“š


๐Ÿ’– okay bestie, that's the whole page! Source/version: sgt-flood in the sgt-puzzles collection. Date: July 2025. Now go flood some grids and leave zero evidence at work. Periodt. ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from