Black box: Difference between revisions

m
Automated syntax highlighting fixup (second round - minor fixes)
m (syntax highlighting fixup automation)
m (Automated syntax highlighting fixup (second round - minor fixes))
Line 12:
-More or less atoms (maybe random)<br />
-Different grid sizes
 
=={{header|AutoHotkey}}==
<syntaxhighlight lang=AutoHotkey"autohotkey">SetBatchLines -1
;--------------------------------------------------------------------------------------
BoardSize := 8
Line 264 ⟶ 263:
return
;--------------------------------------------------------------------------------------</syntaxhighlight>
 
=={{header|Go}}==
Terminal based game.
Line 273 ⟶ 271:
 
Set wikiGame to false to play a normal 'random' game.
<syntaxhighlight lang="go">package main
 
import (
Line 722 ⟶ 720:
Play again y/n : n
</pre>
 
=={{header|J}}==
Requires a recent (release 9) jqt:<syntaxhighlight lang=J"j">require'ide/qt/gl2'
coinsert'jgl2'
 
Line 822 ⟶ 819:
}}</syntaxhighlight>
 
Example use: <syntaxhighlight lang=J"j"> bbox 8</syntaxhighlight>.
 
Or, for 10 atoms in a 15x15 grid: <syntaxhighlight lang=J"j"> 10 bbox 15</syntaxhighlight>.
 
This version allows the user to place and observe individual beams after finishing a game.
 
=={{header|JavaScript}}==
Play it [http://paulo-jorente.de/tests/blackbox/ here].
<syntaxhighlight lang="javascript">
var sel, again, check, score, done, atoms, guesses, beamCnt, brdSize;
 
Line 1,034 ⟶ 1,030:
}
</syntaxhighlight>
 
=={{header|Julia}}==
Gtk library GUI version.
<syntaxhighlight lang="julia">using Colors, Cairo, Graphics, Gtk
 
struct BoxPosition
Line 1,276 ⟶ 1,271:
blackboxapp()
</syntaxhighlight>
 
=={{header|Nim}}==
{{trans|Go}}
<syntaxhighlight lang=Nim"nim">import random, sequtils, strutils
 
const WikiGame = true
Line 1,745 ⟶ 1,739:
 
Play again (y/n): n</pre>
 
=={{header|Phix}}==
{{libheader|Phix/pGUI}}
A configurable GUI version of the Black Box game, with a Knuth solver/helper.
<syntaxhighlight lang=Phix"phix">-- demo\rosetta\Black_Box.exw
constant title = "Black Box",
help_text = """
Line 2,518 ⟶ 2,511:
main()</syntaxhighlight>
 
=={{header|Wren}}==
{{trans|Go}}
Line 2,524 ⟶ 2,516:
{{libheader|Wren-ioutil}}
{{libheader|Wren-str}}
<syntaxhighlight lang="ecmascript">import "random" for Random
import "/fmt" for Fmt
import "/ioutil" for Input
Line 3,013 ⟶ 3,005:
Play again y/n : n
</pre>
 
=={{header|zkl}}==
{{trans|Go}}
<syntaxhighlight lang="zkl">const ATM="A", F="F", HIT="H", G="G", GN="N", R="R", BLNK=" ", GY="Y";
 
var
10,327

edits