SGT‐KEEN(6)

💖 SGT‐KEEN 💖

hey bestie, welcome to the manual page for sgt-keen, section 6 of the Games manuals 🌸 she's an arithmetic Latin square puzzle and honestly? she ate. let's get into it 🧮✨


✨ NAME ✨

sgt-keen — an arithmetic Latin square puzzle 🎀


📜 SYNOPSIS 📜

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

🌈 DESCRIPTION 🌈

okay so picture this: you've got a square grid, and every single square can hold a digit from 1 all the way up to however big the grid is. the grid gets chopped up into blocks — all different shapes, all different sizes, each with its own little arithmetic clue chilling inside it 🫶

your whole mission is to fill the ENTIRE grid with digits so that all of these are true, no exceptions:

  • Each row contains only one occurrence of each digit
  • Each column contains only one occurrence of each digit
  • The digits in each block can be combined to form the number stated in the clue, using the arithmetic operation given in the clue. That is:
    • an addition clue means that the sum of the digits in the block must be the given number. for example, ‘15+’ means the contents of the block adds up to fifteen 🧮
    • a multiplication clue (e.g. ‘60×’), same deal, means that the product of the digits in the block must be the given number ✖️
    • a subtraction clue will always be written in a block of size two, and it means that one of the digits in the block is greater than the other by the given amount. for example, ‘2−’ means that one of the digits in the block is 2 more than the other, or equivalently that one digit minus the other one is 2. the two digits could be either way round, though 👀 — she's flexible like that
    • a division clue (e.g. ‘3÷’), similarly, is always in a block of size two and means that one digit divided by the other is equal to the given amount ➗

now here's the part that trips people up, so read carefully bestie: a block may contain the same digit more than once (provided the identical ones are not in the same row and column). and girlfriend, this rule is precisely the opposite of the rule in Solo's ‘Killer’ mode — see sgt-solo(6) if you wanna compare receipts 💅

fun fact while we're here: this puzzle appears in the Times under the name ‘KenKen’. iconic name, no notes ✨


🎮 Keen controls 🎮

Keen shares much of its control system with Solo (and Unequal) — they're basically the same friend group 🫶

To play Keen, simply click the mouse in any empty square and then type a digit on the keyboard to fill that square. if you make a mistake (and it happens to the best of us 😭), click the mouse in the incorrect square and press Space to clear it again (or use the Undo feature, she's a lifesaver).

If you right-click in a square and then type a number, that number will be entered in the square as a ‘pencil mark’. you can have pencil marks for multiple numbers in the same square, stack 'em up 🌸 but heads up: squares containing filled-in numbers cannot also contain pencil marks. pick a lane, babe.

The game pays no attention to pencil marks, so exactly what you use them for is up to you: you can use them as reminders that a particular square needs to be re-examined once you know more about a particular number, or you can use them as lists of the possible numbers in a given square, or anything else you feel like. lowkey whatever works for your brain 🧠✨

To erase a single pencil mark, right-click in the square and type the same number again. poof, gone 💅

All pencil marks in a square are erased when you left-click and type a number, or when you left-click and press Space. Right-clicking and pressing Space will also erase pencil marks.

As for Solo, the cursor keys can be used in conjunction with the digit keys to set numbers or pencil marks. Use the cursor keys to move a highlight around the grid, and type a digit to enter it in the highlighted square. Pressing Return toggles the highlight into a mode in which you can enter or remove pencil marks 🔁

Pressing M will fill in a full set of pencil marks in every square that does not have a main digit in it — instant pencil-mark glow-up ✨

(All the actions described below are also available.) 👑


🧩 Keen parameters 🧩

These parameters are available from the ‘Custom...’ option on the ‘Type’ menu.

Grid size

Specifies the size of the grid. Lower limit is 3; upper limit is 9 (because the user interface would become more difficult with ‘digits’ bigger than 9!). yeah bestie, we're not doing double-digit digits today 😭

Difficulty

Controls the difficulty of the generated puzzle. At Unreasonable level, some backtracking will be required, but the solution should still be unique. The remaining levels require increasingly complex reasoning to avoid having to backtrack. so like, pick your poison 💀

Multiplication only

If this is enabled, all boxes will be multiplication boxes. With this rule, the puzzle is known as ‘Inshi No Heya’. slay, a whole other genre ✖️✨


🏆 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)

