Black box: Difference between revisions

m
syntax highlighting fixup automation
m (syntax highlighting fixup automation)
Line 14:
 
=={{header|AutoHotkey}}==
<langsyntaxhighlight lang=AutoHotkey>SetBatchLines -1
;--------------------------------------------------------------------------------------
BoardSize := 8
Line 263:
Gui, show,, % TroubleShooting ? "Black Box - TroubleShooting Mode" : "Black Box"
return
;--------------------------------------------------------------------------------------</langsyntaxhighlight>
 
=={{header|Go}}==
Line 273:
 
Set wikiGame to false to play a normal 'random' game.
<langsyntaxhighlight lang=go>package main
 
import (
Line 555:
check(scanner.Err())
}
}</langsyntaxhighlight>
 
{{out}}
Line 724:
 
=={{header|J}}==
Requires a recent (release 9) jqt:<langsyntaxhighlight lang=J>require'ide/qt/gl2'
coinsert'jgl2'
 
Line 820:
wd 'set finish enable ',":FINISHED<GUESSES=&#ATOMS
glpaint''
}}</langsyntaxhighlight>
 
Example use: <syntaxhighlight lang =J> bbox 8</langsyntaxhighlight>.
 
Or, for 10 atoms in a 15x15 grid: <syntaxhighlight lang =J> 10 bbox 15</langsyntaxhighlight>.
 
This version allows the user to place and observe individual beams after finishing a game.
Line 830:
=={{header|JavaScript}}==
Play it [http://paulo-jorente.de/tests/blackbox/ here].
<langsyntaxhighlight lang=javascript>
var sel, again, check, score, done, atoms, guesses, beamCnt, brdSize;
 
Line 1,033:
startGame();
}
</syntaxhighlight>
</lang>
 
=={{header|Julia}}==
Gtk library GUI version.
<langsyntaxhighlight lang=julia>using Colors, Cairo, Graphics, Gtk
 
struct BoxPosition
Line 1,275:
 
blackboxapp()
</syntaxhighlight>
</lang>
 
=={{header|Nim}}==
{{trans|Go}}
<langsyntaxhighlight lang=Nim>import random, sequtils, strutils
 
const WikiGame = true
Line 1,502:
of "y": break
 
main()</langsyntaxhighlight>
 
{{out}}
Line 1,749:
{{libheader|Phix/pGUI}}
A configurable GUI version of the Black Box game, with a Knuth solver/helper.
<langsyntaxhighlight lang=Phix>-- demo\rosetta\Black_Box.exw
constant title = "Black Box",
help_text = """
Line 2,517:
end procedure
main()</langsyntaxhighlight>
 
=={{header|Wren}}==
Line 2,524:
{{libheader|Wren-ioutil}}
{{libheader|Wren-str}}
<langsyntaxhighlight lang=ecmascript>import "random" for Random
import "/fmt" for Fmt
import "/ioutil" for Input
Line 2,769:
var yn = Str.lower(Input.option(" Play again y/n : ", "ynYN"))
if (yn == "n") return
}</langsyntaxhighlight>
 
{{out}}
Line 3,016:
=={{header|zkl}}==
{{trans|Go}}
<langsyntaxhighlight lang=zkl>const ATM="A", F="F", HIT="H", G="G", GN="N", R="R", BLNK=" ", GY="Y";
 
var
Line 3,189:
else if(yn=="y") break(1);
}
}</langsyntaxhighlight>
Showing [results of] most of the Wikipedia actions:
{{out}}
10,333

edits