Starts a new game, with a random initial state. fresh grid, fresh me 🌸

Restart game

Resets the current game to its initial state. (This can be undone.) no pressure, you can always take it back 💖

Load

Loads a saved game from a file on disk.

Save

Saves the current state of your game to a file on disk.

The Load and Save operations preserve your entire game history (so you can save, reload, and still Undo and Redo things you had done before saving). it's giving ✨memory✨

Print

Where supported (currently only on Windows), brings up a dialog allowing you to print an arbitrary number of puzzles randomly generated from the current parameters, optionally including the current puzzle. (Only for puzzles which make sense to print, of course – it's hard to think of a sensible printable representation of Fifteen!) 🖨️

Undo (‘U’, Ctrl+Z, Ctrl+_, ‘*’)

Undoes a single move. (You can undo moves back to the start of the session.) time travel, but make it puzzle 🕰️

Redo (‘R’, Ctrl+R, ‘#’)

Redoes a previously undone move. rewind the rewind, we support it 🔁

Copy

Copies the current state of your game to the clipboard in text format, so that you can paste it into (say) an e-mail client or a web message board if you're discussing the game with someone else. (Not all games support this feature.) 📋

Solve

Transforms the puzzle instantly into its solved state. For some games (Cube) this feature is not supported at all because it is of no particular use. For other games (such as Pattern), the solved state can be used to give you information, if you can't see how a solution can exist at all or you want to know where you made a mistake. For still other games (such as Sixteen), automatic solution tells you nothing about how to get to the solution, but it does provide a useful way to get there quickly so that you can experiment with set-piece moves and transformations.

Some games (such as Solo) are capable of solving a game ID you have typed in from elsewhere. Other games (such as Rectangles) cannot solve a game ID they didn't invent themself, but when they did invent the game ID they know what the solution is already. 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. In other words, if you want to go back to solving it yourself after seeing the answer, you can just press Undo. so you can peek and then pretend you never did, we don't judge 🙈

Quit (‘Q’, Ctrl+Q)

Closes the application entirely. goodbye bestie, see you next session 👋

Preferences

Where supported, brings up a dialog allowing you to configure personal preferences about a particular game. Some of these preferences will be specific to a particular game; others will be common to all games.

One option common to all games allows you to turn off the one-key shortcuts like ‘N’ for new game or ‘Q’ for quit, so that there's less chance of hitting them by accident. You can still access the same shortcuts with the Ctrl key. so if your cat keeps quitting your game, there's a fix 🐱💜

🦋 okay don't go anywhere bestie — there's a whole part 2 coming, and you're gonna want to stick around for it 💅✨

ゲームID でゲームを指定する

ゲームの状態を保存して、あとで復元したり、同じパズルの別の人のコピーで復元したりする方法は、2つあるんだよ 💾

Game メニュー(Mac OS X では File メニュー)にある Specific と Random Seed ってやつ、それぞれが「ゲームID」って呼ばれるテキストの塊を表示してくれるんだけど、それがあれば後から同じゲームを完全に再現できるの。最強でしょ 👑

そのテキストをあとでプログラムに戻してあげると(同じ Specific か Random Seed メニューからね)、同じゲームが復活するよ。コマンドライン引数として渡すこともできる(Windows でも Unix でも!)——詳しくは下に書いてある ⬇️

で、2つの形の違いなんだけど、descriptive game ID(記述的ゲームID)はゲームの初期状態そのものを文字通り書き下したもの、random seed はパズルを作る乱数生成器に与えられた、ただのテキトーなテキストってわけ。つまりこういうこと 👇

  • 記述的ゲームIDは、多くのパズルでは長くなりがち(とはいえ Cube(sgt-cube(6))みたいにめちゃ短い説明で済むやつもいるよ)。だから今遊んでるパズルをメモったり、友達に「同じのやってみて〜」って教えたりするときは、random seed のほうがサクッと済むことが多いの ✍️
  • random seed は どんなテキストでも 有効。自動生成されるのは15桁の数字だけど、別に何でもいいの。自分のフルネームでも、今适当に作った造語でも、そこからちゃんとしたパズルが生成される。これが最高なのは、2人以上で同じパズルを競争できるってこと 🏁 誰かが random seed を思いついて、全員が同時にそれを入力すれば、誰も先にパズルを見たアドバンテージを持てないってわけ。フェアすぎる ✨
  • 新聞の「ののぐらむ」とか「数独」みたいな、よそから持ってきたパズルを、これらのプログラムで使える記述的ゲームIDに変換できることもよくあるよ 📰
  • ただし、random seed は 違うバージョンのパズルプログラムで使うと、同じ結果が保証されてない の ⚠️ なぜかっていうと、生成アルゴリズムが後のバージョンで改良されたり変更されたりしてると、同じ乱数列を与えても違う結果になっちゃうから。自分のと同じバージョンで使われるか不安なら、記述的ゲームIDのほうを使ってね。
    • (バージョン番号は About メニューオプションで確認できるよ。同じバージョン番号のプログラムなら、違うプラットフォームで動いてても random-seed 互換のはずだよ。)
  • 記述的ゲームIDは、まず現在のゲームのパラメータ(グリッドサイズとか)をエンコードしたテキストで始まる。そのあとにコロンが来て、そのあとにゲームの初期状態の説明が続くの。random seed のほうは似たようなパラメータ文字列で始まるけど、そのあとにハッシュ記号(#)と、続いて任意のデータが入るんだよ。

記述的ゲームIDを入力した場合、それを生成した random seed をプログラムが表示することはできないの。だって random seed から生成されたわけじゃないからね 🤷‍♀️ 逆に random seed を入力した場合は、その random seed から導かれた記述的ゲームIDを表示できるよ。

あとね、ゲームパラメータの文字列は、2つの形式の間でいつも同じとは限らないの。ゲームによっては、random seed のほうにだけパラメータデータが付いてて、記述的ゲームIDには含まれてないことがある。なんでかっていうと、そのパラメータ情報はパズルのグリッドを生成するときにだけ関係あるもので、遊ぶときには重要じゃないから。たとえば Solo(sgt-solo(6))の難易度レベルは、記述的ゲームIDには書かれてないんだよね。

そしてこの追加パラメータは、ゲームIDを入力してもずっと設定されたままにはならないの。例えば、あなたの Solo が Advanced 難易度に設定されてて、友達が Trivial のパズルで助けを求めてきたとするじゃん。友達が Trivial 難易度を指定する random seed を読み上げて、あなたがそれを入力する。プログラムは友達が困ってたのと同じ Trivial グリッドをあなたに生成してくれる——でもそれを遊び終わって新しいゲームを頼むと、前もって設定されてた Advanced 難易度に自動で戻るの。記憶力えぐい 🧠💅


Type メニュー

Type メニューは、もし存在すれば、プリセットのゲーム設定のリストを入れてるかもしれない。そのうちの1つを選ぶと、指定されたパラメータで新しいランダムゲームが始まるよ 🎲

Type メニューには Custom オプションが入ってることもあって、これを使うとゲームパラメータを細かく調整できるの。使えるパラメータはゲームごとに固有で、次のセクションで説明されてるよ ✨


コマンドラインでゲームパラメータを指定する

(このセクションは Mac OS X バージョンには当てはまらないよ。)

このコレクションのゲームたちは、動いてるコンピュータに情報を一切保存しないの、わざと ね。ハイスコア表もないし、保存された設定もない。(だって、少なくとも何人かは仕事中にこれで遊ぶだろうし、そういう人たちは痕跡をできるだけ残さないほうが嬉しいはずでしょ! 🙈)

でもね、もしこれらのゲームのどれかを特定のパラメータ群をデフォルトにしたいなら、コマンドラインで指定できるよ。

一番ラクなのは、Type メニューで欲しいパラメータを設定して、それから Game か File メニューの Random Seed を選ぶこと。Game ID ボックスのテキストは、ハッシュで区切られた2つの部分で構成されてる。最初の部分がゲームパラメータを表してるの(たとえばプレイ領域のサイズとか、Type メニューで設定したその他もろもろ)📏

そのパラメータテキストだけをコマンドラインに付けてゲームを起動すると、指定した設定で立ち上がるよ。

例えばね:Cube(sgt-cube(6) 参照)を起動して、Type メニューから Octahedron を選んで、それからゲームID選択に行くと、o2x2#338686542711620 っていう形式の文字列が見えるはず。ハッシュより前の部分(o2x2)だけを取って、そのテキストをコマンドラインに付けて Cube を起動する:

sgt-cube o2x2

逆に、ゲームID全体をコマンドラインにコピーすると、記述された特定のゲームで起動するよ。特定のゲームIDを始めるのに、ゲームID選択ボックスに貼り付けるよりこっちのほうがたまに便利なの。

(同じゲームパラメータを、Random Seed じゃなくて Specific メニューオプションから取り出すこともできるけど、そうすると Solo の難易度レベルみたいな一部のオプションが抜け落ちちゃう。詳しくは上を見てね。)


Unix のコマンドラインオプション

(このセクションは Unix ポートにだけ当てはまるよ。)

コマンドラインでゲームパラメータを指定できるのに加えて(上記参照)、いろんなオプションがあるの 🛠️

  • --game、--load — この2つのオプションはそれぞれ、コマンドライン引数をゲームパラメータを指定するものとして扱うか、読み込むセーブファイルとして扱うかを決めるの。どちらか片方だけ を指定すること。どっちも指定されてない場合は、引数の形式に基づいて推測されるよ 🤔
  • --generate n — これが指定されると、パズルが表示される代わりに、いくつかの記述的ゲームIDが考案されて標準出力に表示されるよ。フロントエンドを必ずしも使わずに、ゲーム生成アルゴリズムにアクセスするのに便利なの。
    • コマンドラインでゲームパラメータが指定されてれば、それがゲームIDの生成に使われる。されてなければデフォルトのパラメータ群が使われるよ。
    • このオプションの一番よくある使い方は --print と組み合わせるやつで、その場合の挙動はちょっと違うの。下を見てね。
  • --delete-prefs — これを使うと、パズルはユーザー設定を保存してた設定ファイルを削除するよ、もしあればね 🗑️
  • --print wxh — これが指定されると、パズルが表示される代わりに、1つ以上の未解答パズルの印刷表現が、PostScript 形式で標準出力に送られるの 🖨️
    • パズルの各ページでは、横に w 個、縦に h 個並ぶよ。w×h よりパズルが多い場合は、ページが複数印刷される。
    • --generate も指定されてれば、考案されたゲームIDが印刷出力の生成に使われる。そうでなければ、標準入力でゲームIDのリストが渡されることが期待される(記述的でも random seed でもいいよ。上記参照)——--generate が作るのと同じ形式でね。
    • 例えば:
sgt-net --generate 12 --print 2x3 7x7w | lpr

これは Net パズルの印刷ページを2ページ生成して(それぞれ 7×7 のラッピンググリッド)、出力を lpr コマンドにパイプするよ。lpr は多くのシステムで実際のプリンタに送ってくれるやつ 🖨️✨

  • 印刷に影響する他のオプションもいろいろあるよ。下を見てね。
  • --save file-prefix [ --save-suffix file-suffix ] — これが指定されると、パズルが表示される代わりに、1つ以上の未解答パズルのセーブファイルが、与えられたプレフィックスやサフィックスから組み立てられたファイルに書き出されるよ 💾
    • --generate も指定されてれば、考案されたゲームIDが印刷出力の生成に使われる。そうでなければ、標準入力でゲームIDのリストが渡されることが期待される(記述的でも random seed でもいいよ。上記参照)——--generate が作るのと同じ形式でね。
    • 例えば:
sgt-net --generate 12 --save game --save-suffix .sav

これは Net のセーブファイルを12個生成するよ、名前は game0.sav から game11.sav まで 📁

  • --version — ゲームのバージョン情報を表示して、それから終了するよ 👋

次のオプションは、--print も指定されてる場合にだけ意味があるやつら 👇

  • --with-solutions — 未解答パズルで埋められたページ群のあとに、それらのパズルの解答が続くよ ✅
  • --scale n — 印刷されるときの各パズルの大きさを調整するの。大きい数字にするとパズルが大きくなるよ。デフォルトは 1.0 🔍
  • --colour — パズルが白黒じゃなくてカラーで印刷されるよ(パズルが対応してればね)🌈

✨ あわせて見てね(SEE ALSO)✨

完全なドキュメントは /usr/share/doc/sgt-puzzles/puzzles.txt.gz にあるよ 📖


ってわけでベスティ、sgt-keen は sgt-puzzles ファミリーの一員で、このページは 2025年7月 版だよ 🎀 ここまで読んでくれて本当おつかれさま、あなたはもう立派なパズル職人だよ 👑💖 生成アルゴリズムと友達になっちゃお 🦋

📦 where this page comes from