SYMBOL INDEX (6880 symbols across 984 files) FILE: 00_Alternate_Languages/01_Acey_Ducey/c++/source/Aceyducey.cpp function main (line 6) | int main() function WelcomeMessage (line 20) | void WelcomeMessage() function Play (line 37) | void Play(bool& isPlaying) function isGameOver (line 88) | bool isGameOver() function DrawCard (line 99) | void DrawCard(short int& Card) FILE: 00_Alternate_Languages/01_Acey_Ducey/elm/docs/app.js function F (line 4) | function F(arity, fun, wrapper) { function F2 (line 10) | function F2(fun) { function F3 (line 13) | function F3(fun) { function F4 (line 18) | function F4(fun) { function F5 (line 23) | function F5(fun) { function F6 (line 28) | function F6(fun) { function F7 (line 34) | function F7(fun) { function F8 (line 40) | function F8(fun) { function F9 (line 47) | function F9(fun) { function A2 (line 55) | function A2(fun, a, b) { function A3 (line 58) | function A3(fun, a, b, c) { function A4 (line 61) | function A4(fun, a, b, c, d) { function A5 (line 64) | function A5(fun, a, b, c, d, e) { function A6 (line 67) | function A6(fun, a, b, c, d, e, f) { function A7 (line 70) | function A7(fun, a, b, c, d, e, f, g) { function A8 (line 73) | function A8(fun, a, b, c, d, e, f, g, h) { function A9 (line 76) | function A9(fun, a, b, c, d, e, f, g, h, i) { function _Utils_eq (line 85) | function _Utils_eq(x, y) function _Utils_eqHelp (line 97) | function _Utils_eqHelp(x, y, depth, stack) function _Utils_cmp (line 157) | function _Utils_cmp(x, y, ord) function _Utils_Tuple2 (line 209) | function _Utils_Tuple2(a, b) { return { a: a, b: b }; } function _Utils_Tuple2_UNUSED (line 210) | function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } function _Utils_Tuple3 (line 212) | function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } function _Utils_Tuple3_UNUSED (line 213) | function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c... function _Utils_chr (line 215) | function _Utils_chr(c) { return c; } function _Utils_chr_UNUSED (line 216) | function _Utils_chr_UNUSED(c) { return new String(c); } function _Utils_update (line 221) | function _Utils_update(oldRecord, updatedFields) function _Utils_ap (line 243) | function _Utils_ap(xs, ys) function _List_Cons (line 270) | function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } function _List_Cons_UNUSED (line 271) | function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } function _List_fromArray (line 276) | function _List_fromArray(arr) function _List_toArray (line 286) | function _List_toArray(xs) function _JsArray_singleton (line 350) | function _JsArray_singleton(value) function _JsArray_length (line 355) | function _JsArray_length(array) function _Debug_todo (line 516) | function _Debug_todo(moduleName, region) function _Debug_todoCase (line 523) | function _Debug_todoCase(moduleName, region, value) function _Debug_toString (line 533) | function _Debug_toString(value) function _Debug_toString_UNUSED (line 538) | function _Debug_toString_UNUSED(value) function _Debug_toAnsiString (line 543) | function _Debug_toAnsiString(ansi, value) function _Debug_addSlashes (line 664) | function _Debug_addSlashes(str, isChar) function _Debug_ctorColor (line 684) | function _Debug_ctorColor(ansi, string) function _Debug_numberColor (line 689) | function _Debug_numberColor(ansi, string) function _Debug_stringColor (line 694) | function _Debug_stringColor(ansi, string) function _Debug_charColor (line 699) | function _Debug_charColor(ansi, string) function _Debug_fadeColor (line 704) | function _Debug_fadeColor(ansi, string) function _Debug_internalColor (line 709) | function _Debug_internalColor(ansi, string) function _Debug_toHexDigit (line 714) | function _Debug_toHexDigit(n) function _Debug_crash (line 723) | function _Debug_crash(identifier) function _Debug_crash_UNUSED (line 729) | function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString (line 785) | function _Debug_regionToString(region) function _Basics_toFloat (line 835) | function _Basics_toFloat(x) { return x; } function _Basics_truncate (line 836) | function _Basics_truncate(n) { return n | 0; } function _Basics_isInfinite (line 837) | function _Basics_isInfinite(n) { return n === Infinity || n === -Infinit... function _Basics_not (line 849) | function _Basics_not(bool) { return !bool; } function _String_uncons (line 861) | function _String_uncons(string) function _String_length (line 878) | function _String_length(str) function _String_reverse (line 927) | function _String_reverse(str) function _String_trim (line 1001) | function _String_trim(str) function _String_trimLeft (line 1006) | function _String_trimLeft(str) function _String_trimRight (line 1011) | function _String_trimRight(str) function _String_words (line 1016) | function _String_words(str) function _String_lines (line 1021) | function _String_lines(str) function _String_toUpper (line 1026) | function _String_toUpper(str) function _String_toLower (line 1031) | function _String_toLower(str) function _String_fromNumber (line 1116) | function _String_fromNumber(number) function _String_toInt (line 1124) | function _String_toInt(str) function _String_toFloat (line 1148) | function _String_toFloat(s) function _String_fromList (line 1160) | function _String_fromList(chars) function _Char_toCode (line 1168) | function _Char_toCode(char) function _Char_fromCode (line 1178) | function _Char_fromCode(code) function _Char_toUpper (line 1193) | function _Char_toUpper(char) function _Char_toLower (line 1198) | function _Char_toLower(char) function _Char_toLocaleUpper (line 1203) | function _Char_toLocaleUpper(char) function _Char_toLocaleLower (line 1208) | function _Char_toLocaleLower(char) function _Json_succeed (line 1225) | function _Json_succeed(msg) function _Json_fail (line 1233) | function _Json_fail(msg) function _Json_decodePrim (line 1241) | function _Json_decodePrim(decoder) function _Json_decodeList (line 1282) | function _Json_decodeList(decoder) { return { $: 3, b: decoder }; } function _Json_decodeArray (line 1283) | function _Json_decodeArray(decoder) { return { $: 4, b: decoder }; } function _Json_decodeNull (line 1285) | function _Json_decodeNull(value) { return { $: 5, c: value }; } function _Json_decodeKeyValuePairs (line 1305) | function _Json_decodeKeyValuePairs(decoder) function _Json_mapMany (line 1313) | function _Json_mapMany(f, decoders) function _Json_oneOf (line 1331) | function _Json_oneOf(decoders) function _Json_runHelp (line 1403) | function _Json_runHelp(decoder, value) function _Json_runArrayDecoder (line 1514) | function _Json_runArrayDecoder(decoder, value, toElmValue) function _Json_isArray (line 1530) | function _Json_isArray(value) function _Json_toElmArray (line 1535) | function _Json_toElmArray(array) function _Json_expecting (line 1540) | function _Json_expecting(type, value) function _Json_equality (line 1548) | function _Json_equality(x, y) function _Json_listEquality (line 1594) | function _Json_listEquality(aDecoders, bDecoders) function _Json_wrap_UNUSED (line 1619) | function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } function _Json_unwrap_UNUSED (line 1620) | function _Json_unwrap_UNUSED(value) { return value.a; } function _Json_wrap (line 1622) | function _Json_wrap(value) { return value; } function _Json_unwrap (line 1623) | function _Json_unwrap(value) { return value; } function _Json_emptyArray (line 1625) | function _Json_emptyArray() { return []; } function _Json_emptyObject (line 1626) | function _Json_emptyObject() { return {}; } function _Json_addEntry (line 1634) | function _Json_addEntry(func) function _Scheduler_succeed (line 1649) | function _Scheduler_succeed(value) function _Scheduler_fail (line 1657) | function _Scheduler_fail(error) function _Scheduler_binding (line 1665) | function _Scheduler_binding(callback) function _Scheduler_receive (line 1692) | function _Scheduler_receive(callback) function _Scheduler_rawSpawn (line 1705) | function _Scheduler_rawSpawn(task) function _Scheduler_spawn (line 1720) | function _Scheduler_spawn(task) function _Scheduler_rawSend (line 1727) | function _Scheduler_rawSend(proc, msg) function _Scheduler_kill (line 1741) | function _Scheduler_kill(proc) function _Scheduler_enqueue (line 1774) | function _Scheduler_enqueue(proc) function _Scheduler_step (line 1790) | function _Scheduler_step(proc) function _Process_sleep (line 1838) | function _Process_sleep(time) function _Platform_initialize (line 1872) | function _Platform_initialize(flagDecoder, args, init, update, subscript... function _Platform_registerPreload (line 1906) | function _Platform_registerPreload(url) function _Platform_setupEffects (line 1919) | function _Platform_setupEffects(managers, sendToApp) function _Platform_createManager (line 1941) | function _Platform_createManager(init, onEffects, onSelfMsg, cmdMap, sub... function _Platform_instantiateManager (line 1953) | function _Platform_instantiateManager(info, sendToApp) function _Platform_leaf (line 2013) | function _Platform_leaf(home) function _Platform_batch (line 2026) | function _Platform_batch(list) function _Platform_enqueueEffects (line 2079) | function _Platform_enqueueEffects(managers, cmdBag, subBag) function _Platform_dispatchEffects (line 2094) | function _Platform_dispatchEffects(managers, cmdBag, subBag) function _Platform_gatherEffects (line 2110) | function _Platform_gatherEffects(isCmd, bag, effectsDict, taggers) function _Platform_toEffect (line 2137) | function _Platform_toEffect(isCmd, home, taggers, value) function _Platform_insert (line 2156) | function _Platform_insert(isCmd, newEffect, effects) function _Platform_checkPortName (line 2172) | function _Platform_checkPortName(name) function _Platform_outgoingPort (line 2185) | function _Platform_outgoingPort(name, converter) function _Platform_setupOutgoingPort (line 2200) | function _Platform_setupOutgoingPort(name) function _Platform_incomingPort (line 2255) | function _Platform_incomingPort(name, converter) function _Platform_setupIncomingPort (line 2276) | function _Platform_setupIncomingPort(name, sendToApp) function _Platform_export (line 2319) | function _Platform_export(exports) function _Platform_mergeExportsProd (line 2327) | function _Platform_mergeExportsProd(obj, exports) function _Platform_export_UNUSED (line 2340) | function _Platform_export_UNUSED(exports) function _Platform_mergeExportsDebug (line 2348) | function _Platform_mergeExportsDebug(moduleName, obj, exports) function _VirtualDom_appendChild (line 2371) | function _VirtualDom_appendChild(parent, child) function _VirtualDom_text (line 2400) | function _VirtualDom_text(string) function _VirtualDom_custom (line 2475) | function _VirtualDom_custom(factList, model, render, diff) function _VirtualDom_thunk (line 2506) | function _VirtualDom_thunk(refs, thunk) function _VirtualDom_noScript (line 2623) | function _VirtualDom_noScript(tag) function _VirtualDom_noOnOrFormAction (line 2628) | function _VirtualDom_noOnOrFormAction(key) function _VirtualDom_noInnerHtmlOrFormAction (line 2633) | function _VirtualDom_noInnerHtmlOrFormAction(key) function _VirtualDom_noJavaScriptUri (line 2638) | function _VirtualDom_noJavaScriptUri(value) function _VirtualDom_noJavaScriptUri_UNUSED (line 2643) | function _VirtualDom_noJavaScriptUri_UNUSED(value) function _VirtualDom_noJavaScriptOrHtmlUri (line 2650) | function _VirtualDom_noJavaScriptOrHtmlUri(value) function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED (line 2655) | function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) function _VirtualDom_mapHandler (line 2674) | function _VirtualDom_mapHandler(func, handler) function _VirtualDom_organizeFacts (line 2718) | function _VirtualDom_organizeFacts(factList) function _VirtualDom_addClass (line 2746) | function _VirtualDom_addClass(object, key, newClass) function _VirtualDom_render (line 2757) | function _VirtualDom_render(vNode, eventNode) function _VirtualDom_applyFacts (line 2824) | function _VirtualDom_applyFacts(domNode, eventNode, facts) function _VirtualDom_applyStyles (line 2851) | function _VirtualDom_applyStyles(domNode, styles) function _VirtualDom_applyAttrs (line 2866) | function _VirtualDom_applyAttrs(domNode, attrs) function _VirtualDom_applyAttrsNS (line 2882) | function _VirtualDom_applyAttrsNS(domNode, nsAttrs) function _VirtualDom_applyEvents (line 2901) | function _VirtualDom_applyEvents(domNode, eventNode, events) function _VirtualDom_makeCallback (line 2957) | function _VirtualDom_makeCallback(eventNode, initialHandler) function _VirtualDom_equalEvents (line 3009) | function _VirtualDom_equalEvents(x, y) function _VirtualDom_diff (line 3028) | function _VirtualDom_diff(x, y) function _VirtualDom_pushPatch (line 3036) | function _VirtualDom_pushPatch(patches, type, index, data) function _VirtualDom_diffHelp (line 3050) | function _VirtualDom_diffHelp(x, y, patches, index) function _VirtualDom_pairwiseRefEqual (line 3180) | function _VirtualDom_pairwiseRefEqual(as, bs) function _VirtualDom_diffNodes (line 3193) | function _VirtualDom_diffNodes(x, y, patches, index, diffKids) function _VirtualDom_diffFacts (line 3217) | function _VirtualDom_diffFacts(x, y, category) function _VirtualDom_diffKids (line 3286) | function _VirtualDom_diffKids(xParent, yParent, patches, index) function _VirtualDom_diffKeyedKids (line 3326) | function _VirtualDom_diffKeyedKids(xParent, yParent, patches, rootIndex) function _VirtualDom_insertNode (line 3493) | function _VirtualDom_insertNode(changes, localPatches, key, vnode, yInde... function _VirtualDom_removeNode (line 3535) | function _VirtualDom_removeNode(changes, localPatches, key, vnode, index) function _VirtualDom_addDomNodes (line 3583) | function _VirtualDom_addDomNodes(domNode, vNode, patches, eventNode) function _VirtualDom_addDomNodesHelp (line 3590) | function _VirtualDom_addDomNodesHelp(domNode, vNode, patches, i, low, hi... function _VirtualDom_applyPatches (line 3685) | function _VirtualDom_applyPatches(rootDomNode, oldVirtualNode, patches, ... function _VirtualDom_applyPatchesHelp (line 3696) | function _VirtualDom_applyPatchesHelp(rootDomNode, patches) function _VirtualDom_applyPatch (line 3711) | function _VirtualDom_applyPatch(domNode, patch) function _VirtualDom_applyPatchRedraw (line 3786) | function _VirtualDom_applyPatchRedraw(domNode, vNode, eventNode) function _VirtualDom_applyPatchReorder (line 3804) | function _VirtualDom_applyPatchReorder(domNode, patch) function _VirtualDom_applyPatchReorderEndInsertsHelp (line 3836) | function _VirtualDom_applyPatchReorderEndInsertsHelp(endInserts, patch) function _VirtualDom_virtualize (line 3857) | function _VirtualDom_virtualize(node) function _VirtualDom_dekey (line 3898) | function _VirtualDom_dekey(keyedNode) function _Browser_makeAnimator (line 4007) | function _Browser_makeAnimator(model, draw) function _Browser_application (line 4039) | function _Browser_application(impl) function _Browser_getUrl (line 4082) | function _Browser_getUrl() function handler (line 4124) | function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); } function _Browser_visibilityInfo (line 4141) | function _Browser_visibilityInfo() function _Browser_rAF (line 4162) | function _Browser_rAF() function _Browser_now (line 4177) | function _Browser_now() function _Browser_withNode (line 4190) | function _Browser_withNode(id, doStuff) function _Browser_withWindow (line 4205) | function _Browser_withWindow(doStuff) function _Browser_getViewport (line 4232) | function _Browser_getViewport() function _Browser_getScene (line 4245) | function _Browser_getScene() function _Browser_getViewportOf (line 4269) | function _Browser_getViewportOf(id) function _Browser_getElement (line 4304) | function _Browser_getElement(id) function _Browser_reload (line 4334) | function _Browser_reload(skipCache) function _Browser_load (line 4342) | function _Browser_load(url) function _Bitwise_complement (line 4376) | function _Bitwise_complement(a) function _Time_now (line 4398) | function _Time_now(millisToPosix) function _Time_here (line 4415) | function _Time_here() function _Time_getZoneName (line 4426) | function _Time_getZoneName() FILE: 00_Alternate_Languages/01_Acey_Ducey/go/main.go function main (line 23) | func main() { function play (line 42) | func play(money int) { function getCardName (line 99) | func getCardName(c int) string { FILE: 00_Alternate_Languages/02_Amazing/go/main.go function main (line 13) | func main() { type direction (line 23) | type direction constant LEFT (line 26) | LEFT direction = iota constant UP (line 27) | UP constant RIGHT (line 28) | RIGHT constant DOWN (line 29) | DOWN constant EXIT_DOWN (line 33) | EXIT_DOWN = 1 constant EXIT_RIGHT (line 34) | EXIT_RIGHT = 2 type maze (line 37) | type maze struct method build (line 76) | func (m *maze) build() { method getPossibleDirections (line 111) | func (m *maze) getPossibleDirections(row, col int) []direction { method makeOpening (line 140) | func (m *maze) makeOpening(dirs []direction, row, col, count int) (int... method draw (line 163) | func (m *maze) draw() { function NewMaze (line 45) | func NewMaze(w, l int) maze { function printWelcome (line 194) | func printWelcome() { function getDimensions (line 199) | func getDimensions() (int, int) { FILE: 00_Alternate_Languages/03_Animal/go/main.go type node (line 11) | type node struct method update (line 28) | func (n *node) update(newQuestion, newAnswer, newAnimal string) { method isLeaf (line 42) | func (n *node) isLeaf() bool { function newNode (line 17) | func newNode(text string, yes_node, no_node *node) *node { function listKnownAnimals (line 46) | func listKnownAnimals(root *node) { function parseInput (line 65) | func parseInput(message string, checkList bool, rootNode *node) string { function avoidVoidInput (line 93) | func avoidVoidInput(message string) string { function printIntro (line 108) | func printIntro() { function main (line 115) | func main() { FILE: 00_Alternate_Languages/05_Bagels/go/main.go constant MAXGUESSES (line 13) | MAXGUESSES int = 20 function printWelcome (line 15) | func printWelcome() { function printRules (line 20) | func printRules() { function getNumber (line 29) | func getNumber() []string { function getValidGuess (line 36) | func getValidGuess(guessNumber int) string { function buildResultString (line 68) | func buildResultString(num []string, guess string) string { function main (line 102) | func main() { FILE: 00_Alternate_Languages/08_Batnum/go/main.go type StartOption (line 11) | type StartOption constant StartUndefined (line 14) | StartUndefined StartOption = iota constant ComputerFirst (line 15) | ComputerFirst constant PlayerFirst (line 16) | PlayerFirst type WinOption (line 19) | type WinOption constant WinUndefined (line 22) | WinUndefined WinOption = iota constant TakeLast (line 23) | TakeLast constant AvoidLast (line 24) | AvoidLast type GameOptions (line 27) | type GameOptions struct function NewOptions (line 35) | func NewOptions() *GameOptions { function getPileSize (line 50) | func getPileSize() int { function getWinOption (line 66) | func getWinOption() WinOption { function getStartOption (line 79) | func getStartOption() StartOption { function getMinMax (line 92) | func getMinMax() (int, int) { function playerMove (line 116) | func playerMove(pile, min, max int, win WinOption) (bool, int) { function computerPick (line 154) | func computerPick(pile, min, max int, win WinOption) int { function computerMove (line 178) | func computerMove(pile, min, max int, win WinOption) (bool, int) { function play (line 199) | func play(pile, min, max int, start StartOption, win WinOption) { function printIntro (line 220) | func printIntro() { function main (line 236) | func main() { FILE: 00_Alternate_Languages/09_Battle/go/main.go constant SEA_WIDTH (line 14) | SEA_WIDTH = 6 constant DESTROYER_LENGTH (line 15) | DESTROYER_LENGTH = 2 constant CRUISER_LENGTH (line 16) | CRUISER_LENGTH = 3 constant CARRIER_LENGTH (line 17) | CARRIER_LENGTH = 4 type Point (line 20) | type Point type Vector (line 21) | type Vector type Sea (line 22) | type Sea function NewSea (line 24) | func NewSea() Sea { function getRandomVector (line 34) | func getRandomVector() Vector { function addVector (line 48) | func addVector(p Point, v Vector) Point { function isWithinSea (line 57) | func isWithinSea(p Point, s Sea) bool { function valueAt (line 61) | func valueAt(p Point, s Sea) int { function reportInputError (line 65) | func reportInputError() { function getNextTarget (line 69) | func getNextTarget(s Sea) Point { function setValueAt (line 100) | func setValueAt(value int, p Point, s Sea) { function hasShip (line 104) | func hasShip(s Sea, code int) bool { function countSunk (line 117) | func countSunk(s Sea, codes []int) int { function placeShip (line 129) | func placeShip(s Sea, size, code int) { function setupShips (line 166) | func setupShips(s Sea) { function printIntro (line 175) | func printIntro() { function printInstructions (line 184) | func printInstructions() { function printEncodedSea (line 193) | func printEncodedSea(s Sea) { function wipeout (line 203) | func wipeout(s Sea) bool { function main (line 212) | func main() { FILE: 00_Alternate_Languages/11_Bombardment/go/main.go function displayField (line 28) | func displayField() { function printIntro (line 40) | func printIntro() { function positionList (line 61) | func positionList() []int { function generateEnemyPositions (line 70) | func generateEnemyPositions() []int { function isValidPosition (line 76) | func isValidPosition(p int) bool { function promptForPlayerPositions (line 80) | func promptForPlayerPositions() []int { function promptPlayerForTarget (line 110) | func promptPlayerForTarget() int { function generateAttackSequence (line 126) | func generateAttackSequence() []int { function attack (line 133) | func attack(target int, positions *[]int, hitMsg, missMsg string, progre... function main (line 155) | func main() { FILE: 00_Alternate_Languages/12_Bombs_Away/go/main.go type Choice (line 13) | type Choice struct function playerSurvived (line 18) | func playerSurvived() { function playerDeath (line 22) | func playerDeath() { function missionSuccess (line 29) | func missionSuccess() { function deathWithChance (line 37) | func deathWithChance(probability float64) bool { function startNonKamikaziAttack (line 41) | func startNonKamikaziAttack() { function missionFailure (line 67) | func missionFailure() { function playItaly (line 100) | func playItaly() { function playAllies (line 107) | func playAllies() { function playJapan (line 114) | func playJapan() { function playGermany (line 127) | func playGermany() { function playGame (line 134) | func playGame() { function main (line 149) | func main() { function getInputFromList (line 160) | func getInputFromList(prompt string, choices []Choice) Choice { function getIntInput (line 175) | func getIntInput(prompt string) int { FILE: 00_Alternate_Languages/20_Buzzword/go/main.go function main (line 12) | func main() { FILE: 00_Alternate_Languages/22_Change/go/main.go function printWelcome (line 11) | func printWelcome() { function computeChange (line 22) | func computeChange(cost, payment float64) { function main (line 85) | func main() { FILE: 00_Alternate_Languages/25_Chief/C/chief.c function guess_number (line 17) | float guess_number(float number){ function game (line 23) | void game(){ function show_solution (line 64) | void show_solution(float guess){ function main (line 73) | void main(){ FILE: 00_Alternate_Languages/25_Chief/go/main.go function printLightning (line 11) | func printLightning() { function printSolution (line 43) | func printSolution(n float64) { function play (line 49) | func play() { function getFloat (line 84) | func getFloat(prompt string) float64 { function getYesNo (line 99) | func getYesNo(prompt string) bool { function main (line 108) | func main() { FILE: 00_Alternate_Languages/30_Cube/C/cube.c type coords (line 12) | typedef struct{ function instuctions (line 18) | void instuctions(){ function game (line 39) | void game(int money){ function init (line 115) | void init(){ function main (line 140) | void main(){ FILE: 00_Alternate_Languages/31_Depth_Charge/go/main.go type Position (line 14) | type Position function NewPosition (line 16) | func NewPosition() Position { function showWelcome (line 21) | func showWelcome() { function getNumCharges (line 28) | func getNumCharges() (int, int) { function askForNewGame (line 43) | func askForNewGame() { function showShotResult (line 55) | func showShotResult(shot, location Position) { function getShot (line 84) | func getShot() Position { function getRandomPosition (line 109) | func getRandomPosition(searchArea int) Position { function playGame (line 117) | func playGame(searchArea, numCharges int) { function main (line 150) | func main() { FILE: 00_Alternate_Languages/33_Dice/C/dice.c function percent (line 5) | float percent(int number, int total){ function main (line 11) | int main(){ FILE: 00_Alternate_Languages/33_Dice/go/main.go function printWelcome (line 12) | func printWelcome() { function main (line 25) | func main() { FILE: 00_Alternate_Languages/34_Digits/go/main.go function printIntro (line 12) | func printIntro() { function readInteger (line 20) | func readInteger(prompt string) int { function printInstructions (line 36) | func printInstructions() { function readTenNumbers (line 49) | func readTenNumbers() []int { function printSummary (line 60) | func printSummary(correct int) { function buildArray (line 76) | func buildArray(val, row, col int) [][]int { function main (line 88) | func main() { FILE: 00_Alternate_Languages/35_Even_Wins/go/evenwins.go constant MAXTAKE (line 11) | MAXTAKE = 4 type PlayerType (line 13) | type PlayerType constant HUMAN (line 16) | HUMAN PlayerType = iota constant COMPUTER (line 17) | COMPUTER type Game (line 20) | type Game struct method printBoard (line 48) | func (g *Game) printBoard() { method gameOver (line 56) | func (g *Game) gameOver() { method humanTurn (line 79) | func (g *Game) humanTurn() { method computerTurn (line 110) | func (g *Game) computerTurn() { method play (line 137) | func (g *Game) play(playersTurn PlayerType) { function NewGame (line 26) | func NewGame() Game { function printIntro (line 33) | func printIntro() { function getPlural (line 71) | func getPlural(count int) string { function getFirstPlayer (line 156) | func getFirstPlayer() PlayerType { function main (line 176) | func main() { FILE: 00_Alternate_Languages/38_Fur_Trader/c/furtrader.c function printAtColumn (line 33) | void printAtColumn( int column, const char *words ) function print (line 42) | void print( const char *words ) function showIntroduction (line 48) | void showIntroduction() function getNumericInput (line 65) | int getNumericInput() function getYesOrNo (line 91) | char getYesOrNo() function getFortChoice (line 118) | int getFortChoice() function showFortComment (line 145) | void showFortComment( int which_fort ) function getFursPurchase (line 182) | void getFursPurchase( int *furs ) function zeroInventory (line 201) | void zeroInventory( int *player_fur_count ) function sumInventory (line 214) | int sumInventory( int *player_fur_count ) function randomAB (line 231) | float randomAB(float a, float b) function randFloat (line 236) | float randFloat() function main (line 248) | int main( void ) FILE: 00_Alternate_Languages/38_Fur_Trader/go/main.go constant MAXFURS (line 15) | MAXFURS = 190 constant STARTFUNDS (line 16) | STARTFUNDS = 600 type Fur (line 19) | type Fur constant FUR_MINK (line 22) | FUR_MINK Fur = iota constant FUR_BEAVER (line 23) | FUR_BEAVER constant FUR_ERMINE (line 24) | FUR_ERMINE constant FUR_FOX (line 25) | FUR_FOX type Fort (line 28) | type Fort constant FORT_MONTREAL (line 31) | FORT_MONTREAL Fort = iota constant FORT_QUEBEC (line 32) | FORT_QUEBEC constant FORT_NEWYORK (line 33) | FORT_NEWYORK type GameState (line 36) | type GameState constant STARTING (line 39) | STARTING GameState = iota constant TRADING (line 40) | TRADING constant CHOOSINGFORT (line 41) | CHOOSINGFORT constant TRAVELLING (line 42) | TRAVELLING function FURS (line 45) | func FURS() []string { function FORTS (line 49) | func FORTS() []string { type Player (line 53) | type Player struct method totalFurs (line 65) | func (p *Player) totalFurs() int { method lostFurs (line 73) | func (p *Player) lostFurs() { function NewPlayer (line 58) | func NewPlayer() Player { function printTitle (line 79) | func printTitle() { function printIntro (line 87) | func printIntro() { function getFortChoice (line 97) | func getFortChoice() Fort { function printFortComment (line 123) | func printFortComment(f Fort) { function getYesOrNo (line 145) | func getYesOrNo() string { function getFursPurchase (line 158) | func getFursPurchase() []int { function main (line 181) | func main() { FILE: 00_Alternate_Languages/41_Guess/go/main.go function printIntro (line 13) | func printIntro() { function getLimit (line 24) | func getLimit() (int, int) { function main (line 43) | func main() { FILE: 00_Alternate_Languages/42_Gunner/go/main.go function printIntro (line 14) | func printIntro() { function getFloat (line 25) | func getFloat() float64 { function play (line 40) | func play() { function main (line 108) | func main() { FILE: 00_Alternate_Languages/44_Hangman/C/main.c function print_hangman (line 19) | void print_hangman(int stage){ function main (line 99) | void main(void){ FILE: 00_Alternate_Languages/45_Hello/ANSI_C/hello.c function main (line 12) | int main() { function tab (line 147) | void tab(int number_of_spaces) { function get_input (line 153) | void get_input(char *input_buffer) { function strings_match (line 159) | int strings_match(char *string1, char *string2) { FILE: 00_Alternate_Languages/45_Hello/go/main.go type PROBLEM_TYPE (line 11) | type PROBLEM_TYPE constant SEX (line 14) | SEX PROBLEM_TYPE = iota constant HEALTH (line 15) | HEALTH constant MONEY (line 16) | MONEY constant JOB (line 17) | JOB constant UKNOWN (line 18) | UKNOWN function getYesOrNo (line 21) | func getYesOrNo() (bool, bool, string) { function printTntro (line 35) | func printTntro() { function askEnjoyQuestion (line 43) | func askEnjoyQuestion(user string) { function promptForProblems (line 65) | func promptForProblems(user string) PROBLEM_TYPE { function promptTooMuchOrTooLittle (line 89) | func promptTooMuchOrTooLittle() (bool, bool) { function solveSexProblem (line 103) | func solveSexProblem(user string) { function solveHealthProblem (line 124) | func solveHealthProblem(user string) { function solveMoneyProblem (line 131) | func solveMoneyProblem(user string) { function solveJobProblem (line 137) | func solveJobProblem(user string) { function askQuestionLoop (line 144) | func askQuestionLoop(user string) { function goodbyeUnhappy (line 179) | func goodbyeUnhappy(user string) { function goodbyeHappy (line 186) | func goodbyeHappy(user string) { function askForFee (line 190) | func askForFee(user string) { function main (line 220) | func main() { FILE: 00_Alternate_Languages/45_Hello/hello.c function main (line 12) | int main() { function tab (line 147) | void tab(int number_of_spaces) { function get_input (line 153) | void get_input(char *input_buffer) { function strings_match (line 159) | int strings_match(char *string1, char *string2) { FILE: 00_Alternate_Languages/47_Hi-Lo/go/main.go constant MAX_ATTEMPTS (line 13) | MAX_ATTEMPTS = 6 function printIntro (line 15) | func printIntro() { function main (line 28) | func main() { FILE: 00_Alternate_Languages/78_Sine_Wave/C++/sinewave.cpp function main (line 5) | int main() FILE: 00_Alternate_Languages/89_Tic-Tac-Toe/go/src/tictactoe1.go function main (line 8) | func main() { function computerMoves (line 69) | func computerMoves(move int) { function readYourMove (line 73) | func readYourMove() int { function move (line 85) | func move(number int) int { FILE: 00_Common/dotnet/Games.Common.Test/IO/TextIOTests/NumberFormatTests.cs class NumberFormatTests (line 8) | public class NumberFormatTests method Write_Float_FormatsNumberSameAsBasic (line 10) | [Theory] method WriteLine_Float_FormatsNumberSameAsBasic (line 22) | [Theory] method WriteFloatTestCases (line 34) | public static TheoryData WriteFloatTestCases() method Write_Int_FormatsNumberSameAsBasic (line 46) | [Theory] method WriteLine_Int_FormatsNumberSameAsBasic (line 58) | [Theory] method WriteIntTestCases (line 70) | public static TheoryData WriteIntTestCases() FILE: 00_Common/dotnet/Games.Common.Test/IO/TextIOTests/ReadMethodTests.cs class ReadMethodTests (line 18) | public class ReadMethodTests method ReadingValuesHasExpectedPromptsAndResults (line 20) | [Theory] method ReadNumbers_ArrayEmpty_ThrowsArgumentException (line 46) | [Fact] method ReadStringTestCases (line 58) | public static TheoryData, string, string, str... method Read2StringsTestCases (line 69) | public static TheoryData, string, string,... method ReadNumberTestCases (line 85) | public static TheoryData, string, string, floa... method Read2NumbersTestCases (line 96) | public static TheoryData, string, string,... method Read3NumbersTestCases (line 112) | public static TheoryData, string, strin... method Read4NumbersTestCases (line 128) | public static TheoryData, string, string... method ReadNumbersTestCases (line 144) | public static TheoryData>, strin... FILE: 00_Common/dotnet/Games.Common.Test/IO/TokenReaderTests.cs class TokenReaderTests (line 13) | public class TokenReaderTests method TokenReaderTests (line 17) | public TokenReaderTests() method ReadTokens_QuantityNeededZero_ThrowsArgumentException (line 22) | [Fact] method ReadTokens_ReadingValuesHasExpectedPromptsAndResults (line 35) | [Theory] method ReadTokens_Numeric_ReadingValuesHasExpectedPromptsAndResults (line 54) | [Theory] method ReadTokensTestCases (line 73) | public static TheoryData ReadT... method ReadNumericTokensTestCases (line 90) | public static TheoryData ReadNu... FILE: 00_Common/dotnet/Games.Common.Test/IO/TokenTests.cs class TokenTests (line 6) | public class TokenTests method Ctor_PopulatesProperties (line 8) | [Theory] method TokenTestCases (line 19) | public static TheoryData TokenTestCases() => new() FILE: 00_Common/dotnet/Games.Common.Test/IO/TokenizerTests.cs class TokenizerTests (line 7) | public class TokenizerTests method ParseTokens_SplitsStringIntoExpectedTokens (line 9) | [Theory] method TokenizerTestCases (line 18) | public static TheoryData TokenizerTestCases() => new() FILE: 00_Common/dotnet/Games.Common/IO/ConsoleIO.cs class ConsoleIO (line 9) | public sealed class ConsoleIO : TextIO method ConsoleIO (line 11) | public ConsoleIO() method ReadCharacter (line 16) | public override char ReadCharacter() => Console.ReadKey(intercept: tru... FILE: 00_Common/dotnet/Games.Common/IO/IReadWrite.cs type IReadWrite (line 8) | public interface IReadWrite method ReadCharacter (line 14) | char ReadCharacter(); method ReadNumber (line 21) | float ReadNumber(string prompt); method Read2Numbers (line 28) | (float, float) Read2Numbers(string prompt); method Read3Numbers (line 35) | (float, float, float) Read3Numbers(string prompt); method Read4Numbers (line 42) | (float, float, float, float) Read4Numbers(string prompt); method ReadNumbers (line 49) | void ReadNumbers(string prompt, float[] values); method ReadString (line 56) | string ReadString(string prompt); method Read2Strings (line 63) | (string, string) Read2Strings(string prompt); method Write (line 69) | void Write(string message); method WriteLine (line 75) | void WriteLine(string message = ""); method Write (line 81) | void Write(Number value); method WriteLine (line 87) | void WriteLine(Number value); method Write (line 93) | void Write(object value); method WriteLine (line 99) | void WriteLine(object value); method Write (line 106) | void Write(string format, params object[] values); method WriteLine (line 113) | void WriteLine(string format, params object[] values); method Write (line 119) | void Write(Stream stream, bool keepOpen = false); FILE: 00_Common/dotnet/Games.Common/IO/InsufficientInputException.cs class InsufficientInputException (line 3) | public class InsufficientInputException : Exception method InsufficientInputException (line 5) | public InsufficientInputException() FILE: 00_Common/dotnet/Games.Common/IO/Strings.cs class Strings (line 3) | internal static class Strings FILE: 00_Common/dotnet/Games.Common/IO/TextIO.cs class TextIO (line 14) | public class TextIO : IReadWrite method TextIO (line 21) | public TextIO(TextReader input, TextWriter output) method ReadCharacter (line 29) | public virtual char ReadCharacter() method ReadNumber (line 38) | public float ReadNumber(string prompt) => ReadNumbers(prompt, 1)[0]; method Read2Numbers (line 40) | public (float, float) Read2Numbers(string prompt) method Read3Numbers (line 46) | public (float, float, float) Read3Numbers(string prompt) method Read4Numbers (line 52) | public (float, float, float, float) Read4Numbers(string prompt) method ReadNumbers (line 58) | public void ReadNumbers(string prompt, float[] values) method ReadNumbers (line 69) | private IReadOnlyList ReadNumbers(string prompt, uint quantity) => method ReadString (line 76) | public string ReadString(string prompt) method Read2Strings (line 81) | public (string, string) Read2Strings(string prompt) method ReadStrings (line 87) | private IReadOnlyList ReadStrings(string prompt, uint quantity... method ReadLine (line 90) | internal string ReadLine(string prompt) method Write (line 96) | public void Write(string value) => _output.Write(value); method WriteLine (line 98) | public void WriteLine(string value = "") => _output.WriteLine(value); method Write (line 100) | public void Write(Number value) => _output.Write(value.ToString()); method WriteLine (line 102) | public void WriteLine(Number value) => _output.WriteLine(value.ToStrin... method Write (line 104) | public void Write(object value) => _output.Write(value.ToString()); method WriteLine (line 106) | public void WriteLine(object value) => _output.WriteLine(value.ToStrin... method Write (line 108) | public void Write(string format, params object[] values) => _output.Wr... method WriteLine (line 110) | public void WriteLine(string format, params object[] values) => _outpu... method Write (line 112) | public void Write(Stream stream, bool keepOpen = false) method GetString (line 123) | private string GetString(float value) => value < 0 ? $"{value} " : $" ... FILE: 00_Common/dotnet/Games.Common/IO/Token.cs class Token (line 6) | internal class Token method Token (line 10) | internal Token(string value) method ToString (line 30) | public override string ToString() => String; class Builder (line 32) | internal class Builder method Append (line 38) | public Builder Append(char character) method SetIsQuoted (line 47) | public Builder SetIsQuoted() method Build (line 53) | public Token Build() FILE: 00_Common/dotnet/Games.Common/IO/TokenReader.cs class TokenReader (line 11) | internal class TokenReader method TokenReader (line 16) | private TokenReader(TextIO io, Predicate isTokenValid) method ForStrings (line 27) | public static TokenReader ForStrings(TextIO io) => new(io, t => true); method ForNumbers (line 34) | public static TokenReader ForNumbers(TextIO io) => new(io, t => t.IsNu... method ReadTokens (line 42) | public IEnumerable ReadTokens(string prompt, uint quantityNeeded) method ReadValidTokens (line 68) | private IEnumerable ReadValidTokens(string prompt, uint maxCount) method ReadLineOfTokens (line 97) | private IEnumerable ReadLineOfTokens(string prompt, uint maxCount) FILE: 00_Common/dotnet/Games.Common/IO/Tokenizer.cs class Tokenizer (line 9) | internal class Tokenizer method Tokenizer (line 16) | private Tokenizer(string input) => _characters = new Queue(input); method ParseTokens (line 18) | public static IEnumerable ParseTokens(string input) method ParseTokens (line 25) | private IEnumerable ParseTokens() method Consume (line 36) | public (Token, bool) Consume(Queue characters) type ITokenizerState (line 50) | private interface ITokenizerState method Consume (line 54) | (ITokenizerState, Token.Builder) Consume(char character, Token.Build... type LookForStartOfTokenState (line 57) | private struct LookForStartOfTokenState : ITokenizerState method Consume (line 59) | public (ITokenizerState, Token.Builder) Consume(char character, Toke... type InTokenState (line 69) | private struct InTokenState : ITokenizerState method Consume (line 71) | public (ITokenizerState, Token.Builder) Consume(char character, Toke... type InQuotedTokenState (line 77) | private struct InQuotedTokenState : ITokenizerState method Consume (line 79) | public (ITokenizerState, Token.Builder) Consume(char character, Toke... type ExpectSeparatorState (line 85) | private struct ExpectSeparatorState : ITokenizerState method Consume (line 87) | public (ITokenizerState, Token.Builder) Consume(char character, Toke... type IgnoreRestOfLineState (line 93) | private struct IgnoreRestOfLineState : ITokenizerState method Consume (line 95) | public (ITokenizerState, Token.Builder) Consume(char character, Toke... type AtEndOfTokenState (line 99) | private struct AtEndOfTokenState : ITokenizerState method Consume (line 101) | public (ITokenizerState, Token.Builder) Consume(char character, Toke... FILE: 00_Common/dotnet/Games.Common/Numbers/Number.cs type Number (line 6) | public struct Number method Number (line 10) | public Number (float value) method ToString (line 19) | public override string ToString() => _value < 0 ? $"{_value} " : $" {_... FILE: 00_Common/dotnet/Games.Common/Randomness/IRandom.cs type IRandom (line 6) | public interface IRandom method NextFloat (line 12) | float NextFloat(); method PreviousFloat (line 18) | float PreviousFloat(); method Reseed (line 24) | void Reseed(int seed); FILE: 00_Common/dotnet/Games.Common/Randomness/IRandomExtensions.cs class IRandomExtensions (line 9) | public static class IRandomExtensions method NextFloat (line 15) | public static float NextFloat(this IRandom random, float exclusiveMaxi... method NextFloat (line 22) | public static float NextFloat(this IRandom random, float inclusiveMini... method Next (line 29) | public static int Next(this IRandom random, int exclusiveMaximum) => T... method Next (line 35) | public static int Next(this IRandom random, int inclusiveMinimum, int ... method PreviousFloat (line 43) | public static float PreviousFloat(this IRandom random, float exclusive... method PreviousFloat (line 51) | public static float PreviousFloat(this IRandom random, float inclusive... method Previous (line 59) | public static int Previous(this IRandom random, int exclusiveMaximum) => method Previous (line 66) | public static int Previous(this IRandom random, int inclusiveMinimum, ... method Scale (line 69) | private static float Scale(float zeroToOne, float exclusiveMaximum) method Scale (line 79) | private static float Scale(float zeroToOne, float inclusiveMinimum, fl... method ToInt (line 90) | private static int ToInt(float value) => (int)Math.Floor(value); FILE: 00_Common/dotnet/Games.Common/Randomness/RandomNumberGenerator.cs class RandomNumberGenerator (line 6) | public class RandomNumberGenerator : IRandom method RandomNumberGenerator (line 11) | public RandomNumberGenerator() method NextFloat (line 17) | public float NextFloat() => _previous = (float)_random.NextDouble(); method PreviousFloat (line 19) | public float PreviousFloat() => _previous; method Reseed (line 21) | public void Reseed(int seed) => _random = new Random(seed); FILE: 00_Common/javascript/WebTerminal/HtmlTerminal.js class HtmlTerminal (line 10) | class HtmlTerminal { method constructor (line 37) | constructor($output) { method #newLine (line 71) | #newLine(text) { method #handleKey (line 84) | #handleKey(e) { method clear (line 104) | clear() { method inserHtml (line 114) | inserHtml(htmlContent) { method write (line 130) | write(text) { method writeln (line 160) | writeln(text) { method input (line 174) | input(callback) { FILE: 00_Common/javascript/WebTerminal/terminal_tests.mjs function main (line 5) | async function main() { FILE: 00_Common/javascript/common.mjs function print (line 13) | function print(...messages) { function println (line 25) | function println(...messages) { function tab (line 35) | function tab(length) { function input (line 48) | async function input(message = '') { FILE: 00_Utilities/DotnetUtils/DotnetUtils/Extensions.cs class Extensions (line 6) | public static class Extensions { method SelectT (line 7) | public static IEnumerable SelectT(this IEnum... method SelectT (line 9) | public static IEnumerable SelectT(this I... method WithIndex (line 11) | public static IEnumerable<(T1, T2, int)> WithIndex(this IEnume... method None (line 13) | public static bool None(this IEnumerable src, Func? pre... method IsNullOrWhitespace (line 18) | public static bool IsNullOrWhitespace([NotNullWhen(false)] this string... method RelativePath (line 20) | [return: NotNullIfNotNull("path")] FILE: 00_Utilities/DotnetUtils/DotnetUtils/Functions.cs class Functions (line 6) | public static class Functions { method getValue (line 7) | public static string? getValue(string path, params string[] names) { method getValue (line 13) | public static string? getValue(XElement? parent, params string[] names) { method getChoice (line 23) | public static int getChoice(int maxValue) => getChoice(0, maxValue); method getChoice (line 25) | public static int getChoice(int minValue, int maxValue) { FILE: 00_Utilities/DotnetUtils/DotnetUtils/Globals.cs class Globals (line 3) | public static class Globals { FILE: 00_Utilities/DotnetUtils/DotnetUtils/Methods.cs class Methods (line 5) | public static class Methods { method RunProcess (line 6) | public static ProcessResult RunProcess(string filename, string argumen... method RunProcess (line 21) | public static ProcessResult RunProcess(Process process, string input =... method RunProcessAsync (line 48) | public static Task RunProcessAsync(Process process, str... type ProcessResult (line 81) | public sealed record ProcessResult(int ExitCode, string StdOut, string S... FILE: 00_Utilities/DotnetUtils/DotnetUtils/PortInfo.cs type PortInfo (line 7) | public record PortInfo( FILE: 00_Utilities/DotnetUtils/DotnetUtils/PortInfos.cs class PortInfos (line 7) | public static class PortInfos { method PortInfos (line 10) | static PortInfos() { FILE: 00_Utilities/build-index.js constant TITLE (line 14) | const TITLE = 'BASIC Computer Games'; constant JAVASCRIPT_FOLDER (line 15) | const JAVASCRIPT_FOLDER = 'javascript'; constant IGNORE_FOLDERS_START_WITH (line 16) | const IGNORE_FOLDERS_START_WITH = ['.', '00_', 'buildJvm', 'Sudoku']; constant IGNORE_FILES (line 17) | const IGNORE_FILES = [ function createGameLinks (line 22) | function createGameLinks(game) { function createIndexHtml (line 52) | function createIndexHtml(title, games) { function findJSFilesInFolder (line 89) | function findJSFilesInFolder(folder) { function main (line 114) | function main() { FILE: 00_Utilities/find-missing-implementations.js constant ROOT_PATH (line 13) | const ROOT_PATH = "../."; FILE: 00_Utilities/find-unimplemented.js constant ROOT_PATH (line 14) | const ROOT_PATH = "../."; FILE: 00_Utilities/markdown_todo.py function has_implementation (line 5) | def has_implementation(lang: str, file_list: List[str], subdir_list: Lis... function get_data (line 14) | def get_data(checklist_orig: List[str], root_dir: str = "..") -> List[Li... function write_file (line 77) | def write_file(path: str, languages: List[str], strings_done: List[List[... FILE: 00_Utilities/markdown_todo_rust/src/main.rs constant ROOT_DIR (line 12) | const ROOT_DIR: &str = "../../"; constant LANGUAGES (line 13) | const LANGUAGES: [(&str,&str); 10] = [ //first element of tuple is the l... constant OUTPUT_PATH (line 25) | const OUTPUT_PATH: &str = "../../todo.md"; function main (line 27) | fn main() { function print_lang_extension_table (line 213) | fn print_lang_extension_table() { function get_str_from_user (line 227) | fn get_str_from_user(prompt:&str) -> String { function get_yn_from_user (line 243) | fn get_yn_from_user(prompt:&str) -> bool { function list_files (line 260) | fn list_files(path: &Path) -> Vec { function _list_files (line 265) | fn _list_files(vec: &mut Vec, path: &Path) { FILE: 01_Acey_Ducey/csharp/Game.cs class Game (line 10) | internal class Game method GameLoop (line 26) | internal void GameLoop() method PlayGame (line 44) | private void PlayGame() method PlayTurn (line 71) | private void PlayTurn(GameState state) method PlayTurn_GetBetAmount (line 175) | private int PlayTurn_GetBetAmount(int currentMoney) method GetCard (line 221) | private int GetCard() method DisplayCard (line 230) | private void DisplayCard(int card) method DisplayIntroText (line 265) | private void DisplayIntroText() method TryAgain (line 300) | private bool TryAgain() FILE: 01_Acey_Ducey/csharp/GameState.cs class GameState (line 10) | internal class GameState method GameState (line 31) | internal GameState() FILE: 01_Acey_Ducey/csharp/Program.cs class Program (line 9) | class Program method Main (line 16) | static void Main(string[] args) FILE: 01_Acey_Ducey/elixir/acey_ducey.exs class Game (line 37) | defmodule Game method play (line 42) | def play(), do: play(%__MODULE__{}) method play (line 46) | def play(%__MODULE__{deck: deck, funds: funds} = game) do method prompt_to_place_bet (line 67) | defp prompt_to_place_bet(funds) do method win? (line 76) | defp win?({_, first}, {_, second}, {_, third}) do method format (line 86) | defp format({suit, value}) do FILE: 01_Acey_Ducey/java/src/AceyDucey.java class AceyDucey (line 11) | public class AceyDucey { method AceyDucey (line 38) | public AceyDucey() { method playAgain (line 49) | public boolean playAgain() { method play (line 68) | public void play() { method playerWon (line 100) | private boolean playerWon() { method displayPlayerCard (line 107) | private void displayPlayerCard() { method getBet (line 114) | private int getBet() { method displayBalance (line 134) | private void displayBalance() { method displayCards (line 138) | private void displayCards() { method drawCards (line 146) | private void drawCards() { method randomCard (line 155) | private Card randomCard() { method intro (line 160) | public void intro() { FILE: 01_Acey_Ducey/java/src/AceyDucey17.java class AceyDucey17 (line 11) | public class AceyDucey17 { method main (line 13) | public static void main(String[] args) { method playGame (line 33) | public static void playGame() { method determineWinnings (line 54) | public static int determineWinnings(Card lowCard, Card highCard, int b... method stillInterested (line 69) | public static boolean stillInterested(){ method getBet (line 85) | public static int getBet(int cashOnHand){ method inputNumber (line 99) | public static int inputNumber() { method getRandomCard (line 126) | public static Card getRandomCard(int from, int to){ method between (line 130) | public boolean between(Card lower, Card higher){ method toString (line 134) | @Override FILE: 01_Acey_Ducey/java/src/AceyDuceyGame.java class AceyDuceyGame (line 5) | public class AceyDuceyGame { method main (line 7) | public static void main(String[] args) { FILE: 01_Acey_Ducey/java/src/Card.java class Card (line 5) | public class Card { method Card (line 9) | Card(int value) { method init (line 13) | private void init(int value) { method getValue (line 38) | public int getValue() { method getName (line 42) | public String getName() { FILE: 01_Acey_Ducey/javascript/aceyducey.js function getRandomCard (line 20) | function getRandomCard() { function newGameCards (line 30) | function newGameCards() { function getCardValue (line 47) | function getCardValue(card) { function main (line 72) | async function main() { function isValidYesNoString (line 148) | function isValidYesNoString(string) { function isValidYesString (line 152) | function isValidYesString(string) { function isValidNoString (line 156) | function isValidNoString(string) { function print (line 160) | function print(string) { function input (line 171) | function input() { function printInline (line 206) | function printInline(string) { function spaces (line 216) | function spaces(numberOfSpaces) { FILE: 01_Acey_Ducey/python/acey_ducey.py function play_game (line 26) | def play_game() -> None: function main (line 68) | def main() -> None: FILE: 01_Acey_Ducey/python/acey_ducey_oo.py class Card (line 17) | class Card(NamedTuple): method __str__ (line 21) | def __str__(self) -> str: class Deck (line 27) | class Deck: method __init__ (line 28) | def __init__(self) -> None: method build (line 32) | def build(self) -> None: method shuffle (line 37) | def shuffle(self) -> None: method deal (line 40) | def deal(self) -> Card: class Game (line 44) | class Game: method __init__ (line 45) | def __init__(self) -> None: method play (line 53) | def play(self) -> None: function game_loop (line 101) | def game_loop() -> None: function main (line 113) | def main() -> None: FILE: 01_Acey_Ducey/ruby/aceyducey.rb function card_name (line 64) | def card_name(card) FILE: 01_Acey_Ducey/rust/src/main.rs type Card (line 5) | struct Card(u8); method new_random (line 8) | fn new_random(rng: &mut ThreadRng) -> Card { method fmt (line 14) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { type CardsPool (line 29) | struct CardsPool(Card, Card, Card); method new (line 32) | fn new() -> CardsPool { method is_in_win_range (line 45) | fn is_in_win_range(&self) -> bool { function main (line 50) | fn main() { function hello (line 101) | fn hello() { function get_bet (line 113) | fn get_bet(user_bank: u16) -> u16 { FILE: 02_Amazing/csharp/Amazing.cs class AmazingGame (line 6) | class AmazingGame method GetDelimitedValue (line 14) | private static int GetDelimitedValue(String text, int pos) method Tab (line 26) | private static String Tab(int spaces) method Random (line 31) | public static int Random(int min, int max) method Play (line 37) | public void Play() method SetCellExit (line 83) | private Cell SetCellExit(Grid grid, Cell cell, List possibl... method WriteMaze (line 109) | private void WriteMaze(int width, Grid grid, int enterCol) method GetPossibleDirs (line 139) | private List GetPossibleDirs(Grid grid, Cell cell) method DisplayTextAndGetInput (line 166) | private String DisplayTextAndGetInput(String text) type Direction (line 173) | private enum Direction class Cell (line 181) | public class Cell method Cell (line 189) | public Cell(int row, int col) class Grid (line 198) | public class Grid method Grid (line 210) | public Grid(int length, int width) method SetupEntrance (line 227) | public int SetupEntrance() method SetupExit (line 234) | public void SetupExit() method StartingCell (line 240) | public Cell StartingCell() method IsPrevColSet (line 245) | public bool IsPrevColSet(Cell cell) method IsPrevRowSet (line 250) | public bool IsPrevRowSet(Cell cell) method IsNextColSet (line 255) | public bool IsNextColSet(Cell cell) method IsNextRowSet (line 260) | public bool IsNextRowSet(Cell cell) method GetPrevCol (line 265) | public Cell GetPrevCol(Cell cell) method GetPrevRow (line 270) | public Cell GetPrevRow(Cell cell) method GetNextCol (line 275) | public Cell GetNextCol(Cell cell) method GetNextRow (line 280) | public Cell GetNextRow(Cell cell) method GetFirstUnset (line 285) | public Cell GetFirstUnset(Cell cell) class Program (line 313) | class Program method Main (line 315) | static void Main(string[] args) FILE: 02_Amazing/java/Amazing.java class Amazing (line 11) | public class Amazing { method Amazing (line 19) | public Amazing() { method getDelimitedValue (line 23) | private static int getDelimitedValue(String text, int pos) { method tab (line 32) | private static String tab(int spaces) { method random (line 38) | public static int random(int min, int max) { method play (line 43) | public void play() { method setCellExit (line 81) | private Cell setCellExit(Grid grid, Cell cell, ArrayList po... method writeMaze (line 99) | private void writeMaze(int width, Grid grid, int enterCol) { method getPossibleDirs (line 131) | private ArrayList getPossibleDirs(Grid grid, Cell cell) { method displayTextAndGetInput (line 149) | private String displayTextAndGetInput(String text) { type Direction (line 154) | enum Direction { class Cell (line 161) | public static class Cell { method Cell (line 168) | public Cell(int row, int col) { class Grid (line 174) | public static class Grid { method Grid (line 183) | public Grid(int length, int width) { method setupEntrance (line 197) | public int setupEntrance() { method setupExit (line 203) | public void setupExit() { method startingCell (line 208) | public Cell startingCell() { method isPrevColSet (line 212) | public boolean isPrevColSet(Cell cell) { method isPrevRowSet (line 216) | public boolean isPrevRowSet(Cell cell) { method isNextColSet (line 220) | public boolean isNextColSet(Cell cell) { method isNextRowSet (line 224) | public boolean isNextRowSet(Cell cell) { method getPrevCol (line 228) | public Cell getPrevCol(Cell cell) { method getPrevRow (line 232) | public Cell getPrevRow(Cell cell) { method getNextCol (line 236) | public Cell getNextCol(Cell cell) { method getNextRow (line 240) | public Cell getNextRow(Cell cell) { method getFirstUnset (line 244) | public Cell getFirstUnset(Cell cell) { FILE: 02_Amazing/java/AmazingGame.java class AmazingGame (line 1) | public class AmazingGame { method main (line 2) | public static void main(String[] args) { FILE: 02_Amazing/javascript/amazing.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 54) | async function main() FILE: 02_Amazing/python/amazing.py class Maze (line 9) | class Maze: method __init__ (line 10) | def __init__(self, width: int, length: int) -> None: method add_exit (line 28) | def add_exit(self) -> None: method display (line 34) | def display(self) -> None: class Direction (line 57) | class Direction(enum.Enum): class Position (line 65) | class Position: function main (line 75) | def main() -> None: function print_intro (line 82) | def print_intro() -> None: function build_maze (line 87) | def build_maze(width: int, length: int) -> Maze: function make_opening (line 128) | def make_opening( function get_possible_directions (line 155) | def get_possible_directions(maze: Maze, pos: Position) -> List[Direction]: function get_maze_dimensions (line 173) | def get_maze_dimensions() -> Tuple[int, int]: FILE: 02_Amazing/ruby/amazing.rb class BasicArrayTwoD (line 13) | class BasicArrayTwoD method initialize (line 14) | def initialize(rows, cols) method [] (line 18) | def [](row, col = nil) method []= (line 26) | def []=(row, col, n) method to_s (line 30) | def to_s(width: max_width, row_hilite: nil, col_hilite: nil) method max_width (line 42) | def max_width class Maze (line 47) | class Maze method initialize (line 63) | def initialize(width, height) method draw (line 73) | def draw method create (line 84) | def create method draw_top (line 141) | def draw_top(entry, width) method draw_row (line 153) | def draw_row(row) method draw_bottom (line 165) | def draw_bottom(row) method debug (line 177) | def debug(walls, row, col) class Amazing (line 186) | class Amazing method run (line 187) | def run method draw_header (line 201) | def draw_header method ask_dimensions (line 207) | def ask_dimensions FILE: 02_Amazing/rust/src/main.rs function main (line 4) | fn main() { function get_user_input (line 171) | fn get_user_input(prompt: &str) -> usize { FILE: 03_Animal/csharp/Branch.cs class Branch (line 3) | public class Branch method ToString (line 13) | public override string ToString() FILE: 03_Animal/java/src/Animal.java class Animal (line 16) | public class Animal { method main (line 18) | public static void main(String[] args) { method askForInformationAndSave (line 76) | private static void askForInformationAndSave(Scanner scan, AnimalNode ... method addNewAnimal (line 89) | private static void addNewAnimal(Node current, method askQuestionAndGetReply (line 109) | private static boolean askQuestionAndGetReply(QuestionNode questionNod... method readYesOrNo (line 114) | private static boolean readYesOrNo(Scanner scanner) { method printKnownAnimals (line 130) | private static void printKnownAnimals(Node root) { method collectLeafNodes (line 140) | private static List collectLeafNodes(Node root) { method readMainChoice (line 152) | private static String readMainChoice(Scanner scan) { method printIntro (line 157) | private static void printIntro() { method printTree (line 167) | private static void printTree(Node root) { method print (line 173) | private static void print(Node root, StringBuilder buffer, String pref... type Node (line 189) | private interface Node { class QuestionNode (line 192) | private static class QuestionNode implements Node { method QuestionNode (line 197) | public QuestionNode(String question, Node trueAnswer, Node falseAnsw... method getQuestion (line 203) | public String getQuestion() { method getTrueAnswer (line 207) | public Node getTrueAnswer() { method setTrueAnswer (line 211) | public void setTrueAnswer(Node trueAnswer) { method getFalseAnswer (line 215) | public Node getFalseAnswer() { method setFalseAnswer (line 219) | public void setFalseAnswer(Node falseAnswer) { method toString (line 223) | @Override class AnimalNode (line 229) | private static class AnimalNode implements Node { method AnimalNode (line 232) | public AnimalNode(String animal) { method getAnimal (line 236) | public String getAnimal() { method toString (line 240) | @Override FILE: 03_Animal/javascript/animal.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_animals (line 71) | function show_animals() { function main (line 100) | async function main() FILE: 03_Animal/python/animal.py class Node (line 46) | class Node: method __init__ (line 51) | def __init__( method update_node (line 60) | def update_node( method is_leaf (line 76) | def is_leaf(self) -> bool: function list_known_animals (line 80) | def list_known_animals(root_node: Optional[Node]) -> None: function parse_input (line 96) | def parse_input(message: str, check_list: bool, root_node: Optional[Node... function avoid_void_input (line 111) | def avoid_void_input(message: str) -> str: function print_intro (line 118) | def print_intro() -> None: function main (line 125) | def main() -> None: FILE: 03_Animal/ruby/animal.rb function intro (line 3) | def intro function ask (line 16) | def ask(question) function add_guess (line 23) | def add_guess(animals, guess) function get_all_animals (line 27) | def get_all_animals(feature, animals = Set.new) function create_feature (line 33) | def create_feature(current_animal) function guess_loop (line 45) | def guess_loop(feature) function main (line 74) | def main FILE: 03_Animal/rust/src/main.rs function main (line 59) | fn main() { function read_input (line 107) | fn read_input() -> String { function keep_playing (line 115) | fn keep_playing() -> bool { function yes_no (line 121) | fn yes_no() -> bool { type BTree (line 133) | struct BTree { method new (line 143) | fn new(value: String, yes: String, no: String) -> BTree { method get_yes_key (line 154) | fn get_yes_key(&self) -> usize { method get_no_key (line 160) | fn get_no_key(&self) -> usize { method is_leaf (line 165) | fn is_leaf(&self) -> bool { method yes (line 171) | fn yes(&mut self) { method no (line 178) | fn no(&mut self) { method set (line 186) | fn set(&mut self, value: String, yes: String, no: String) { method get (line 195) | fn get(&self) -> String { method restart (line 203) | fn restart(&mut self) { function test_new (line 213) | fn test_new() { function test_get (line 225) | fn test_get() { function test_set (line 232) | fn test_set() { function test_yes (line 245) | fn test_yes() { function test_no (line 255) | fn test_no() { function test_is_leaf (line 265) | fn test_is_leaf() { function test_get_key (line 273) | fn test_get_key() { function test_restart (line 283) | fn test_restart() { FILE: 04_Awari/csharp/Game.cs class Game (line 3) | public class Game method Reset (line 16) | public void Reset() method IsLegalPlayerMove (line 28) | public bool IsLegalPlayerMove(int move) => method PlayerMove (line 32) | public void PlayerMove(int move) => MoveAndRegister(move - 1, _playerH... method ComputerTurn (line 34) | public List ComputerTurn() method GetOutcome (line 48) | public GameOutcome GetOutcome() method MoveAndRegister (line 64) | private void MoveAndRegister(int pit, int homePosition) method Move (line 97) | private static int Move(int[] beans, int pit, int homePosition) method ComputerMove (line 124) | private int ComputerMove() method DetermineComputerMove (line 134) | private int DetermineComputerMove() method SimulateMove (line 157) | private int SimulateMove(int move) method ScoreBestNextPlayerMove (line 200) | private static int ScoreBestNextPlayerMove(int[] hypotheticalBeans) method ScoreNextPlayerMove (line 218) | private static int ScoreNextPlayerMove(int[] hypotheticalBeans, int move) type GameState (line 248) | public enum GameState type GameWinner (line 257) | public enum GameWinner type GameOutcome (line 264) | public record struct GameOutcome(GameWinner Winner, int Difference); FILE: 04_Awari/java/Awari.java class Awari (line 4) | public class Awari{ method Awari (line 13) | Awari(){ method printBoard (line 32) | private void printBoard(){ method playerMove (line 50) | private void playerMove(boolean val){ method computerMove (line 99) | private void computerMove(boolean value){ method distribute (line 167) | private int distribute(int seeds, int pos){ method calculateOpposite (line 182) | private int calculateOpposite(int pos){ method isGameOver (line 186) | private boolean isGameOver(boolean show){ FILE: 04_Awari/java/AwariGame.java class AwariGame (line 1) | public class AwariGame { method main (line 2) | public static void main(String[] args) { FILE: 04_Awari/javascript/awari.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_number (line 57) | function show_number(number) function show_board (line 65) | function show_board() function do_move (line 84) | function do_move() function adjust_board (line 106) | function adjust_board() function computer_move (line 128) | function computer_move() function main (line 179) | async function main() FILE: 04_Awari/python/awari.py function draw_pit (line 84) | def draw_pit(line: str, board, pit_index) -> str: function draw_board (line 92) | def draw_board(board) -> None: function play_game (line 116) | def play_game(board: List[int]) -> None: function computer_move (line 159) | def computer_move(msg: str, board) -> Tuple[int, bool, int, str]: function game_over (line 259) | def game_over(board) -> None: function do_capture (line 277) | def do_capture(m, home, board) -> None: function do_move (line 283) | def do_move(m, home, board) -> int: function player_has_stones (line 297) | def player_has_stones(board) -> bool: function computer_has_stones (line 301) | def computer_has_stones(board: Dict[int, int]) -> bool: function execute_move (line 305) | def execute_move(move, home: int, board) -> Tuple[int, bool, int]: function player_move_again (line 329) | def player_move_again(board) -> Tuple[int, bool, int]: function player_move (line 334) | def player_move(board) -> Tuple[int, bool, int]: function main (line 352) | def main() -> None: FILE: 04_Awari/ruby/awari.rb function print_number (line 5) | def print_number(n) function input (line 15) | def input(prompt) class Game (line 51) | class Game method initialize (line 52) | def initialize(history, non_win_count) method play (line 64) | def play method game_over (line 106) | def game_over method end_game (line 111) | def end_game method perform_move (line 131) | def perform_move(move, home_pit) method update_history (line 139) | def update_history(current_move) method print_beans (line 147) | def print_beans method get_move (line 169) | def get_move(prompt) method distribute_beans (line 180) | def distribute_beans(start_pit, home_pit, beans = @beans) method print_bean (line 201) | def print_bean(bean_count) method get_integer_input (line 206) | def get_integer_input(prompt) method get_computer_move (line 227) | def get_computer_move FILE: 04_Awari/rust/src/main.rs function main (line 7) | fn main() { type DistributeResult (line 20) | enum DistributeResult { type Game (line 30) | struct Game { method step_through (line 48) | fn step_through(&mut self, mut index: usize) -> usize { method play_turn (line 68) | fn play_turn(&mut self, is_repeat: bool) -> bool { method process_choice (line 138) | pub fn process_choice(&mut self, index: usize) -> DistributeResult { method is_game_over (line 158) | fn is_game_over(&self) -> bool { method draw (line 164) | fn draw(&self) { method default (line 36) | fn default() -> Self { function player_prompt (line 194) | pub fn player_prompt(message: &str) -> usize { FILE: 05_Bagels/csharp/BagelNumber.cs type BagelValidation (line 7) | public enum BagelValidation class BagelNumber (line 14) | public class BagelNumber method ToString (line 19) | public override string ToString() method CreateSecretNumber (line 24) | public static BagelNumber CreateSecretNumber(int numDigits) method IsValid (line 36) | public static BagelValidation IsValid(string number, int length) method BagelNumber (line 50) | public BagelNumber(string number) method BagelNumber (line 75) | public BagelNumber(int[] digits) method GetDigits (line 80) | private static int[] GetDigits(int numDigits) method Shuffle (line 88) | private static void Shuffle(int[] digits) method CompareTo (line 100) | public (int pico, int fermi) CompareTo(BagelNumber other) FILE: 05_Bagels/csharp/Game.cs class Game (line 7) | public class Game : GameBase method GameLoop (line 9) | public void GameLoop() method PlayRound (line 28) | private bool PlayRound() method PrintError (line 70) | private void PrintError(BagelValidation isValid) method PrintList (line 91) | private void PrintList(string msg, int repeat) method DisplayIntroText (line 97) | private void DisplayIntroText() FILE: 05_Bagels/csharp/GameBase.cs class GameBase (line 5) | public class GameBase method TryAgain (line 13) | protected bool TryAgain() FILE: 05_Bagels/csharp/Program.cs class Program (line 3) | public class Program method Main (line 5) | public static void Main(string[] args) FILE: 05_Bagels/java/BagelGame.java class BagelGame (line 18) | public class BagelGame { type GameState (line 23) | enum GameState { method BagelGame (line 33) | public BagelGame() { method BagelGame (line 38) | public BagelGame(long seed) { method BagelGame (line 43) | public BagelGame(Random rand) { method isOver (line 65) | public boolean isOver() { method isWon (line 69) | public boolean isWon() { method getGuessNum (line 73) | public int getGuessNum() { method getSecretAsString (line 77) | public String getSecretAsString() { method toString (line 86) | @Override method validateGuess (line 95) | public String validateGuess(String guess) { method makeGuess (line 126) | public String makeGuess(String s) throws IllegalArgumentException { FILE: 05_Bagels/java/Bagels.java class Bagels (line 35) | public class Bagels { method main (line 37) | public static void main(String[] args) { method getValidGuess (line 97) | private static String getValidGuess(BagelGame game) { method getReplayResponse (line 117) | private static boolean getReplayResponse() { FILE: 05_Bagels/javascript/bagels.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 64) | async function main() FILE: 05_Bagels/python/bagels.py function print_rules (line 39) | def print_rules() -> None: function pick_number (line 47) | def pick_number() -> List[str]: function get_valid_guess (line 56) | def get_valid_guess(guesses: int) -> str: function build_result_string (line 79) | def build_result_string(num: List[str], guess: str) -> str: function main (line 105) | def main() -> None: FILE: 05_Bagels/ruby/bagels.rb function print_instructions (line 6) | def print_instructions function generate_target (line 15) | def generate_target function puts_clue_for (line 22) | def puts_clue_for(guess_number, target_number) FILE: 05_Bagels/rust/src/main.rs type Digits (line 6) | type Digits = [u8; 3]; function main (line 8) | fn main() -> io::Result<()> { function print_header (line 38) | fn print_header() { function print_rules (line 45) | fn print_rules() { function read_lowercase_input (line 54) | fn read_lowercase_input() -> io::Result { function generate_random_digits (line 60) | fn generate_random_digits() -> Digits { function guess (line 70) | fn guess(solution: Digits) -> io::Result { function read_valid_guess (line 102) | fn read_valid_guess(round: u8) -> io::Result { FILE: 06_Banner/csharp/banner.cs class Banner (line 7) | class Banner method GetNumber (line 74) | private int GetNumber(string DisplayText) method GetBool (line 96) | private bool GetBool(string DisplayText) method GetString (line 108) | private string GetString(string DisplayText) method GetInput (line 117) | private void GetInput() method PrintChar (line 133) | private void PrintChar(char ch) method PrintBanner (line 220) | private void PrintBanner() method Play (line 237) | public void Play() class Program (line 244) | class Program method Main (line 246) | static void Main(string[] args) FILE: 06_Banner/java/Banner.java class Banner (line 18) | public class Banner { method Banner (line 22) | public Banner() { method play (line 28) | public void play() { method main (line 217) | public static void main(String[] args) { FILE: 06_Banner/javascript/banner.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 93) | async function main() FILE: 06_Banner/python/banner.py function print_banner (line 55) | def print_banner() -> None: FILE: 07_Basketball/csharp/Clock.cs class Clock (line 6) | internal class Clock method Clock (line 11) | public Clock(IReadWrite io) => _io = io; method Increment (line 17) | public void Increment(Scoreboard scoreboard) method StartOvertime (line 24) | public void StartOvertime() => time = 93; FILE: 07_Basketball/csharp/Defense.cs class Defense (line 3) | internal class Defense method Defense (line 7) | public Defense(float value) => Set(value); method Set (line 9) | public void Set(float value) => _value = value; FILE: 07_Basketball/csharp/Game.cs class Game (line 8) | internal class Game method Game (line 15) | private Game(Clock clock, Scoreboard scoreboard, TextIO io, IRandom ra... method Create (line 23) | public static Game Create(TextIO io, IRandom random) method Play (line 40) | public void Play() method IsGameOver (line 60) | private bool IsGameOver() FILE: 07_Basketball/csharp/IRandomExtensions.cs class IRandomExtensions (line 5) | internal static class IRandomExtensions method NextShot (line 7) | internal static Shot NextShot(this IRandom random) => Shot.Get(random.... FILE: 07_Basketball/csharp/IReadWriteExtensions.cs class IReadWriteExtensions (line 5) | internal static class IReadWriteExtensions method ReadDefense (line 7) | public static float ReadDefense(this IReadWrite io, string prompt) method TryReadInteger (line 16) | private static bool TryReadInteger(this IReadWrite io, string prompt, ... method ReadShot (line 23) | public static Shot? ReadShot(this IReadWrite io, string prompt) FILE: 07_Basketball/csharp/JumpShot.cs class JumpShot (line 3) | public class JumpShot : Shot method JumpShot (line 5) | public JumpShot() FILE: 07_Basketball/csharp/Plays/BallContest.cs class BallContest (line 6) | internal class BallContest method BallContest (line 13) | internal BallContest(float probability, string messageFormat, IReadWri... method Resolve (line 21) | internal bool Resolve(Scoreboard scoreboard) FILE: 07_Basketball/csharp/Plays/HomeTeamPlay.cs class HomeTeamPlay (line 6) | internal class HomeTeamPlay : Play method HomeTeamPlay (line 14) | public HomeTeamPlay(TextIO io, IRandom random, Clock clock, Defense de... method Resolve (line 24) | internal override bool Resolve(Scoreboard scoreboard) method Resolve (line 53) | private bool Resolve(JumpShot shot, Scoreboard scoreboard) => method Resolve (line 61) | private bool Resolve(Shot shot, Scoreboard scoreboard) => method ResolveShotOffTarget (line 69) | private bool ResolveShotOffTarget(Scoreboard scoreboard) => method ResolveHomeRebound (line 74) | private bool ResolveHomeRebound(Scoreboard scoreboard, Action FILE: 07_Basketball/csharp/Plays/Play.cs class Play (line 6) | internal abstract class Play method Play (line 12) | public Play(IReadWrite io, IRandom random, Clock clock) method ClockIncrementsToHalfTime (line 19) | protected bool ClockIncrementsToHalfTime(Scoreboard scoreboard) method Resolve (line 25) | internal abstract bool Resolve(Scoreboard scoreboard); method ResolveFreeThrows (line 27) | protected void ResolveFreeThrows(Scoreboard scoreboard, string message... method Resolve (line 33) | protected Probably Resolve(string message) => Resolve(message, 1f); method Resolve (line 35) | protected Probably Resolve(string message, float defenseFactor) FILE: 07_Basketball/csharp/Plays/VisitingTeamPlay.cs class VisitingTeamPlay (line 6) | internal class VisitingTeamPlay : Play method VisitingTeamPlay (line 12) | public VisitingTeamPlay(TextIO io, IRandom random, Clock clock, Defens... method Resolve (line 20) | internal override bool Resolve(Scoreboard scoreboard) method Resolve (line 44) | private bool Resolve(JumpShot shot, Scoreboard scoreboard) => method Resolve (line 51) | private bool Resolve(Shot shot, Scoreboard scoreboard) => method ResolveBadShot (line 56) | private bool ResolveBadShot(Scoreboard scoreboard, string message, flo... method ResolveVisitorsRebound (line 61) | private bool ResolveVisitorsRebound(Scoreboard scoreboard) FILE: 07_Basketball/csharp/Probably.cs type Probably (line 11) | internal struct Probably method Probably (line 17) | internal Probably(float defenseFactor, IRandom random, bool? result = ... method Do (line 24) | public Probably Do(float probability, Action action) => method Do (line 29) | public Probably Do(float probability, Func action) => method Or (line 34) | public Probably Or(float probability, Action action) => Do(probability... method Or (line 36) | public Probably Or(float probability, Func action) => Do(probabi... method Or (line 38) | public bool Or(Action action) => _result ?? Resolve(action) ?? false; method Resolve (line 40) | private bool? Resolve(Action action) method Resolve (line 46) | private bool? Resolve(Func action) => action.Invoke(); method ShouldResolveAction (line 48) | private readonly bool ShouldResolveAction(float probability) => FILE: 07_Basketball/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Formats (line 14) | internal static class Formats method GetString (line 22) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 29) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 07_Basketball/csharp/Scoreboard.cs class Scoreboard (line 6) | internal class Scoreboard method Scoreboard (line 11) | public Scoreboard(Team home, Team visitors, IReadWrite io) method AddBasket (line 25) | public void AddBasket(string message) => AddScore(2, message); method AddFreeThrows (line 27) | public void AddFreeThrows(uint count, string message) => AddScore(coun... method AddScore (line 29) | private void AddScore(uint score, string message) method Turnover (line 39) | public void Turnover(string? message = null) method Display (line 46) | public void Display(string? format = null) => FILE: 07_Basketball/csharp/Shot.cs class Shot (line 3) | public class Shot method Shot (line 7) | public Shot(string name) method TryGet (line 12) | public static bool TryGet(int shotNumber, out Shot? shot) method Get (line 27) | public static Shot Get(float shotNumber) => method ToString (line 36) | public override string ToString() => _name; FILE: 07_Basketball/csharp/Team.cs type Team (line 5) | internal record Team(string Name, Play PlayResolver) FILE: 07_Basketball/java/Basketball.java class Basketball (line 10) | public class Basketball { method Basketball (line 20) | public Basketball() { method add_points (line 66) | private void add_points(int team, int points) { method ball_passed_back (line 72) | private void ball_passed_back() { method change_defense (line 78) | private void change_defense() { method foul_shots (line 96) | private void foul_shots(int team) { method halftime (line 117) | private void halftime() { method print_score (line 124) | private void print_score() { method start_of_period (line 129) | private void start_of_period() { method two_minute_warning (line 142) | private void two_minute_warning() { method dartmouth_jump_shot (line 147) | private void dartmouth_jump_shot() { method dartmouth_non_jump_shot (line 219) | private void dartmouth_non_jump_shot() { method dartmouth_ball (line 283) | private void dartmouth_ball() { method opponent_jumpshot (line 334) | private void opponent_jumpshot() { method opponent_non_jumpshot (line 394) | private void opponent_non_jumpshot() { method opponent_ball (line 448) | private void opponent_ball() { method main (line 462) | public static void main(String[] args) { FILE: 07_Basketball/javascript/basketball.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function two_minutes (line 52) | function two_minutes() function show_scores (line 59) | function show_scores() function score_computer (line 64) | function score_computer() function score_player (line 70) | function score_player() function half_time (line 76) | function half_time() function foul (line 85) | function foul() function player_play (line 101) | function player_play() function computer_play (line 208) | function computer_play() function main (line 302) | async function main() FILE: 07_Basketball/python/basketball.py function print_intro (line 12) | def print_intro() -> None: class Basketball (line 29) | class Basketball: method __init__ (line 30) | def __init__(self) -> None: method add_points (line 45) | def add_points(self, team: Literal[0, 1], points: Literal[0, 1, 2]) ->... method ball_passed_back (line 54) | def ball_passed_back(self) -> None: method change_defense (line 58) | def change_defense(self) -> None: method foul_shots (line 72) | def foul_shots(self, team: Literal[0, 1]) -> None: method halftime (line 87) | def halftime(self) -> None: method print_score (line 93) | def print_score(self) -> None: method start_of_period (line 97) | def start_of_period(self) -> None: method two_minute_warning (line 107) | def two_minute_warning(self) -> None: method dartmouth_jump_shot (line 111) | def dartmouth_jump_shot(self) -> None: method dartmouth_non_jump_shot (line 162) | def dartmouth_non_jump_shot(self) -> None: method dartmouth_ball (line 209) | def dartmouth_ball(self) -> None: method opponent_jumpshot (line 245) | def opponent_jumpshot(self) -> None: method opponent_non_jumpshot (line 289) | def opponent_non_jumpshot(self) -> None: method opponent_ball (line 330) | def opponent_ball(self) -> None: function get_defense_choice (line 346) | def get_defense_choice(defense_choices: List[float]) -> float: function get_dartmouth_ball_choice (line 364) | def get_dartmouth_ball_choice(shot_choices: List[Literal[0, 1, 2, 3, 4]]... function get_opponents_name (line 382) | def get_opponents_name() -> str: FILE: 07_Basketball/ruby/basketball.rb class Basketball (line 1) | class Basketball method initialize (line 3) | def initialize method dartmouth_ball (line 33) | def dartmouth_ball method add_points (line 64) | def add_points team, points method ball_passed_back (line 69) | def ball_passed_back method change_defense (line 73) | def change_defense method foul_shots (line 78) | def foul_shots team method halftime (line 93) | def halftime method print_score (line 99) | def print_score method start_of_period (line 103) | def start_of_period method two_minute_warning (line 114) | def two_minute_warning method dartmouth_jump_shot (line 118) | def dartmouth_jump_shot method dartmouth_non_jump_shot (line 174) | def dartmouth_non_jump_shot method opponent_jumpshot (line 226) | def opponent_jumpshot method opponent_non_jumpshot (line 275) | def opponent_non_jumpshot method opponent_ball (line 320) | def opponent_ball method get_defense (line 335) | def get_defense defense_choices, type = "starting" FILE: 08_Batnum/csharp/BatnumGame.cs type WinOptions (line 10) | public enum WinOptions type Players (line 22) | public enum Players class BatnumGame (line 28) | public class BatnumGame method BatnumGame (line 30) | public BatnumGame(int pileSize, WinOptions winCriteria, int minTake, i... method TakeTurn (line 56) | public string TakeTurn() method PlayerTurn (line 67) | private string PlayerTurn() method ComputerTurn (line 88) | private string ComputerTurn() FILE: 08_Batnum/csharp/ConsoleUtilities.cs class ConsoleUtilities (line 9) | public static class ConsoleUtilities method AskNumberRangeQuestion (line 19) | public static (int min, int max) AskNumberRangeQuestion(string questio... method AskNumberQuestion (line 47) | public static int AskNumberQuestion(string question, Func V... method CenterText (line 70) | public static string CenterText(string content) method WriteLineWordWrap (line 82) | public static void WriteLineWordWrap(string paragraph, int tabSize = 4) FILE: 08_Batnum/csharp/Properties/Resources.Designer.cs class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource... method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic... FILE: 08_Batnum/java/src/BatNum.java class BatNum (line 13) | public class BatNum { type GAME_STATE (line 15) | private enum GAME_STATE { type WIN_OPTION (line 37) | enum WIN_OPTION { type WINNER (line 43) | enum WINNER { method BatNum (line 58) | public BatNum() { method play (line 69) | public void play() { method calculateComputersTurn (line 219) | private int calculateComputersTurn(int pileSizeLeft) { method intro (line 231) | private void intro() { method displayTextAndGetNumber (line 253) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 263) | private String displayTextAndGetInput(String text) { method simulateTabs (line 274) | private String simulateTabs(int spaces) { method getDelimitedValue (line 288) | private int getDelimitedValue(String text, int pos) { FILE: 08_Batnum/java/src/BatNumGame.java class BatNumGame (line 1) | public class BatNumGame { method main (line 3) | public static void main(String[] args) { FILE: 08_Batnum/javascript/batnum.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 08_Batnum/python/batnum.py class WinOptions (line 5) | class WinOptions(IntEnum): method _missing_ (line 11) | def _missing_(cls, value: Any) -> "WinOptions": class StartOptions (line 24) | class StartOptions(IntEnum): method _missing_ (line 30) | def _missing_(cls, value: Any) -> "StartOptions": function print_intro (line 43) | def print_intro() -> None: function get_params (line 63) | def get_params() -> Tuple[int, int, int, StartOptions, WinOptions]: function get_pile_size (line 84) | def get_pile_size() -> int: function get_win_option (line 95) | def get_win_option() -> WinOptions: function get_min_max (line 102) | def get_min_max() -> Tuple[int, int]: function get_start_option (line 112) | def get_start_option() -> StartOptions: function player_move (line 119) | def player_move( function computer_pick (line 147) | def computer_pick( function computer_move (line 160) | def computer_move( function play_game (line 189) | def play_game( function main (line 219) | def main() -> None: FILE: 08_Batnum/ruby/batnum.rb function instructions (line 3) | def instructions function ask_for_pile_size (line 17) | def ask_for_pile_size function ask_for_goal (line 27) | def ask_for_goal function ask_for_min_max_take (line 35) | def ask_for_min_max_take function ask_who_makes_first_move (line 47) | def ask_who_makes_first_move function ask_for_player_take (line 55) | def ask_for_player_take(min_take:, max_take:) function battle (line 64) | def battle(pile:, goal:, min_take:, max_take:, first_move:) function main (line 112) | def main FILE: 08_Batnum/rust/src/main.rs function print_intro (line 4) | fn print_intro() { type Params (line 32) | struct Params { method get_params (line 53) | pub fn get_params() -> Self { method get_pile_size (line 68) | fn get_pile_size() -> usize { method get_win_option (line 74) | fn get_win_option() -> WinOption { method get_start_option (line 95) | fn get_start_option() -> StartOption { method get_min_max (line 116) | fn get_min_max() -> (usize, usize) { type StartOption (line 41) | enum StartOption { type WinOption (line 47) | enum WinOption { function read_input_integer (line 129) | fn read_input_integer() -> usize { function player_move (line 153) | fn player_move(pile_size: &mut usize, params: &Params) -> bool { function computer_pick (line 180) | fn computer_pick(pile_size: usize, params: &Params) -> usize { function computer_move (line 200) | fn computer_move(pile_size: &mut usize, params: &Params) -> bool { function play_game (line 216) | fn play_game(params: &Params) { function main (line 233) | fn main() -> ! { FILE: 09_Battle/csharp/Game.cs class Game (line 6) | public class Game method Run (line 12) | public void Run() method SetShip (line 32) | private bool SetShip(int shipType, int shipNum) method DisplayIntro (line 217) | public void DisplayIntro() method UserInteraction (line 227) | public void UserInteraction() method IsValid (line 335) | public bool IsValid(int[] input) => input.Length == 2 && input.All(Val... method Valid (line 337) | public bool Valid(int value) => value > 0 && value < 7; method Print (line 339) | public void Print(string str = "") => Console.WriteLine(str); method Write (line 341) | public void Write(string value) => Console.Write(value); method Tab (line 343) | public string Tab(int pos) => new String(' ', pos); method Rnd (line 345) | public int Rnd(int seed) => random.Next(seed); FILE: 09_Battle/csharp/Program.cs class Program (line 5) | class Program method Main (line 7) | static void Main(string[] args) FILE: 09_Battle/java/Battle.java class Battle (line 12) | public class Battle { method main (line 39) | public static void main(String args[]) { method Battle (line 46) | public Battle(int scale, int[] shipSizes, int[] shipCounts) { method play (line 87) | public void play() { FILE: 09_Battle/java/Input.java class Input (line 9) | public class Input { method Input (line 16) | public Input(int seaSize) { method readCoordinates (line 22) | public boolean readCoordinates() throws IOException { method x (line 65) | public int x() { return coords[0]; } method y (line 66) | public int y() { return coords[1]; } FILE: 09_Battle/java/Sea.java class Sea (line 2) | class Sea { method Sea (line 11) | public Sea(int make_size) { method size (line 16) | public int size() { return size; } method encodedDump (line 20) | public String encodedDump() { method isEmpty (line 34) | public boolean isEmpty(int x, int y) { method get (line 43) | public int get(int x, int y) { method set (line 47) | public void set(int x, int y, int value) { method index (line 52) | private int index(int x, int y) { FILE: 09_Battle/java/Ship.java class Ship (line 8) | class Ship { method Ship (line 26) | public Ship(int i, int sz) { method id (line 33) | public int id() { return id; } method size (line 35) | public int size() { return size; } method hit (line 38) | public void hit(int x, int y) { method isSunk (line 54) | public boolean isSunk() { return sunk; } method wasHit (line 57) | public boolean wasHit(int x, int y) { method placeRandom (line 70) | public void placeRandom(Sea s) { method place (line 90) | public boolean place(Sea s, int x, int y, int orient) { method extendShip (line 154) | private boolean extendShip(Sea s, int fromX, int fromY, int toX, int t... FILE: 09_Battle/javascript/battle.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 53) | async function main() FILE: 09_Battle/python/battle.py function random_vector (line 15) | def random_vector() -> Tuple[int, int]: function add_vector (line 26) | def add_vector(point: PointType, vector: VectorType) -> PointType: function place_ship (line 30) | def place_ship(sea: SeaType, size: int, code: int) -> None: function print_encoded_sea (line 56) | def print_encoded_sea(sea: SeaType) -> None: function is_within_sea (line 61) | def is_within_sea(point: PointType, sea: SeaType) -> bool: function has_ship (line 65) | def has_ship(sea: SeaType, code: int) -> bool: function count_sunk (line 69) | def count_sunk(sea: SeaType, *codes: int) -> int: function value_at (line 73) | def value_at(point: PointType, sea: SeaType) -> int: function set_value_at (line 77) | def set_value_at(value: int, point: PointType, sea: SeaType) -> None: function get_next_target (line 81) | def get_next_target(sea: SeaType) -> PointType: function setup_ships (line 102) | def setup_ships(sea: SeaType) -> None: function main (line 111) | def main() -> None: FILE: 09_Battle/rust/src/main.rs type ShipLength (line 10) | enum ShipLength { type Point (line 17) | struct Point(i8, i8); type Output (line 20) | type Output = Self; method add (line 22) | fn add(self, rhs: Self) -> Self::Output { method is_outside (line 28) | pub fn is_outside(&self, width: usize) -> bool { method userinput2coordinate (line 33) | pub fn userinput2coordinate(self) -> Self { type Ship (line 38) | struct Ship(Vec); method new (line 41) | pub fn new(length: ShipLength) -> Self { method random_vector (line 63) | fn random_vector() -> Point { method collide (line 75) | pub fn collide(&self, see: &[Vec]) -> bool { method place (line 79) | pub fn place(self, see: &mut [Vec], code: i8) { type Report (line 86) | enum Report { type See (line 92) | struct See { constant WIDTH (line 97) | pub const WIDTH: usize = 6; method place_ship (line 99) | fn place_ship(data: &mut [Vec], length: ShipLength, code: i8) { method new (line 110) | pub fn new() -> Self { method report (line 123) | pub fn report(&mut self, point: Point) -> Report { method has_ship (line 136) | pub fn has_ship(&self, code: i8) -> bool { method has_any_ship (line 140) | pub fn has_any_ship(&self) -> bool { method count_sunk (line 144) | pub fn count_sunk(&self, ship: ShipLength) -> i32 { method fmt (line 157) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { function input_point (line 168) | fn input_point() -> Result { function get_next_target (line 185) | fn get_next_target() -> Point { function main (line 204) | fn main() { FILE: 10_Blackjack/csharp/Card.cs class Card (line 3) | public class Card method Card (line 7) | public Card(int index) FILE: 10_Blackjack/csharp/Deck.cs class Deck (line 6) | public class Deck method Deck (line 13) | public Deck() method Reshuffle (line 25) | private void Reshuffle() method DrawCard (line 41) | public Card DrawCard() method Discard (line 51) | public void Discard(IEnumerable cards) FILE: 10_Blackjack/csharp/Game.cs class Game (line 7) | public class Game method Game (line 14) | public Game(int numberOfPlayers) method PlayGame (line 23) | public void PlayGame() method PlayRound (line 34) | public void PlayRound() method GetPlayerBets (line 94) | private void GetPlayerBets() method DealHands (line 101) | private void DealHands() method PlayHand (line 120) | private void PlayHand(Player player) method TakeHit (line 173) | private bool TakeHit(Hand hand) method PromptForAnotherHit (line 185) | private bool PromptForAnotherHit() method TallyResults (line 190) | private void TallyResults() method CalculateWinnings (line 209) | private int CalculateWinnings(Player player, Hand hand) method ResetRoundState (line 220) | private void ResetRoundState() FILE: 10_Blackjack/csharp/Hand.cs class Hand (line 6) | public class Hand method AddCard (line 11) | public Card AddCard(Card card) method Discard (line 18) | public void Discard(Deck deck) method SplitHand (line 25) | public void SplitHand(Hand secondHand) FILE: 10_Blackjack/csharp/Player.cs class Player (line 3) | public class Player method Player (line 5) | public Player(int index) FILE: 10_Blackjack/csharp/Program.cs class Program (line 5) | static class Program method Main (line 7) | static void Main(string[] args) method OfferInstructions (line 22) | private static void OfferInstructions() FILE: 10_Blackjack/csharp/Prompt.cs class Prompt (line 5) | public static class Prompt method ForYesNo (line 7) | public static bool ForYesNo(string prompt) method ForInteger (line 21) | public static int ForInteger(string prompt, int minimum = 1, int maxim... method ForCommandCharacter (line 35) | public static string ForCommandCharacter(string prompt, string allowed... method WriteNotUnderstood (line 53) | private static void WriteNotUnderstood() FILE: 10_Blackjack/java/src/Blackjack.java class Blackjack (line 30) | public class Blackjack { method main (line 31) | public static void main(String[] args) { FILE: 10_Blackjack/java/src/Card.java type Suit (line 14) | public enum Suit { method toString (line 27) | public String toString() { method toProseString (line 51) | public String toProseString() { FILE: 10_Blackjack/java/src/Deck.java class Deck (line 6) | public class Deck { method Deck (line 20) | public Deck(Function, LinkedList> shuffleAlgori... method deal (line 30) | public Card deal() { method reshuffle (line 40) | public void reshuffle() { method size (line 54) | public int size() { method getCards (line 62) | public List getCards() { FILE: 10_Blackjack/java/src/Game.java class Game (line 9) | public class Game { method Game (line 14) | public Game(Deck deck, UserIo userIo) { method run (line 22) | public void run() { method collectInsurance (line 103) | protected void collectInsurance(Iterable players) { method printInitialDeal (line 128) | private void printInitialDeal(List players, Player dealer) { method play (line 157) | protected void play(Player player) { method play (line 161) | private void play(Player player, int handNumber) { method shouldPlayDealer (line 234) | protected boolean shouldPlayDealer(List players){ method playDealer (line 258) | protected void playDealer(Player dealer) { method evaluateRound (line 289) | protected void evaluateRound(List players, Player dealer) { method betsAreValid (line 339) | public boolean betsAreValid(Collection players) { FILE: 10_Blackjack/java/src/Player.java class Player (line 8) | public class Player { method Player (line 21) | public Player(int playerNumber) { method getPlayerNumber (line 31) | public int getPlayerNumber() { method getCurrentBet (line 35) | public double getCurrentBet() { method setCurrentBet (line 39) | public void setCurrentBet(double currentBet) { method getSplitBet (line 43) | public double getSplitBet() { method getInsuranceBet (line 47) | public double getInsuranceBet() { method setInsuranceBet (line 51) | public void setInsuranceBet(double insuranceBet) { method recordRound (line 59) | public void recordRound(double totalBet) { method getTotal (line 70) | public double getTotal() { method dealCard (line 79) | public void dealCard(Card card) { method dealCard (line 89) | public void dealCard(Card card, int handNumber) { method canSplit (line 103) | public boolean canSplit() { method isSplit (line 117) | public boolean isSplit() { method split (line 124) | public void split() { method canDoubleDown (line 136) | public boolean canDoubleDown(int handNumber) { method doubleDown (line 152) | public void doubleDown(Card card, int handNumber) { method resetHand (line 166) | public void resetHand() { method getHand (line 171) | public List getHand() { method getHand (line 180) | public List getHand(int handNumber) { FILE: 10_Blackjack/java/src/ScoringUtils.java class ScoringUtils (line 3) | public final class ScoringUtils { method scoreHand (line 12) | public static final int scoreHand(List hand) { method compareHands (line 37) | public static final int compareHands(List handA, List hand... FILE: 10_Blackjack/java/src/UserIo.java class UserIo (line 17) | public class UserIo { method UserIo (line 30) | public UserIo(Reader in, Writer out) { method println (line 40) | public void println(String text) { method println (line 50) | public void println(String text, int leftPad) { method print (line 60) | public void print(String text) { method readLine (line 71) | private String readLine() { method prompt (line 89) | public String prompt(String prompt) { method promptBoolean (line 99) | public boolean promptBoolean(String prompt) { method promptInt (line 120) | public int promptInt(String prompt) { method promptDouble (line 145) | public double promptDouble(String prompt) { FILE: 10_Blackjack/java/test/DeckTest.java class DeckTest (line 5) | public class DeckTest { method testInit (line 7) | @Test FILE: 10_Blackjack/java/test/GameTest.java class GameTest (line 22) | public class GameTest { method resetIo (line 31) | @BeforeEach method playerGets (line 40) | private void playerGets(int value, Card.Suit suit) { method playerSays (line 44) | private void playerSays(String action) { method initGame (line 48) | private void initGame() { method printOutput (line 57) | @AfterEach method shouldQuitOnCtrlD (line 62) | @Test method collectInsuranceNo (line 76) | @Test method collectInsuranceYes (line 94) | @Test method collectInsuranceYesTooMuch (line 115) | @Test method collectInsuranceYesNegative (line 136) | @Test method collectInsuranceYesTwoPlayers (line 157) | @Test method playEndOnStay (line 184) | @Test method playHitUntilBust (line 201) | @Test method playDoubleDown (line 224) | @Test method playDoubleDownLate (line 245) | @Test method playSplitEndOnStay (line 267) | @Test method playSplitHitUntilBust (line 290) | @Test method playSplitHitUntilBustHand2 (line 313) | @Test method playSplitDoubleDown (line 337) | @Test method playSplitTwice (line 367) | @Test method playSplitTwiceHand2 (line 391) | @Test method evaluateRoundWithSplitHands (line 415) | @Test method evaluateRoundWithInsurance (line 447) | @Test method evaluateRoundWithPush (line 473) | @Test method shouldPlayDealerBust (line 497) | @Test method ShouldPlayer (line 524) | @Test method shouldPlayDealerNonNaturalBlackjack (line 551) | @Test method shouldPlayDealerNonBlackjack (line 569) | @Test method playDealerLessThanSeventeen (line 586) | @Test method playDealerMoreThanSeventeen (line 604) | @Test FILE: 10_Blackjack/java/test/ScoringUtilsTest.java class ScoringUtilsTest (line 9) | public class ScoringUtilsTest { method scoreHandHardAce (line 11) | @Test method scoreHandMultipleAces (line 27) | @Test method compareHandsAWins (line 43) | @Test method compareHandsBwins (line 59) | @Test method compareHandsAWinsWithNaturalBlackJack (line 76) | @Test method compareHandsBWinsWithNaturalBlackJack (line 94) | @Test method compareHandsTieBothBlackJack (line 111) | @Test method compareHandsTieNoBlackJack (line 127) | @Test method compareHandsTieBust (line 143) | @Test method compareHandsABusted (line 160) | @Test method compareHandsBBusted (line 177) | @Test FILE: 10_Blackjack/java/test/UserIoTest.java class UserIoTest (line 15) | public class UserIoTest { method testPromptBooleanAcceptsNo (line 17) | @ParameterizedTest(name = "''{0}'' is accepted as ''no''") method testPromptBooleanAcceptsYes (line 33) | @ParameterizedTest(name = "''{0}'' is accepted as ''yes''") method testPromptIntAcceptsNumbers (line 49) | @ParameterizedTest(name = "''{0}'' is accepted as number") method testPromptIntRepromptsOnNonNumeric (line 69) | @Test FILE: 10_Blackjack/javascript/blackjack.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function af (line 66) | function af(q) { function reshuffle (line 70) | function reshuffle() function get_card (line 84) | function get_card() function card_print (line 92) | function card_print(x) function alt_card_print (line 98) | function alt_card_print(x) function add_card (line 104) | function add_card(which) function evaluate_hand (line 135) | function evaluate_hand(which) function add_card_to_row (line 145) | function add_card_to_row(i, x) { function discard_row (line 158) | function discard_row(i) { function print_total (line 167) | function print_total(i) { function total_aa (line 174) | function total_aa() function total_ab (line 180) | function total_ab() function total_ac (line 186) | function total_ac() function process_input (line 192) | function process_input(str) function main (line 208) | async function main() FILE: 10_Blackjack/python/blackjack.py class PlayerType (line 14) | class PlayerType(enum.Enum): class Play (line 19) | class Play(enum.Enum): class Card (line 26) | class Card(NamedTuple): method value (line 30) | def value(self) -> int: class Hand (line 52) | class Hand(NamedTuple): method add_card (line 55) | def add_card(self, card: Card) -> None: method get_total (line 59) | def get_total(self) -> int: method discard_hand (line 69) | def discard_hand(self, deck: "Decks") -> None: class Decks (line 78) | class Decks(NamedTuple): method new (line 83) | def new(cls) -> "Decks": method shuffle (line 100) | def shuffle(self) -> None: method draw_card (line 104) | def draw_card(self) -> Card: class Player (line 127) | class Player: method new (line 136) | def new(cls, player_type: PlayerType, index: int) -> "Player": method get_name (line 147) | def get_name(self) -> str: method get_bet (line 150) | def get_bet(self) -> None: method hand_as_string (line 160) | def hand_as_string(self, hide_dealer: bool) -> str: method get_play (line 183) | def get_play(self) -> Play: class Game (line 214) | class Game: method new (line 220) | def new(cls, num_players: int) -> "Game": method _print_stats (line 232) | def _print_stats(self) -> None: method stats_as_string (line 236) | def stats_as_string(self) -> str: method play_game (line 249) | def play_game(self) -> None: function main (line 386) | def main() -> None: function print_welcome_screen (line 403) | def print_welcome_screen() -> None: function print_instructions (line 412) | def print_instructions() -> None: function get_number_from_user_input (line 437) | def get_number_from_user_input(prompt: str, min_value: int, max_value: i... function get_char_from_user_input (line 453) | def get_char_from_user_input(prompt: str, valid_results: List[str]) -> str: function clear (line 464) | def clear() -> None: FILE: 10_Blackjack/ruby/blackjack.rb function intro (line 3) | def intro function ask_for_players_count (line 7) | def ask_for_players_count FILE: 10_Blackjack/ruby/game.rb class Game (line 6) | class Game method initialize (line 14) | def initialize(players_count) method start (line 21) | def start method collect_bets_and_deal (line 33) | def collect_bets_and_deal method play_players (line 46) | def play_players method check_for_insurance_bets (line 52) | def check_for_insurance_bets method play_dealer (line 64) | def play_dealer method settle (line 79) | def settle method print_players_and_dealer_hands (line 91) | def print_players_and_dealer_hands method play_hand (line 97) | def play_hand player, hand FILE: 10_Blackjack/ruby/model/card_kind.rb type Model (line 1) | module Model class CardKind (line 2) | class CardKind method initialize (line 3) | def initialize(label, value) method same_value? (line 29) | def same_value?(other_card) method + (line 33) | def +(other) FILE: 10_Blackjack/ruby/model/hand.rb type Model (line 3) | module Model class Hand (line 4) | class Hand method initialize (line 10) | def initialize(bet, cards, is_split_hand: false) method is_playing? (line 20) | def is_playing? method is_busted? (line 24) | def is_busted? method is_standing? (line 28) | def is_standing? method is_blackjack? (line 32) | def is_blackjack? method total (line 36) | def total(is_dealer: false) method can_split? (line 54) | def can_split? method split (line 58) | def split method hit (line 66) | def hit(card) method double_down (line 75) | def double_down(card) method stand (line 84) | def stand method check_busted (line 93) | def check_busted FILE: 10_Blackjack/ruby/model/pack.rb type Model (line 3) | module Model class Pack (line 4) | class Pack method initialize (line 5) | def initialize method reshuffle_if_necessary (line 10) | def reshuffle_if_necessary method draw (line 15) | def draw method reshuffle (line 22) | def reshuffle FILE: 10_Blackjack/ruby/model/player.rb type Model (line 3) | module Model class Player (line 4) | class Player method initialize (line 5) | def initialize(id) method deal_initial_hand (line 18) | def deal_initial_hand(hand) method has_split_hand? (line 25) | def has_split_hand? method can_split? (line 29) | def can_split? method split (line 33) | def split method bet_insurance (line 39) | def bet_insurance(bet) method update_balance (line 55) | def update_balance(dealer_hand) method get_balance_update (line 77) | def get_balance_update(hand, dealer_hand) FILE: 10_Blackjack/rust/src/main.rs type PlayerType (line 13) | enum PlayerType { method to_string (line 18) | fn to_string(&self) -> String { type Play (line 25) | enum Play { method to_string (line 32) | fn to_string(&self) -> String { type CARD (line 42) | struct CARD<'a> { function new (line 50) | fn new(card_name: &str) -> CARD { function determine_value_from_name (line 58) | fn determine_value_from_name(card_name: &str) -> u8 { type HAND (line 82) | struct HAND<'a> { function new (line 89) | fn new() -> HAND<'a> { function add_card (line 96) | fn add_card(&mut self, card: CARD<'a>) { function get_total (line 103) | fn get_total(&self) -> usize { function discard_hand (line 120) | fn discard_hand(&mut self, deck: &mut DECKS<'a>) { type DECKS (line 127) | struct DECKS<'a> { function new (line 135) | fn new() -> DECKS<'a> { function shuffle (line 161) | fn shuffle(&mut self) { function draw_card (line 169) | fn draw_card(&mut self) -> CARD<'a> { type PLAYER (line 190) | struct PLAYER<'a> { function new (line 203) | fn new(player_type: PlayerType, index: usize) -> PLAYER<'a> { function get_name (line 207) | fn get_name(&self) -> String { function get_bet (line 214) | fn get_bet(&mut self) { function hand_as_string (line 230) | fn hand_as_string(&self, hide_dealer:bool) -> String { function get_play (line 280) | fn get_play(&self) -> Play { type GAME (line 314) | struct GAME<'a> { function new (line 323) | fn new(num_players:usize) -> GAME<'a> { function _print_stats (line 348) | fn _print_stats(&self) { function stats_as_string (line 355) | fn stats_as_string(&self) -> String { function play_game (line 372) | fn play_game(&mut self) { constant CARD_NAMES (line 496) | const CARD_NAMES: [&str;13] = ["ACE","2","3","4","5","6","7","8","9","10... constant STARTING_BALANCE (line 497) | const STARTING_BALANCE: usize = 100; function main (line 499) | fn main() { function welcome (line 526) | fn welcome() { function instructions (line 537) | fn instructions() { function get_number_from_user_input (line 563) | fn get_number_from_user_input(prompt: &str, min:usize, max:usize) -> usi... function get_char_from_user_input (line 598) | fn get_char_from_user_input(prompt: &str, valid_results: &Vec) -> ... function clear (line 632) | fn clear() { FILE: 11_Bombardment/csharp/Bombardment.cs class Bombardment (line 13) | internal class Bombardment method PrintStartingMessage (line 22) | private void PrintStartingMessage() method PlaceComputerPlatoons (line 61) | private void PlaceComputerPlatoons() method StoreHumanPositions (line 74) | private void StoreHumanPositions() method HumanTurn (line 87) | private void HumanTurn() method GenerateComputerGuess (line 121) | private int GenerateComputerGuess() method ComputerTurn (line 134) | private void ComputerTurn() method Play (line 166) | public void Play() FILE: 11_Bombardment/csharp/Program.cs class Program (line 5) | class Program method Main (line 7) | static void Main(string[] args) FILE: 11_Bombardment/java/src/Bombardment.java class Bombardment (line 13) | public class Bombardment { type GAME_STATE (line 18) | private enum GAME_STATE { method Bombardment (line 45) | public Bombardment() { method play (line 56) | public void play() { method uniqueComputerGuess (line 163) | private int uniqueComputerGuess() { method computersChosenPlatoons (line 188) | private HashSet computersChosenPlatoons() { method showPlayerProgress (line 214) | private void showPlayerProgress(int hits) { method showComputerProgress (line 225) | private void showComputerProgress(int hits, int lastGuess) { method showProgress (line 237) | private void showProgress(int hits, String[] messages) { method updatePlayerHits (line 247) | private int updatePlayerHits(int fireLocation) { method updateComputerHits (line 262) | private int updateComputerHits(int fireLocation) { method didPlayerHitComputerPlatoon (line 277) | private boolean didPlayerHitComputerPlatoon(int fireLocation) { method didComputerHitPlayerPlatoon (line 287) | private boolean didComputerHitPlayerPlatoon(int fireLocation) { method drawBattlefield (line 294) | private void drawBattlefield() { method intro (line 303) | private void intro() { method init (line 324) | private void init() { method getDelimitedValue (line 343) | private int getDelimitedValue(String text, int pos) { method displayTextAndGetInput (line 355) | private String displayTextAndGetInput(String text) { method randomNumber (line 365) | private int randomNumber() { FILE: 11_Bombardment/java/src/BombardmentGame.java class BombardmentGame (line 1) | public class BombardmentGame { method main (line 3) | public static void main(String[] args) { FILE: 11_Bombardment/javascript/bombardment.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 11_Bombardment/python/bombardment.py function print_intro (line 7) | def print_intro() -> None: function display_field (line 27) | def display_field() -> None: function positions_list (line 34) | def positions_list() -> List[int]: function generate_enemy_positions (line 38) | def generate_enemy_positions() -> Set[int]: function is_valid_position (line 45) | def is_valid_position(pos: int) -> bool: function prompt_for_player_positions (line 49) | def prompt_for_player_positions() -> Set[int]: function prompt_player_for_target (line 65) | def prompt_player_for_target() -> int: function attack (line 76) | def attack( function init_enemy (line 95) | def init_enemy() -> Callable[[], int]: function main (line 130) | def main() -> None: FILE: 11_Bombardment/ruby/bombardment.rb class Battlefield (line 3) | class Battlefield method with_random_platoon_placements (line 8) | def with_random_platoon_placements method valid_platoon_placement? (line 12) | def valid_platoon_placement?(i) method initialize (line 17) | def initialize(platoon_placements) method fire_missile_at (line 23) | def fire_missile_at(outpost) method remaining_platoons_count (line 27) | def remaining_platoons_count class Game (line 32) | class Game method initialize (line 33) | def initialize(player_battlefield:, computer_battlefield:) method play (line 38) | def play method finished? (line 59) | def finished? method get_integer_answer_to (line 66) | def get_integer_answer_to(question) method print_computer_success_message (line 71) | def print_computer_success_message(computer_choice) method print_player_success_message (line 90) | def print_player_success_message function print_matrix (line 131) | def print_matrix function ask_for_platoon_placements (line 138) | def ask_for_platoon_placements function start_game (line 151) | def start_game FILE: 11_Bombardment/rust/src/main.rs function main (line 5) | fn main() { function player_turn (line 61) | fn player_turn(ai_positions: &mut Vec) -> bool { function ai_turn (line 90) | fn ai_turn(all_positions: &mut Vec, player_positions: &mut Vec) ... function get_text_from_number (line 127) | fn get_text_from_number(n: usize) -> &'static str { FILE: 12_Bombs_Away/csharp/BombsAwayConsole/ConsoleUserInterface.cs class ConsoleUserInterface (line 6) | internal class ConsoleUserInterface : BombsAwayGame.IUserInterface method Output (line 12) | public void Output(string message) method Choose (line 23) | public int Choose(string message, IList choices) method ConsoleKeysFromList (line 51) | private ISet ConsoleKeysFromList(IList list) method ListIndexFromConsoleKey (line 63) | private int ListIndexFromConsoleKey(ConsoleKey key) method ReadChoice (line 73) | private ConsoleKey? ReadChoice(ISet allowedKeys) method ReadKey (line 83) | private ConsoleKeyInfo ReadKey() method ChooseYesOrNo (line 96) | public bool ChooseYesOrNo(string message) method InputInteger (line 117) | public int InputInteger() FILE: 12_Bombs_Away/csharp/BombsAwayGame/AlliesSide.cs class AlliesSide (line 6) | internal class AlliesSide : MissionSide method AlliesSide (line 8) | public AlliesSide(IUserInterface ui) FILE: 12_Bombs_Away/csharp/BombsAwayGame/EnemyArtillery.cs type EnemyArtillery (line 8) | internal record class EnemyArtillery(string Name, int Accuracy); FILE: 12_Bombs_Away/csharp/BombsAwayGame/Game.cs class Game (line 6) | public class Game method Game (line 14) | public Game(IUserInterface ui) method Play (line 22) | public void Play() type SideDescriptor (line 34) | private record class SideDescriptor(string Name, Func CreateSide); method ChooseSide (line 40) | private Side ChooseSide() FILE: 12_Bombs_Away/csharp/BombsAwayGame/GermanySide.cs class GermanySide (line 6) | internal class GermanySide : MissionSide method GermanySide (line 8) | public GermanySide(IUserInterface ui) FILE: 12_Bombs_Away/csharp/BombsAwayGame/IUserInterface.cs type IUserInterface (line 10) | public interface IUserInterface method Output (line 16) | void Output(string message); method Choose (line 24) | int Choose(string message, IList choices); method ChooseYesOrNo (line 31) | bool ChooseYesOrNo(string message); method InputInteger (line 37) | int InputInteger(); FILE: 12_Bombs_Away/csharp/BombsAwayGame/ItalySide.cs class ItalySide (line 6) | internal class ItalySide : MissionSide method ItalySide (line 8) | public ItalySide(IUserInterface ui) FILE: 12_Bombs_Away/csharp/BombsAwayGame/JapanSide.cs class JapanSide (line 6) | internal class JapanSide : Side method JapanSide (line 8) | public JapanSide(IUserInterface ui) method Play (line 17) | public override void Play() FILE: 12_Bombs_Away/csharp/BombsAwayGame/Mission.cs type Mission (line 8) | internal record class Mission(string Name, string Description); FILE: 12_Bombs_Away/csharp/BombsAwayGame/MissionSide.cs class MissionSide (line 6) | internal abstract class MissionSide : Side method MissionSide (line 12) | public MissionSide(IUserInterface ui) method Play (line 25) | public override void Play() method ChooseMission (line 40) | private Mission ChooseMission() method MissionCountFromUI (line 62) | private int MissionCountFromUI() method CommentOnMissionCount (line 98) | private void CommentOnMissionCount(int missionCount) method AttemptMission (line 114) | private void AttemptMission(int missionCount) method MissedTarget (line 129) | private void MissedTarget() method ChooseEnemyArtillery (line 160) | private EnemyArtillery ChooseEnemyArtillery() method EnemyHitRatePercentFromUI (line 184) | private int EnemyHitRatePercentFromUI() FILE: 12_Bombs_Away/csharp/BombsAwayGame/Side.cs class Side (line 6) | internal abstract class Side method Side (line 12) | public Side(IUserInterface ui) method Play (line 20) | public abstract void Play(); method RandomFrac (line 36) | protected double RandomFrac() => _random.NextDouble(); method RandomInteger (line 44) | protected int RandomInteger(int minValue, int maxValue) => _random.Nex... method MissionSucceeded (line 49) | protected void MissionSucceeded() method EnemyCounterattack (line 75) | protected void EnemyCounterattack(EnemyArtillery artillery, int hitRat... method MissionFailed (line 90) | protected void MissionFailed() FILE: 12_Bombs_Away/java/src/BombsAway.java class BombsAway (line 18) | public class BombsAway { type GAME_STATE (line 27) | private enum GAME_STATE { type SIDE (line 44) | public enum SIDE { method SIDE (line 52) | SIDE(int value) { method getValue (line 56) | public int getValue() { type TARGET (line 63) | public enum TARGET { method TARGET (line 73) | TARGET(int value) { method getValue (line 77) | public int getValue() { type ENEMY_DEFENCES (line 82) | public enum ENEMY_DEFENCES { method ENEMY_DEFENCES (line 89) | ENEMY_DEFENCES(int value) { method getValue (line 93) | public int getValue() { type AIRCRAFT (line 98) | public enum AIRCRAFT { method AIRCRAFT (line 106) | AIRCRAFT(int value) { method getValue (line 110) | public int getValue() { method BombsAway (line 129) | public BombsAway() { method play (line 141) | public void play() { method intro (line 354) | public void intro() { method getSide (line 363) | private SIDE getSide(String message) { method getTarget (line 380) | private TARGET getTarget(String message) { method getPlane (line 398) | private AIRCRAFT getPlane(String message) { method getEnemyDefences (line 418) | private ENEMY_DEFENCES getEnemyDefences(String message) { method displayTargetMessage (line 431) | private void displayTargetMessage(TARGET target) { method getNumberFromKeyboard (line 463) | private int getNumberFromKeyboard(String message) { method yesEntered (line 475) | private boolean yesEntered(String text) { method stringIsAnyValue (line 488) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 507) | private String displayTextAndGetInput(String text) { method randomNumber (line 518) | private double randomNumber(int range) { FILE: 12_Bombs_Away/java/src/BombsAwayGame.java class BombsAwayGame (line 1) | public class BombsAwayGame { method main (line 3) | public static void main(String[] args) { FILE: 12_Bombs_Away/javascript/bombsaway.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 12_Bombs_Away/python/bombs_away.py function _stdin_choice (line 11) | def _stdin_choice(prompt: str, *, choices: Iterable[str]) -> str: function player_survived (line 19) | def player_survived() -> None: function player_death (line 23) | def player_death() -> None: function mission_success (line 30) | def mission_success() -> None: function death_with_chance (line 35) | def death_with_chance(p_death: float) -> bool: function commence_non_kamikazi_attack (line 45) | def commence_non_kamikazi_attack() -> None: function mission_failure (line 73) | def mission_failure() -> None: function play_italy (line 119) | def play_italy() -> None: function play_allies (line 135) | def play_allies() -> None: function play_japan (line 151) | def play_japan() -> None: function play_germany (line 159) | def play_germany() -> None: function play_game (line 176) | def play_game() -> None: FILE: 12_Bombs_Away/rust/src/main.rs type Italy (line 8) | struct Italy; type Allies (line 9) | struct Allies; type Japan (line 10) | struct Japan; type Germany (line 11) | struct Germany; type ParseChoiceTargetError (line 14) | struct ParseChoiceTargetError; type ThreeTarget (line 17) | enum ThreeTarget { type Err (line 24) | type Err = ParseChoiceTargetError; method from_str (line 26) | fn from_str(s: &str) -> Result { type FourTarget (line 37) | enum FourTarget { type Err (line 45) | type Err = ParseChoiceTargetError; method from_str (line 47) | fn from_str(s: &str) -> Result { type Brefing (line 59) | pub trait Brefing { method prompt (line 61) | fn prompt<'a>(&self) -> &'a str; method targets_to_messages (line 62) | fn targets_to_messages<'a>(&self, target: Self::TargetOption) -> &'a str; type TargetOption (line 66) | type TargetOption = ThreeTarget; method prompt (line 68) | fn prompt<'a>(&self) -> &'a str { method targets_to_messages (line 72) | fn targets_to_messages<'a>(&self, target: Self::TargetOption) -> &'a s... type TargetOption (line 82) | type TargetOption = FourTarget; method prompt (line 84) | fn prompt<'a>(&self) -> &'a str { method targets_to_messages (line 88) | fn targets_to_messages<'a>(&self, target: Self::TargetOption) -> &'a s... type TargetOption (line 99) | type TargetOption = ThreeTarget; method prompt (line 101) | fn prompt<'a>(&self) -> &'a str { method targets_to_messages (line 105) | fn targets_to_messages<'a>(&self, target: Self::TargetOption) -> &'a s... type Side (line 114) | enum Side { method from (line 122) | fn from(value: FourTarget) -> Self { function stdin_choice (line 132) | fn stdin_choice(prompt: &str) -> C { function stdin_y_or_n (line 148) | fn stdin_y_or_n(prompt: &str) -> bool { function commence_non_kamikazi_attack (line 157) | fn commence_non_kamikazi_attack() { function play_japan (line 188) | fn play_japan() { function player_death (line 203) | fn player_death() { function mission_success (line 210) | fn mission_success() { function mission_failure (line 219) | fn mission_failure() { function player_survived (line 264) | fn player_survived() { function death_with_chance (line 268) | fn death_with_chance(p_death: f32) -> bool { function main (line 274) | fn main() { FILE: 13_Bounce/csharp/Bounce.cs class Bounce (line 9) | internal class Bounce method Bounce (line 15) | internal Bounce(float velocity) method Plot (line 25) | public float Plot(Graph graph, float startTime) method Next (line 37) | public Bounce Next(float elasticity) => new Bounce(_velocity * elastic... FILE: 13_Bounce/csharp/Game.cs class Game (line 5) | internal class Game method Game (line 9) | public Game(IReadWrite io) method Play (line 14) | public void Play(Func playAgain) FILE: 13_Bounce/csharp/Graph.cs class Graph (line 8) | internal class Graph method Graph (line 12) | public Graph(float maxHeight, float timeIncrement) method Plot (line 24) | public void Plot(float time, float height) method ToString (line 35) | public override string ToString() class Row (line 47) | internal class Row method Row (line 54) | public Row(string label) method ToString (line 72) | public override string ToString() => new string(_chars); class Axis (line 75) | internal class Axis method Axis (line 81) | internal Axis(float maxTimePlotted, float timeIncrement) method ToString (line 93) | public override string ToString() class Labels (line 101) | internal class Labels : Row method Labels (line 103) | public Labels() method Add (line 108) | public void Add(int column, string label) FILE: 13_Bounce/csharp/IReadWriteExtensions.cs class IReadWriteExtensions (line 3) | internal static class IReadWriteExtensions method ReadParameter (line 5) | internal static float ReadParameter(this IReadWrite io, string parameter) FILE: 13_Bounce/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams method GetStream (line 14) | private static Stream GetStream([CallerMemberName] string? name = null) FILE: 13_Bounce/java/Bounce.java class Bounce (line 16) | public class Bounce { method Bounce (line 20) | public Bounce() { method play (line 26) | public void play() { method showIntro (line 33) | private void showIntro() { method startGame (line 41) | private void startGame() { method main (line 162) | public static void main(String[] args) { FILE: 13_Bounce/javascript/bounce.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 13_Bounce/python/bounce.py function print_centered (line 14) | def print_centered(msg: str) -> None: function print_header (line 19) | def print_header(title: str) -> None: function print_instructions (line 27) | def print_instructions() -> None: function get_initial_conditions (line 38) | def get_initial_conditions() -> Tuple[float, float, float]: function print_at_tab (line 49) | def print_at_tab(line: str, tab: int, s: str) -> str: function run_simulation (line 54) | def run_simulation(delta_t: float, v0: float, coeff_rest: float) -> None: function main (line 99) | def main() -> None: FILE: 13_Bounce/ruby/bounce.rb function calc_velocity_for_bounce (line 25) | def calc_velocity_for_bounce(v0, bounce, coefficient) function calc_bounce_total_time (line 30) | def calc_bounce_total_time(v0, bounce, coefficient) function calc_ball_height (line 36) | def calc_ball_height(v0, bounce, coefficient, t) function heighest_position_in_next_bounce (line 41) | def heighest_position_in_next_bounce(time_in_bounce, v0, i, c) function intro (line 47) | def intro function plot_header (line 66) | def plot_header function plot_bouncing_ball (line 71) | def plot_bouncing_ball(strobbing_time, v0, c) function plot_footer (line 127) | def plot_footer (plot_width, strobbing_time) function game_loop (line 153) | def game_loop FILE: 13_Bounce/rust/src/main.rs function input (line 11) | fn input(msg: &str) -> String { function main (line 19) | fn main() { FILE: 14_Bowling/csharp/Bowling.cs class Bowling (line 9) | public class Bowling method Play (line 15) | public void Play() method ShowBanner (line 23) | private static void ShowBanner() method MaybeShowInstructions (line 35) | private static void MaybeShowInstructions() method Setup (line 46) | private void Setup() method GameLoop (line 54) | private void GameLoop() method InitGameResults (line 131) | private GameResults[] InitGameResults() method ShowPins (line 141) | private void ShowPins(int player, int frame, int ball) method ResetGameResults (line 159) | private void ResetGameResults(GameResults[] gameResults) method ShowGameResults (line 169) | private void ShowGameResults(GameResults[] gameResults) FILE: 14_Bowling/csharp/FrameResult.cs class FrameResult (line 9) | public class FrameResult type Points (line 11) | public enum Points { None, Error, Spare, Strike }; method Reset (line 17) | public void Reset() FILE: 14_Bowling/csharp/GameResults.cs class GameResults (line 9) | public class GameResults method GameResults (line 14) | public GameResults() FILE: 14_Bowling/csharp/Pins.cs class Pins (line 9) | public class Pins type State (line 11) | public enum State { Up, Down }; method Pins (line 17) | public Pins() method Roll (line 26) | public int Roll() method Reset (line 44) | public void Reset() method GetPinsDown (line 51) | public int GetPinsDown() FILE: 14_Bowling/csharp/Program.cs class Program (line 9) | public static class Program method Main (line 11) | public static void Main() FILE: 14_Bowling/csharp/Utility.cs class Utility (line 9) | internal static class Utility method PadInt (line 11) | public static string PadInt(int value, int width) method InputInt (line 15) | public static int InputInt() method InputString (line 25) | public static string InputString() method PrintInt (line 31) | public static void PrintInt(int value, bool newLine = false) method PrintString (line 35) | public static void PrintString(bool newLine = true) method PrintString (line 39) | public static void PrintString(int tab, bool newLine = true) method PrintString (line 43) | public static void PrintString(string value, bool newLine = true) method PrintString (line 47) | public static void PrintString(int tab, string value, bool newLine = t... FILE: 14_Bowling/java/Bowling.java class Bowling (line 16) | public class Bowling { method Bowling (line 20) | public Bowling() { method play (line 26) | public void play() { method showIntro (line 33) | private static void showIntro() { method startGame (line 41) | private void startGame() { method printRules (line 260) | public static void printRules() { method main (line 271) | public static void main(String[] args) { FILE: 14_Bowling/javascript/bowling.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 14_Bowling/python/bowling.py function simulate_roll (line 5) | def simulate_roll(pins: List[int]) -> None: function calculate_score (line 12) | def calculate_score(rolls: List[int]) -> int: class Player (line 35) | class Player: method __init__ (line 36) | def __init__(self, name: str) -> None: method play_frame (line 40) | def play_frame(self, frame: int) -> None: method __str__ (line 76) | def __str__(self) -> str: method show (line 79) | def show(self, pins: List[int]) -> None: function centre_text (line 90) | def centre_text(text: str, width: int) -> str: function main (line 95) | def main() -> None: FILE: 15_Boxing/csharp/AttackStrategy.cs class AttackStrategy (line 3) | public abstract class AttackStrategy method AttackStrategy (line 10) | public AttackStrategy(Boxer other, Stack work, Action notifyGa... method Attack (line 17) | public void Attack() method GetPunch (line 34) | protected abstract AttackPunch GetPunch(); method FullSwing (line 35) | protected abstract void FullSwing(); method Hook (line 36) | protected abstract void Hook(); method Uppercut (line 37) | protected abstract void Uppercut(); method Jab (line 38) | protected abstract void Jab(); method RegisterKnockout (line 40) | protected void RegisterKnockout(string knockoutMessage) type AttackPunch (line 47) | protected record AttackPunch(Punch Punch, bool IsBestPunch); FILE: 15_Boxing/csharp/Boxer.cs class Boxer (line 3) | public class Boxer method SetName (line 13) | public void SetName(string prompt) method ResetForNewRound (line 26) | public void ResetForNewRound() => DamageTaken = 0; method RecordWin (line 28) | public void RecordWin() => _wins += 1; method ToString (line 32) | public override string ToString() => Name; class Opponent (line 35) | public class Opponent : Boxer method SetRandomPunches (line 37) | public void SetRandomPunches() FILE: 15_Boxing/csharp/OpponentAttackStrategy.cs class OpponentAttackStrategy (line 6) | public class OpponentAttackStrategy : AttackStrategy method OpponentAttackStrategy (line 10) | public OpponentAttackStrategy(Opponent opponent, Boxer player, Action... method GetPunch (line 15) | protected override AttackPunch GetPunch() method FullSwing (line 21) | protected override void FullSwing() // 720 method Hook (line 51) | protected override void Hook() // 810 method Uppercut (line 63) | protected override void Uppercut() // 860 method Jab (line 90) | protected override void Jab() // 640 method RegisterOtherKnockedOut (line 113) | private void RegisterOtherKnockedOut() FILE: 15_Boxing/csharp/PlayerAttackStrategy.cs class PlayerAttackStrategy (line 5) | public class PlayerAttackStrategy : AttackStrategy method PlayerAttackStrategy (line 9) | public PlayerAttackStrategy(Boxer player, Opponent opponent, Action no... method GetPunch (line 12) | protected override AttackPunch GetPunch() method FullSwing (line 18) | protected override void FullSwing() // 340 method Uppercut (line 48) | protected override void Uppercut() // 520 method Hook (line 74) | protected override void Hook() // 450 method Jab (line 100) | protected override void Jab() FILE: 15_Boxing/csharp/Punch.cs type Punch (line 3) | public enum Punch FILE: 15_Boxing/csharp/Round.cs class Round (line 3) | class Round method Round (line 15) | public Round(Boxer player, Opponent opponent, int round) method Start (line 29) | public void Start() method CheckOpponentWin (line 42) | public void CheckOpponentWin() method CheckPlayerWin (line 51) | public void CheckPlayerWin() method ResetPlayers (line 60) | private void ResetPlayers() method RoundBegins (line 67) | private void RoundBegins() method CheckRoundWinner (line 78) | private void CheckRoundWinner() method DecideWhoAttacks (line 92) | private void DecideWhoAttacks() FILE: 15_Boxing/csharp/Utils.cs class GameUtils (line 2) | public static class GameUtils method PrintPunchDescription (line 5) | public static void PrintPunchDescription() => method PunchDesc (line 8) | private static string PunchDesc(Punch punch) => $"({(int)punch}) {punc... method GetPunch (line 10) | public static Punch GetPunch(string prompt) method RollSatisfies (line 23) | public static bool RollSatisfies(int upperLimit, Predicate predic... method ToFriendlyString (line 25) | public static string ToFriendlyString(this Punch punch) FILE: 15_Boxing/java/Basic.java class Basic (line 6) | final class Basic { method randomOf (line 8) | public static int randomOf(int base) { class Console (line 16) | public static class Console { method readLine (line 19) | public String readLine() { method readInt (line 23) | public int readInt() { method print (line 41) | public void print(String message, Object... args) { FILE: 15_Boxing/java/Boxing.java class Boxing (line 9) | public class Boxing { method play (line 15) | public void play() { method opponentPunch (line 45) | private boolean opponentPunch() { method playerPunch (line 111) | private void playerPunch() { method showRoundWinner (line 177) | private void showRoundWinner(int roundNro) { method showWinner (line 187) | private void showWinner() { method loadPlayers (line 201) | private void loadPlayers() { method showIntro (line 222) | private void showIntro () { FILE: 15_Boxing/java/BoxingGame.java class BoxingGame (line 1) | public class BoxingGame { method main (line 3) | public static void main(String[] args) { FILE: 15_Boxing/java/GameSession.java class GameSession (line 5) | public class GameSession { method GameSession (line 15) | GameSession(Player player, Player opponent) { method getPlayer (line 20) | public Player getPlayer() { return player;} method getOpponent (line 21) | public Player getOpponent() { return opponent;} method setKnocked (line 23) | public void setKnocked() { method resetPoints (line 27) | public void resetPoints() { method addPlayerPoints (line 32) | public void addPlayerPoints(int ptos) { playerPoints+=ptos;} method addOpponentPoints (line 33) | public void addOpponentPoints(int ptos) { opponentPoints+=ptos;} method getPoints (line 35) | public int getPoints(Player player) { method addRoundWind (line 42) | public void addRoundWind(Player player) { method isOver (line 46) | public boolean isOver() { method isRoundWinner (line 50) | public boolean isRoundWinner(Player player) { method isGameWinner (line 57) | public boolean isGameWinner(Player player) { method isPlayerKnocked (line 64) | public boolean isPlayerKnocked() { FILE: 15_Boxing/java/Player.java class Player (line 4) | public class Player { method Player (line 10) | public Player(String name, Punch bestPunch, Punch vulnerability) { method Player (line 20) | public Player(String name) { method isPlayer (line 35) | public boolean isPlayer() { return isPlayer; } method getName (line 36) | public String getName() { return name; } method getBestPunch (line 37) | public Punch getBestPunch() { return bestPunch; } method hitVulnerability (line 39) | public boolean hitVulnerability(Punch punch) { FILE: 15_Boxing/java/Punch.java type Punch (line 6) | public enum Punch { method Punch (line 14) | Punch(int code) { method getCode (line 18) | int getCode() { return code;} method fromCode (line 20) | public static Punch fromCode(int code) { method random (line 24) | public static Punch random() { FILE: 15_Boxing/javascript/boxing.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 15_Boxing/python/boxing.py class PunchProfile (line 9) | class PunchProfile(NamedTuple): method is_hit (line 21) | def is_hit(self) -> bool: class Player (line 26) | class Player: method get_punch_choice (line 39) | def get_punch_choice(self) -> Literal[1, 2, 3, 4]: function get_vulnerability (line 55) | def get_vulnerability() -> int: function get_opponent_stats (line 60) | def get_opponent_stats() -> Tuple[int, int]: function read_punch_profiles (line 69) | def read_punch_profiles(filepath: Path) -> Dict[Literal[1, 2, 3, 4], Pun... function main (line 78) | def main() -> None: function is_opponents_turn (line 133) | def is_opponents_turn() -> bool: function play_round (line 137) | def play_round(round_number: int, player: Player, opponent: Player) -> N... FILE: 16_Bug/csharp/Bug.cs class Bug (line 7) | internal class Bug method TryAdd (line 13) | public bool TryAdd(IPart part, out Message message) => _body.TryAdd(pa... method ToString (line 15) | public string ToString(string pronoun, char feelerCharacter) FILE: 16_Bug/csharp/Game.cs class Game (line 8) | internal class Game method Game (line 13) | public Game(IReadWrite io, IRandom random) method Play (line 19) | public void Play() method BuildBugs (line 32) | private void BuildBugs() method TryBuild (line 64) | private bool TryBuild(Bug bug, Func messageTransform) FILE: 16_Bug/csharp/Parts/Body.cs class Body (line 6) | internal class Body : ParentPart method Body (line 12) | public Body() method TryAddCore (line 19) | protected override bool TryAddCore(IPart part, out Message message) method AppendTo (line 29) | public void AppendTo(StringBuilder builder, char feelerCharacter) FILE: 16_Bug/csharp/Parts/Feeler.cs class Feeler (line 3) | internal class Feeler : IPart FILE: 16_Bug/csharp/Parts/Feelers.cs class Feelers (line 6) | internal class Feelers : PartCollection method Feelers (line 8) | public Feelers() method AppendTo (line 13) | public void AppendTo(StringBuilder builder, char character) => AppendT... FILE: 16_Bug/csharp/Parts/Head.cs class Head (line 6) | internal class Head : ParentPart method Head (line 10) | public Head() method TryAddCore (line 17) | protected override bool TryAddCore(IPart part, out Message message) method AppendTo (line 24) | public void AppendTo(StringBuilder builder, char feelerCharacter) FILE: 16_Bug/csharp/Parts/IPart.cs type IPart (line 3) | internal interface IPart FILE: 16_Bug/csharp/Parts/Leg.cs class Leg (line 3) | internal class Leg : IPart FILE: 16_Bug/csharp/Parts/Legs.cs class Legs (line 6) | internal class Legs : PartCollection method Legs (line 8) | public Legs() method AppendTo (line 13) | public void AppendTo(StringBuilder builder) => AppendTo(builder, 6, 2,... FILE: 16_Bug/csharp/Parts/Neck.cs class Neck (line 6) | internal class Neck : ParentPart method Neck (line 10) | public Neck() method TryAddCore (line 17) | protected override bool TryAddCore(IPart part, out Message message) method AppendTo (line 25) | public void AppendTo(StringBuilder builder, char feelerCharacter) FILE: 16_Bug/csharp/Parts/ParentPart.cs class ParentPart (line 5) | internal abstract class ParentPart : Part method ParentPart (line 7) | public ParentPart(Message addedMessage, Message duplicateMessage) method TryAdd (line 12) | public bool TryAdd(IPart part, out Message message) method TryAddCore (line 20) | protected abstract bool TryAddCore(IPart part, out Message message); method ReportDoNotHave (line 22) | private bool ReportDoNotHave(out Message message) FILE: 16_Bug/csharp/Parts/Part.cs class Part (line 5) | internal class Part : IPart method Part (line 10) | public Part(Message addedMessage, Message duplicateMessage) method TryAdd (line 22) | public bool TryAdd(out Message message) FILE: 16_Bug/csharp/Parts/PartCollection.cs class PartCollection (line 6) | internal class PartCollection method PartCollection (line 13) | public PartCollection(int maxCount, Message addedMessage, Message full... method TryAddOne (line 22) | public bool TryAddOne(out Message message) method AppendTo (line 35) | protected void AppendTo(StringBuilder builder, int offset, int length,... FILE: 16_Bug/csharp/Parts/Tail.cs class Tail (line 6) | internal class Tail : Part method Tail (line 8) | public Tail() method AppendTo (line 13) | public void AppendTo(StringBuilder builder) FILE: 16_Bug/csharp/Resources/Message.cs class Message (line 5) | internal class Message method Message (line 29) | private Message(string common) method Message (line 34) | private Message(string i, string you) method DoNotHaveA (line 43) | public static Message DoNotHaveA(Part part) => new($"do not have a {pa... method ForValue (line 45) | public Message ForValue(int quantity) => new(string.Format(I, quantity... FILE: 16_Bug/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams method GetStream (line 15) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 16_Bug/java/src/Bug.java class Bug (line 13) | public class Bug { type GAME_STATE (line 18) | private enum GAME_STATE { method Bug (line 40) | public Bug() { method play (line 54) | public void play() { method draw (line 162) | private void draw(Insect bug) { method intro (line 172) | private void intro() { method instructions (line 180) | private void instructions() { method noEntered (line 207) | private boolean noEntered(String text) { method stringIsAnyValue (line 220) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 239) | private String displayTextAndGetInput(String text) { method randomNumber (line 249) | private int randomNumber() { FILE: 16_Bug/java/src/BugGame.java class BugGame (line 3) | public class BugGame { method main (line 5) | public static void main(String[] args) { FILE: 16_Bug/java/src/ComputerBug.java class ComputerBug (line 1) | public class ComputerBug extends Insect { method ComputerBug (line 5) | public ComputerBug() { FILE: 16_Bug/java/src/Insect.java class Insect (line 10) | public class Insect { type PARTS (line 20) | public enum PARTS { method Insect (line 46) | public Insect() { method addBody (line 55) | public String addBody() { method addBodyMessage (line 73) | private String addBodyMessage(boolean wasAdded) { method addNeck (line 90) | public String addNeck() { method addHead (line 111) | public String addHead() { method addFeelers (line 133) | public String addFeelers() { method addTail (line 154) | public String addTail() { method addLeg (line 175) | public String addLeg() { method init (line 218) | public void init() { method addMessages (line 235) | public void addMessages(String[] messages, PARTS bodyPart) { method draw (line 270) | public ArrayList draw() { method complete (line 342) | public boolean complete() { method addSpaces (line 357) | private String addSpaces(int number) { FILE: 16_Bug/java/src/PlayerBug.java class PlayerBug (line 1) | public class PlayerBug extends Insect { method PlayerBug (line 5) | public PlayerBug() { FILE: 16_Bug/javascript/bug.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 34) | function tab(space) function waitNSeconds (line 42) | function waitNSeconds(n) { function scrollToBottom (line 46) | function scrollToBottom() { function draw_head (line 50) | function draw_head() function drawFeelers (line 60) | function drawFeelers(feelerCount, character) { function drawNeck (line 70) | function drawNeck() { function drawBody (line 75) | function drawBody(computerTailCount) { function drawFeet (line 84) | function drawFeet(computerFeetCount) { function drawBug (line 93) | function drawBug(playerFeelerCount, playerHeadCount, playerNeckCount, pl... function main (line 113) | async function main() FILE: 16_Bug/python/bug.py class State (line 8) | class State: method is_finished (line 17) | def is_finished(self) -> bool: method display (line 26) | def display(self) -> None: function print_n_newlines (line 39) | def print_n_newlines(n: int) -> None: function print_feelers (line 44) | def print_feelers(n_feelers: int, is_player: bool = True) -> None: function print_head (line 52) | def print_head() -> None: function print_neck (line 61) | def print_neck() -> None: function print_body (line 66) | def print_body(has_tail: bool = False) -> None: function print_legs (line 74) | def print_legs(n_legs: int) -> None: function handle_roll (line 82) | def handle_roll(diceroll: Literal[1, 2, 3, 4, 5, 6], state: State) -> bool: function main (line 154) | def main() -> None: FILE: 16_Bug/ruby/Bug.rb class BugGame (line 1) | class BugGame method initialize (line 7) | def initialize method run (line 13) | def run method play (line 47) | def play player method one_part (line 70) | def one_part player, part, part_needed method two_parts (line 83) | def two_parts player, part, part_needed method is_completed? (line 101) | def is_completed? player method print_bug (line 105) | def print_bug player method instructions (line 113) | def instructions method antennae_and_leg (line 142) | def antennae_and_leg player, part method head (line 154) | def head player method neck (line 165) | def neck player method body (line 171) | def body player FILE: 17_Bullfight/csharp/Action.cs type Action (line 7) | public enum Action FILE: 17_Bullfight/csharp/ActionResult.cs type ActionResult (line 12) | public enum ActionResult FILE: 17_Bullfight/csharp/BullFight.cs class BullFight (line 9) | public static class BullFight method Begin (line 25) | public static IEnumerable Begin(Mediator mediator) FILE: 17_Bullfight/csharp/Controller.cs class Controller (line 8) | public static class Controller method StartGame (line 13) | public static void StartGame() method GetPlayerIntention (line 34) | public static (Action action, RiskLevel riskLevel) GetPlayerIntention(... method GetPlayerRunsFromRing (line 96) | public static bool GetPlayerRunsFromRing() method GetYesOrNo (line 113) | public static bool GetYesOrNo() FILE: 17_Bullfight/csharp/Events/BullCharging.cs type BullCharging (line 6) | public sealed record BullCharging(int PassNumber) : Event; FILE: 17_Bullfight/csharp/Events/Event.cs type Event (line 6) | public abstract record Event(); FILE: 17_Bullfight/csharp/Events/MatchCompleted.cs type MatchCompleted (line 6) | public sealed record MatchCompleted(ActionResult Result, bool ExtremeBra... FILE: 17_Bullfight/csharp/Events/MatchStarted.cs type MatchStarted (line 6) | public sealed record MatchStarted( FILE: 17_Bullfight/csharp/Events/PlayerGored.cs type PlayerGored (line 6) | public sealed record PlayerGored(bool Panicked, bool FirstGoring) : Event; FILE: 17_Bullfight/csharp/Events/PlayerSurvived.cs type PlayerSurvived (line 6) | public sealed record PlayerSurvived() : Event; FILE: 17_Bullfight/csharp/Mediator.cs class Mediator (line 14) | public class Mediator method Dodge (line 18) | public void Dodge(RiskLevel riskLevel) => method Kill (line 21) | public void Kill(RiskLevel riskLevel) => method Panic (line 24) | public void Panic() => method RunFromRing (line 27) | public void RunFromRing() => method ContinueFighting (line 30) | public void ContinueFighting() => method GetInput (line 39) | public T GetInput() FILE: 17_Bullfight/csharp/Program.cs class Program (line 3) | class Program method Main (line 5) | static void Main() FILE: 17_Bullfight/csharp/Quality.cs type Quality (line 11) | public enum Quality FILE: 17_Bullfight/csharp/Reward.cs type Reward (line 6) | public enum Reward FILE: 17_Bullfight/csharp/RiskLevel.cs type RiskLevel (line 6) | public enum RiskLevel FILE: 17_Bullfight/csharp/View.cs class View (line 8) | public static class View method ShowBanner (line 12) | public static void ShowBanner() method ShowInstructions (line 21) | public static void ShowInstructions() method ShowSeparator (line 44) | public static void ShowSeparator() method ShowStartingConditions (line 50) | public static void ShowStartingConditions(Events.MatchStarted matchSta... method ShowStartOfPass (line 106) | public static void ShowStartOfPass(int passNumber) method ShowPlayerGored (line 113) | public static void ShowPlayerGored(bool playerPanicked, bool firstGoring) method ShowPlayerSurvives (line 123) | public static void ShowPlayerSurvives() method ShowPlayerFoolhardy (line 129) | public static void ShowPlayerFoolhardy() method ShowFinalResult (line 134) | public static void ShowFinalResult(ActionResult result, bool extremeBr... method PromptShowInstructions (line 196) | public static void PromptShowInstructions() method PromptKillBull (line 201) | public static void PromptKillBull() method PromptKillBullBrief (line 207) | public static void PromptKillBullBrief() method PromptKillMethod (line 212) | public static void PromptKillMethod() method PromptCapeMove (line 221) | public static void PromptCapeMove() method PromptCapeMoveBrief (line 226) | public static void PromptCapeMoveBrief() method PromptDontPanic (line 231) | public static void PromptDontPanic() method PromptRunFromRing (line 237) | public static void PromptRunFromRing() FILE: 17_Bullfight/java/Bullfight.java class Bullfight (line 9) | public class Bullfight { method main (line 13) | public static void main(String[] args) { method printBullGradeInfo (line 84) | private static void printBullGradeInfo(BullGrade bullGrade) { method crowdReaction (line 93) | private static void crowdReaction(GameState gameState, BullGrade bullG... method handleCapeMove (line 124) | private static GameState handleCapeMove(int capeMove, Random random, S... method stateAfterGoring (line 144) | private static GameState stateAfterGoring(Random random, Scanner scann... method calculateCrowdReactionScore (line 160) | private static double calculateCrowdReactionScore(GameState gameState,... method calculateGameScore (line 168) | private static double calculateGameScore(GameState gameState, BullGrad... method readInt (line 172) | private static int readInt(String prompt, Scanner scanner) { method readCapeMove (line 185) | private static int readCapeMove(String initialPrompt, Scanner scanner) { method readYesOrNo (line 198) | private static BooleanAnswer readYesOrNo(Scanner scanner) { method printInstructions (line 211) | private static void printInstructions() { method printHeader (line 229) | private static void printHeader() { method randomNumber1or2 (line 238) | private static int randomNumber1or2(Random random) { method firstStage (line 242) | private static double firstStage(String horseType, String suffix, Bull... method getPerformanceRating (line 282) | public static String getPerformanceRating(int t) { method attemptKillBull (line 297) | private static GameState attemptKillBull(BullGrade bullGrade, Random r... method readAndHandleForfeitDecision (line 339) | private static GameState readAndHandleForfeitDecision(Random random, S... method readInstructionsChoice (line 361) | private static boolean readInstructionsChoice(Scanner scan) { type BooleanAnswer (line 369) | private enum BooleanAnswer { type BullGrade (line 373) | private enum BullGrade { method BullGrade (line 382) | BullGrade(int value) { method getValue (line 386) | public int getValue() { method fromValue (line 390) | public static BullGrade fromValue(int value) { class GameState (line 404) | private static class GameState { method GameState (line 412) | public GameState() { method newCopy (line 421) | public GameState newCopy() { type MatadorStatus (line 433) | private enum MatadorStatus { method MatadorStatus (line 441) | MatadorStatus(double value) { method getValue (line 445) | public double getValue() { type BullStatus (line 450) | private enum BullStatus { method BullStatus (line 456) | BullStatus(double value) { method getValue (line 460) | public double getValue() { FILE: 17_Bullfight/javascript/bullfight.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function af (line 55) | function af(k) function cf (line 60) | function cf(q) function df (line 65) | function df(q) function setup_helpers (line 70) | function setup_helpers() function main (line 106) | async function main() FILE: 17_Bullfight/python/bullfight.py function print_n_newlines (line 6) | def print_n_newlines(n: int) -> None: function determine_player_kills (line 11) | def determine_player_kills( function calculate_final_score (line 46) | def calculate_final_score( function print_header (line 68) | def print_header() -> None: function print_instructions (line 74) | def print_instructions() -> None: function print_intro (line 96) | def print_intro() -> None: function ask_bool (line 104) | def ask_bool(prompt: str) -> bool: function ask_int (line 115) | def ask_int() -> int: function did_bull_hit (line 125) | def did_bull_hit( function handle_bullkill_attempt (line 156) | def handle_bullkill_attempt( function final_message (line 191) | def final_message( function main (line 221) | def main() -> None: FILE: 18_Bullseye/csharp/BullseyeGame.cs class BullseyeGame (line 6) | public class BullseyeGame method BullseyeGame (line 14) | public BullseyeGame() method Run (line 21) | public void Run() method SetupGame (line 32) | private void SetupGame() method PlayGame (line 91) | private void PlayGame() method PrintResults (line 191) | private void PrintResults() method PrintIntroduction (line 213) | private void PrintIntroduction() FILE: 18_Bullseye/csharp/Player.cs class Player (line 6) | public class Player method Player (line 12) | public Player(string name) FILE: 18_Bullseye/csharp/Program.cs class Program (line 5) | public static class Program method Main (line 9) | public static void Main(string[] args) FILE: 18_Bullseye/java/src/Bullseye.java class Bullseye (line 13) | public class Bullseye { type GAME_STATE (line 25) | private enum GAME_STATE { method Bullseye (line 43) | public Bullseye() { method play (line 62) | public void play() { method intro (line 135) | private void intro() { method calculatePlayerPoints (line 156) | private int calculatePlayerPoints(int playerThrow) { method getPlayersThrow (line 201) | private int getPlayersThrow(Player player) { method chooseNumberOfPlayers (line 223) | private int chooseNumberOfPlayers() { method displayTextAndGetInput (line 234) | private String displayTextAndGetInput(String text) { method paddedString (line 248) | private String paddedString(String first, String second, String third) { FILE: 18_Bullseye/java/src/BullseyeGame.java class BullseyeGame (line 1) | public class BullseyeGame { method main (line 3) | public static void main(String[] args) { FILE: 18_Bullseye/java/src/Player.java class Player (line 5) | public class Player { method Player (line 11) | Player(String name) { method addScore (line 16) | public void addScore(int score) { method getName (line 20) | public String getName() { method getScore (line 24) | public int getScore() { FILE: 18_Bullseye/java/src/Shot.java class Shot (line 6) | public class Shot { method Shot (line 11) | Shot(double[] shots) { method getShot (line 16) | public double getShot(int index) { FILE: 18_Bullseye/javascript/bullseye.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 50) | async function main() FILE: 18_Bullseye/python/bullseye.py class Player (line 7) | class Player: function print_intro (line 12) | def print_intro() -> None: function print_outro (line 35) | def print_outro(players: List[Player], winners: List[int]) -> None: function main (line 45) | def main() -> None: FILE: 18_Bullseye/rust/src/lib.rs type Config (line 10) | pub struct Config { method new (line 15) | pub fn new() -> Result> { type Player (line 44) | pub struct Player { method from (line 49) | fn from(name: &str) -> Player { function run (line 55) | pub fn run(config: &mut Config) -> Result<(), Box> { function get_string_from_user_input (line 153) | fn get_string_from_user_input(prompt: &str) -> Result(prompt: &str,... FILE: 18_Bullseye/rust/src/main.rs function main (line 15) | fn main() { function welcome (line 36) | fn welcome() { FILE: 19_Bunny/csharp/BasicData.cs class BasicData (line 9) | internal class BasicData method BasicData (line 15) | public BasicData(int[] data) method Read (line 20) | public int Read() FILE: 19_Bunny/csharp/Bunny.cs class Bunny (line 3) | internal class Bunny method Run (line 24) | public void Run() method PrintLines (line 68) | private static void PrintLines(int count) method PrintSpaces (line 73) | private static int PrintSpaces(int count) method PrintString (line 79) | public static void PrintString(int tab, string value, bool newLine = t... FILE: 19_Bunny/csharp/Program.cs class Program (line 9) | public static class Program method Main (line 11) | public static void Main() FILE: 19_Bunny/java/src/Bunny.java class Bunny (line 14) | public class Bunny { method Bunny (line 29) | public Bunny() { method process (line 36) | public void process() { method intro (line 99) | private void intro() { method addSpaces (line 111) | private String addSpaces(int spaces) { method loadData (line 136) | private ArrayList loadData() { method main (line 162) | public static void main(String[] args) { FILE: 19_Bunny/javascript/bunny.js function print (line 5) | function print(str) function tab (line 10) | function tab(space) FILE: 19_Bunny/python/bunny.py function print_intro (line 11) | def print_intro() -> None: function main (line 17) | def main() -> None: FILE: 19_Bunny/ruby/bunny-faithful.rb function main (line 42) | def main FILE: 19_Bunny/ruby/bunny-modern.rb function main (line 80) | def main function puts_centered (line 93) | def puts_centered(str) function print_bunny_text (line 100) | def print_bunny_text(text) FILE: 19_Bunny/rust/src/main.rs constant DATA (line 27) | const DATA: [i32;233] = [ function main (line 45) | fn main() { FILE: 20_Buzzword/csharp/Program.cs class Program (line 5) | class Program method Header (line 10) | static void Header() method Instructions (line 25) | static void Instructions() method Capitalize (line 53) | static string Capitalize(string input) method GeneratePhrase (line 69) | static string GeneratePhrase() method Decision (line 82) | static bool Decision() method Main (line 97) | static void Main(string[] args) FILE: 20_Buzzword/java/src/Buzzword.java class Buzzword (line 3) | public class Buzzword { method main (line 5) | public static void main(final String[] args) { FILE: 20_Buzzword/java/src/BuzzwordSupplier.java class BuzzwordSupplier (line 7) | public class BuzzwordSupplier implements Supplier { method get (line 33) | @Override FILE: 20_Buzzword/java/src/UserInterface.java class UserInterface (line 9) | public class UserInterface implements Runnable { method UserInterface (line 33) | public UserInterface(final Scanner input, method run (line 41) | @Override FILE: 20_Buzzword/javascript/buzzword.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 59) | async function main() FILE: 20_Buzzword/python/buzzword.py function main (line 24) | def main() -> None: FILE: 20_Buzzword/rust/src/main.rs function main (line 4) | fn main() { FILE: 21_Calendar/csharp/Program.cs class Program (line 10) | class Program method Tab (line 13) | static string Tab(int numspaces) method Main (line 27) | static void Main(string[] args) FILE: 21_Calendar/java/Calendar.java class Calendar (line 13) | public class Calendar { method play (line 21) | public void play() { method showIntro (line 28) | private static void showIntro() { method startGame (line 36) | private void startGame() { method main (line 168) | public static void main(String[] args) { FILE: 21_Calendar/javascript/calendar.js function print (line 5) | function print(str) function tab (line 10) | function tab(space) FILE: 21_Calendar/python/calendar.py function parse_input (line 25) | def parse_input() -> Tuple[int, bool]: function calendar (line 67) | def calendar(weekday: int, leap_year: bool) -> None: function main (line 140) | def main() -> None: FILE: 21_Calendar/ruby/calendar.rb class Calendar (line 1) | class Calendar method parse_input (line 2) | def parse_input method start (line 47) | def start(weekday, leap_year) FILE: 21_Calendar/rust/src/main.rs constant WIDTH (line 3) | const WIDTH: usize = 64; constant DAYS_WIDTH (line 4) | const DAYS_WIDTH: usize = WIDTH / 8; constant MONTH_WIDTH (line 5) | const MONTH_WIDTH: usize = WIDTH - (DAYS_WIDTH * 2); constant DAY_NUMS_WIDTH (line 6) | const DAY_NUMS_WIDTH: usize = WIDTH / 7; constant DAYS (line 8) | const DAYS: [&str; 7] = [ function main (line 18) | fn main() { function prompt (line 36) | fn prompt() -> (String, bool) { function get_months_and_days (line 72) | fn get_months_and_days(leap_year: bool) -> (Vec<(String, u8)>, u16) { function print_between (line 111) | fn print_between(s: String, w: usize, star: bool) { function print_header (line 120) | fn print_header(month: String, days_passed: u16, days_left: u16) { function print_days (line 135) | fn print_days(current_day_index: &mut usize, days: u8) { FILE: 22_Change/csharp/Program.cs class Program (line 5) | class Program method Header (line 10) | static void Header() method GetInput (line 31) | static (bool status, double price, double payment) GetInput() method PrintChange (line 56) | static void PrintChange(double change) method Main (line 99) | static void Main(string[] args) FILE: 22_Change/java/src/Change.java class Change (line 13) | public class Change { type GAME_STATE (line 18) | private enum GAME_STATE { method Change (line 32) | public Change() { method play (line 41) | public void play() { method calculateChange (line 86) | private void calculateChange() { method intro (line 145) | private void intro() { method displayTextAndGetNumber (line 161) | private double displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 171) | private String displayTextAndGetInput(String text) { method simulateTabs (line 182) | private String simulateTabs(int spaces) { FILE: 22_Change/java/src/ChangeGame.java class ChangeGame (line 1) | public class ChangeGame { method main (line 2) | public static void main(String[] args) { FILE: 22_Change/javascript/change.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 22_Change/python/change.py function print_centered (line 12) | def print_centered(msg: str) -> None: function print_header (line 17) | def print_header(title: str) -> None: function print_introduction (line 22) | def print_introduction() -> None: function pennies_to_dollar_string (line 27) | def pennies_to_dollar_string(p: float) -> str: function compute_change (line 32) | def compute_change() -> None: function main (line 91) | def main() -> None: FILE: 22_Change/rust/src/main.rs function main (line 3) | fn main() { function welcome (line 112) | fn welcome() { function get_dollar_value_in_cents_from_user (line 119) | fn get_dollar_value_in_cents_from_user(prompt:&str) -> i16 { FILE: 23_Checkers/javascript/checkers.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function try_computer (line 47) | function try_computer() function eval_move (line 69) | function eval_move() function more_captures (line 101) | function more_captures() { function main (line 122) | async function main() FILE: 23_Checkers/python/checkers.py class MoveRecord (line 25) | class MoveRecord(NamedTuple): function print_centered (line 33) | def print_centered(msg: str) -> None: function print_header (line 38) | def print_header(title: str) -> None: function get_coordinates (line 43) | def get_coordinates(prompt: str) -> Tuple[int, int]: function is_legal_board_coordinate (line 61) | def is_legal_board_coordinate(x: int, y: int) -> bool: class Board (line 65) | class Board: method __init__ (line 66) | def __init__(self) -> None: method __str__ (line 78) | def __str__(self) -> str: method get_spaces (line 98) | def get_spaces(self) -> Iterator[Tuple[int, int]]: method get_spaces_with_computer_pieces (line 103) | def get_spaces_with_computer_pieces(self) -> Iterator[Tuple[int, int]]: method get_spaces_with_human_pieces (line 109) | def get_spaces_with_human_pieces(self) -> Iterator[Tuple[int, int]]: method get_legal_deltas_for_space (line 115) | def get_legal_deltas_for_space(self, x: int, y: int) -> Iterator[Tuple... method get_legal_moves (line 124) | def get_legal_moves(self, x: int, y: int) -> Iterator[MoveRecord]: method pick_computer_move (line 131) | def pick_computer_move(self) -> Optional[MoveRecord]: method check_move (line 148) | def check_move( method evaluate_move (line 172) | def evaluate_move( method remove_r_pieces (line 208) | def remove_r_pieces(self, move_record: MoveRecord) -> None: method remove_pieces (line 216) | def remove_pieces( method play_computer_move (line 227) | def play_computer_move(self, move_record: MoveRecord) -> None: method try_extend (line 277) | def try_extend( method get_human_move (line 295) | def get_human_move(self) -> Tuple[int, int, int, int]: method get_human_extension (line 323) | def get_human_extension( method play_human_move (line 343) | def play_human_move( method check_pieces (line 352) | def check_pieces(self) -> bool: function print_instructions (line 362) | def print_instructions() -> None: function print_human_won (line 374) | def print_human_won() -> None: function print_computer_won (line 378) | def print_computer_won() -> None: function play_game (line 382) | def play_game() -> None: function main (line 409) | def main() -> None: FILE: 23_Checkers/ruby/checkers.rb function main (line 70) | def main function game_loop (line 106) | def game_loop(board) function my_turn (line 121) | def my_turn(board, jumpStart = nil) function players_turn (line 169) | def players_turn(board) function get_player_move (line 202) | def get_player_move(board, jumpFrom = nil) function read_coord (line 232) | def read_coord(prompt) function confirm_quit (line 249) | def confirm_quit function parse_coord (line 260) | def parse_coord(coord) class Board (line 292) | class Board method initialize (line 295) | def initialize method [] (line 313) | def [](coord) method []= (line 318) | def []=(coord, value) method text (line 330) | def text(indent = BOARD_TEXT_INDENT) method mine_at? (line 349) | def mine_at?(coord) method king_at? (line 353) | def king_at?(coord) method opponent_at? (line 357) | def opponent_at?(coord) method empty_at? (line 361) | def empty_at?(coord) method all_coords (line 366) | def all_coords method my_pieces (line 378) | def my_pieces method all_coords (line 386) | def all_coords method legal_move? (line 401) | def legal_move?(is_me, move) method make_move! (line 433) | def make_move!(move) method bestMoveFrom (line 455) | def bestMoveFrom(coord, mustJump) method ratedMove (line 484) | def ratedMove(from, to) class Coord (line 526) | class Coord method initialize (line 532) | def initialize(x, y) method valid? (line 537) | def valid? method == (line 542) | def ==(other) method to_s (line 547) | def to_s method by (line 553) | def by(x, y) class Move (line 566) | class Move method initialize (line 572) | def initialize(from, to, rating = -99) method invalid (line 581) | def self.invalid method valid? (line 587) | def valid? method jump? (line 603) | def jump? method midpoint (line 609) | def midpoint method betterOf (line 616) | def betterOf(otherMove) method to_s (line 622) | def to_s method delta (line 635) | def delta method magnitude (line 641) | def magnitude FILE: 24_Chemist/java/src/Chemist.java class Chemist (line 13) | public class Chemist { type GAME_STATE (line 20) | private enum GAME_STATE { method Chemist (line 33) | public Chemist() { method play (line 42) | public void play() { method intro (line 98) | private void intro() { method displayTextAndGetNumber (line 117) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 127) | private String displayTextAndGetInput(String text) { method simulateTabs (line 138) | private String simulateTabs(int spaces) { FILE: 24_Chemist/java/src/ChemistGame.java class ChemistGame (line 1) | public class ChemistGame { method main (line 2) | public static void main(String[] args) { FILE: 24_Chemist/javascript/chemist.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 24_Chemist/python/chemist.py function play_scenario (line 14) | def play_scenario() -> bool: function show_failure (line 37) | def show_failure() -> None: function show_success (line 42) | def show_success() -> None: function show_ending (line 46) | def show_ending() -> None: function main (line 51) | def main() -> None: FILE: 24_Chemist/rust/src/lib.rs type Config (line 12) | pub struct Config { method new (line 16) | pub fn new() -> Result> { function run (line 27) | pub fn run(_config: &Config) -> Result<(), Box> { function get_string_from_user_input (line 89) | fn get_string_from_user_input(prompt: &str) -> Result(prompt: &str,... FILE: 24_Chemist/rust/src/main.rs function main (line 12) | fn main() { function welcome (line 33) | fn welcome() { FILE: 25_Chief/csharp/Game.cs class Game (line 5) | internal class Game method Game (line 9) | public Game(IReadWrite io) method Play (line 14) | internal void Play() method DoIntroduction (line 39) | private void DoIntroduction() FILE: 25_Chief/csharp/IReadWriteExtensions.cs class IReadWriteExtensions (line 3) | internal static class IReadWriteExtensions method ReadYes (line 5) | internal static bool ReadYes(this IReadWrite io, string format, Number... method ReadYes (line 7) | internal static bool ReadYes(this IReadWrite io, string prompt) => FILE: 25_Chief/csharp/Math.cs class Math (line 5) | public static class Math method CalculateOriginal (line 7) | public static float CalculateOriginal(float result) => (result + 1 - 5... method ShowWorking (line 9) | public static string ShowWorking(Number value) => FILE: 25_Chief/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Formats (line 17) | internal static class Formats class Prompts (line 23) | internal static class Prompts method GetString (line 31) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 38) | private static Stream GetStream([CallerMemberName] string? name = null) FILE: 25_Chief/java/src/Chief.java class Chief (line 13) | public class Chief { type GAME_STATE (line 15) | private enum GAME_STATE { method Chief (line 32) | public Chief() { method play (line 43) | public void play() { method tabbedSpaces (line 142) | private String tabbedSpaces(int spaces) { method instructions (line 148) | private void instructions() { method intro (line 156) | private void intro() { method yesEntered (line 170) | private boolean yesEntered(String text) { method stringIsAnyValue (line 182) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 201) | private String displayTextAndGetInput(String text) { FILE: 25_Chief/java/src/ChiefGame.java class ChiefGame (line 1) | public class ChiefGame { method main (line 3) | public static void main(String[] args) { FILE: 25_Chief/javascript/chief.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 25_Chief/python/chief.py function print_lightning_bolt (line 1) | def print_lightning_bolt() -> None: function print_solution (line 19) | def print_solution(n: float) -> None: function game (line 28) | def game() -> None: FILE: 25_Chief/ruby/chief.rb function tab (line 1) | def tab(size) function input (line 10) | def input function bye (line 14) | def bye function main (line 18) | def main FILE: 25_Chief/rust/src/main.rs function print_center (line 3) | fn print_center(text: String, width: usize) { function send_lightening (line 12) | fn send_lightening() { function check_yes_answer (line 47) | fn check_yes_answer() -> bool { function main (line 58) | fn main() { FILE: 26_Chomp/csharp/Cookie.cs class Cookie (line 5) | internal class Cookie method Cookie (line 11) | public Cookie(int rowCount, int columnCount) method TryChomp (line 26) | public bool TryChomp(int row, int column, out char chomped) method ToString (line 47) | public override string ToString() FILE: 26_Chomp/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 7) | public Game(IReadWrite io) method Play (line 12) | internal void Play() method Play (line 34) | private PlayerNumber Play(Cookie cookie, PlayerNumber player) method Chomp (line 48) | private bool Chomp(Cookie cookie, PlayerNumber player) FILE: 26_Chomp/csharp/IOExtensions.cs class IOExtensions (line 3) | internal static class IOExtensions method ReadParameters (line 5) | public static (float, int, int) ReadParameters(this IReadWrite io) method ReadNumberWithMax (line 12) | private static int ReadNumberWithMax(this IReadWrite io, string initia... FILE: 26_Chomp/csharp/PlayerNumber.cs class PlayerNumber (line 3) | internal class PlayerNumber method PlayerNumber (line 10) | public PlayerNumber(float playerCount) method Increment (line 19) | private PlayerNumber Increment() method ToString (line 31) | public override string ToString() => (_number >= 0 ? " " : "") + _numb... FILE: 26_Chomp/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Formats (line 16) | internal static class Formats class Prompts (line 22) | internal static class Prompts class Strings (line 31) | internal static class Strings method GetString (line 37) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 45) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 26_Chomp/java/Chomp.java class Chomp (line 2) | public class Chomp{ method Chomp (line 8) | Chomp(){ method startGame (line 27) | private void startGame(){ method printBoard (line 67) | private void printBoard(){ method move (line 89) | private void move(int player){ method main (line 154) | public static void main(String []args){ FILE: 26_Chomp/javascript/chomp.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function init_board (line 49) | function init_board() function show_board (line 57) | function show_board() function main (line 77) | async function main() FILE: 26_Chomp/python/chomp.py class Canvas (line 10) | class Canvas: method __init__ (line 13) | def __init__(self, width=9, height=9, fill="*") -> None: method render (line 20) | def render(self) -> str: method chomp (line 28) | def chomp(self, r, c) -> str: function play_game (line 42) | def play_game() -> None: function main (line 109) | def main() -> None: FILE: 27_Civil_War/csharp/Army.cs class Army (line 7) | public class Army type Resource (line 9) | private enum Resource method Army (line 16) | public Army(Side side) method PrepareBattle (line 63) | public void PrepareBattle(int men, int casualties) method AllocateResources (line 73) | public virtual void AllocateResources() method EnterResource (line 89) | private bool EnterResource(Resource resource) method DisplayMorale (line 115) | public virtual void DisplayMorale() method ChooseStrategy (line 120) | public virtual bool ChooseStrategy(bool isReplay) => EnterStrategy(tru... method EnterStrategy (line 122) | protected bool EnterStrategy(bool canSurrender, string hint) method CalculateLosses (line 146) | public virtual void CalculateLosses(Army opponent) method RecordResult (line 162) | public void RecordResult(Side winner) method LearnStrategy (line 180) | protected virtual void LearnStrategy() { } method DisplayWarResult (line 182) | public void DisplayWarResult(Army opponent) method DisplayStrategies (line 195) | public virtual void DisplayStrategies() { } class ComputerArmy (line 198) | class ComputerArmy : Army method ComputerArmy (line 203) | public ComputerArmy(Side side) : base(side) { } method AllocateResources (line 207) | public override void AllocateResources() { } method DisplayMorale (line 209) | public override void DisplayMorale() { } method ChooseStrategy (line 211) | public override bool ChooseStrategy(bool isReplay) method LearnStrategy (line 232) | protected override void LearnStrategy() method CalculateLosses (line 249) | public override void CalculateLosses(Army opponent) method DisplayStrategies (line 255) | public override void DisplayStrategies() FILE: 27_Civil_War/csharp/Battle.cs type Side (line 6) | public enum Side { Confederate, Union, Both } type Option (line 7) | public enum Option { Battle, Replay, Quit } type Battle (line 9) | public record Battle(string Name, int[] Men, int[] Casualties, Side Offe... FILE: 27_Civil_War/csharp/ConsoleUtils.cs class ConsoleUtils (line 8) | static class ConsoleUtils method InputYesOrNo (line 10) | public static bool InputYesOrNo() method WriteWordWrap (line 28) | public static void WriteWordWrap(string text) method WriteTable (line 52) | public static void WriteTable(ICollection items, List(string Name, Func Data, string Be... FILE: 27_Civil_War/csharp/GameOptions.cs type GameOptions (line 7) | public record GameOptions(bool TwoPlayers, bool ShowDescriptions) FILE: 27_Civil_War/java/src/CivilWar.java class CivilWar (line 11) | @SuppressWarnings("SpellCheckingInspection") method main (line 49) | public static void main(String[] args) { method gameLoop (line 64) | private void gameLoop() { method startBattle (line 116) | private BattleState startBattle() { method getUnionTroops (line 233) | private int getUnionTroops(HistoricalDatum battle) { method getConfedTroops (line 237) | private int getConfedTroops(HistoricalDatum battle) { method moraleForArmy (line 241) | private String moraleForArmy(BattleState battleState, int armyIdx) { type OffensiveStatus (line 267) | private enum OffensiveStatus { method OffensiveStatus (line 272) | OffensiveStatus(String label) { method offensiveLogic (line 277) | private void offensiveLogic(HistoricalDatum battle) { method simulateUnionLosses (line 308) | private UnionLosses simulateUnionLosses(HistoricalDatum battle) { method calcLosses (line 325) | private void calcLosses(BattleState battle) { method reset (line 412) | private void reset() { method complete (line 419) | private void complete() { method findWinner (line 455) | private Winner findWinner(double confLosses, double unionLosses) { type Winner (line 475) | private enum Winner { method unionStrategy (line 479) | private void unionStrategy() { method CivilWar (line 509) | public CivilWar(PrintStream out) { method showCredits (line 547) | private void showCredits() { method updateStrategies (line 555) | private void updateStrategies(int strategy) { method showHelp (line 575) | private void showHelp() { method rightAlignInt (line 605) | private String rightAlignInt(int number) { method rightAlignInt (line 610) | private String rightAlignInt(double number) { method inputString (line 614) | private static String inputString(Predicate validator, String ... method inputInt (line 628) | private static int inputInt(Predicate validator, Function { method ArmyPair (line 671) | public ArmyPair(T confederate, T union) { class BattleResults (line 677) | private static class BattleResults { method getTotal (line 682) | public int getTotal() { class ArmyResources (line 687) | private static class ArmyResources { method getTotal (line 695) | public int getTotal() { FILE: 27_Civil_War/javascript/civilwar.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 71) | async function main() FILE: 27_Civil_War/python/Civilwar.py class AttackState (line 12) | class AttackState(enum.Enum): class PlayerStat (line 23) | class PlayerStat: method set_available_money (line 48) | def set_available_money(self): method get_cost (line 54) | def get_cost(self) -> float: method get_army_factor (line 57) | def get_army_factor(self) -> float: method get_present_men (line 60) | def get_present_men(self) -> float: function simulate_losses (line 64) | def simulate_losses(player1: PlayerStat, player2: PlayerStat) -> float: function update_army (line 73) | def update_army(player: PlayerStat, enemy: PlayerStat, use_factor=False)... function get_choice (line 91) | def get_choice(prompt: str, choices: List[str]) -> str: function get_morale (line 99) | def get_morale(stat: PlayerStat, enemy: PlayerStat) -> float: function main (line 107) | def main() -> None: FILE: 28_Combat/csharp/ArmedForces.cs type ArmedForces (line 8) | public record ArmedForces FILE: 28_Combat/csharp/Ceasefire.cs class Ceasefire (line 8) | public sealed class Ceasefire : WarState method Ceasefire (line 45) | public Ceasefire(ArmedForces computerForces, ArmedForces playerForces,... method AttackWithArmy (line 51) | protected override (WarState nextState, string message) AttackWithArmy... method AttackWithNavy (line 54) | protected override (WarState nextState, string message) AttackWithNavy... method AttackWithAirForce (line 57) | protected override (WarState nextState, string message) AttackWithAirF... FILE: 28_Combat/csharp/Controller.cs class Controller (line 8) | public class Controller method GetInitialForces (line 16) | public static ArmedForces GetInitialForces(ArmedForces computerForces) method GetAttackBranch (line 50) | public static MilitaryBranch GetAttackBranch(WarState state, bool isFi... method GetAttackSize (line 75) | public static int GetAttackSize(int troopsAvailable) method InputInteger (line 92) | public static int InputInteger() FILE: 28_Combat/csharp/FinalCampaign.cs class FinalCampaign (line 6) | public sealed class FinalCampaign : WarState method FinalCampaign (line 17) | public FinalCampaign(ArmedForces computerForces, ArmedForces playerFor... method AttackWithArmy (line 22) | protected override (WarState nextState, string message) AttackWithArmy... method AttackWithNavy (line 52) | protected override (WarState nextState, string message) AttackWithNavy... method AttackWithAirForce (line 86) | protected override (WarState nextState, string message) AttackWithAirF... FILE: 28_Combat/csharp/InitialCampaign.cs class InitialCampaign (line 6) | public sealed class InitialCampaign : WarState method InitialCampaign (line 17) | public InitialCampaign(ArmedForces computerForces, ArmedForces playerF... method AttackWithArmy (line 22) | protected override (WarState nextState, string message) AttackWithArmy... method AttackWithNavy (line 83) | protected override (WarState nextState, string message) AttackWithNavy... method AttackWithAirForce (line 132) | protected override (WarState nextState, string message) AttackWithAirF... FILE: 28_Combat/csharp/MilitaryBranch.cs type MilitaryBranch (line 6) | public enum MilitaryBranch FILE: 28_Combat/csharp/Program.cs class Program (line 3) | class Program method Main (line 5) | static void Main() FILE: 28_Combat/csharp/View.cs class View (line 8) | public static class View method ShowBanner (line 10) | public static void ShowBanner() method ShowInstructions (line 16) | public static void ShowInstructions() method ShowDistributeForces (line 25) | public static void ShowDistributeForces() method ShowMessage (line 32) | public static void ShowMessage(string message) method ShowResult (line 37) | public static void ShowResult(WarState finalState) method PromptArmySize (line 61) | public static void PromptArmySize(int computerArmySize) method PromptNavySize (line 66) | public static void PromptNavySize(int computerNavySize) method PromptAirForceSize (line 71) | public static void PromptAirForceSize(int computerAirForceSize) method PromptFirstAttackBranch (line 76) | public static void PromptFirstAttackBranch() method PromptNextAttackBranch (line 83) | public static void PromptNextAttackBranch(ArmedForces computerForces, ... method PromptAttackSize (line 99) | public static void PromptAttackSize() method PromptValidInteger (line 105) | public static void PromptValidInteger() FILE: 28_Combat/csharp/WarResult.cs type WarResult (line 6) | public enum WarResult FILE: 28_Combat/csharp/WarState.cs class WarState (line 8) | public abstract class WarState method WarState (line 43) | public WarState(ArmedForces computerForces, ArmedForces playerForces) => method LaunchAttack (line 59) | public (WarState nextState, string message) LaunchAttack(MilitaryBranc... method AttackWithArmy (line 77) | protected abstract (WarState nextState, string message) AttackWithArmy... method AttackWithNavy (line 88) | protected abstract (WarState nextState, string message) AttackWithNavy... method AttackWithAirForce (line 99) | protected abstract (WarState nextState, string message) AttackWithAirF... FILE: 28_Combat/java/Combat.java class Combat (line 16) | public class Combat { method Combat (line 31) | public Combat() { method play (line 37) | public void play() { method showIntro (line 46) | private static void showIntro() { method getForces (line 56) | private void getForces() { method attackFirst (line 72) | private void attackFirst() { method attackSecond (line 159) | private void attackSecond() { method main (line 261) | public static void main(String[] args) { FILE: 28_Combat/javascript/combat.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 28_Combat/python/combat.py function show_intro (line 11) | def show_intro() -> None: function get_forces (line 21) | def get_forces() -> None: function attack_first (line 37) | def attack_first() -> None: function attack_second (line 108) | def attack_second() -> None: function main (line 189) | def main() -> None: FILE: 29_Craps/csharp/Craps/CrapsGame.cs type Result (line 3) | public enum Result class CrapsGame (line 16) | class CrapsGame method CrapsGame (line 22) | public CrapsGame(ref UserInterface ui) method Play (line 27) | public Result Play(out int diceRoll) method Lose (line 63) | private bool Lose(int diceRoll) method Win (line 68) | private bool Win(int diceRoll) FILE: 29_Craps/csharp/Craps/Dice.cs class Dice (line 6) | public class Dice method Dice (line 11) | public Dice() method Dice (line 16) | public Dice(int sides) method Roll (line 21) | public int Roll() => rand.Next(1, sides + 1); FILE: 29_Craps/csharp/Craps/Program.cs class Program (line 7) | class Program method Main (line 9) | static void Main(string[] args) FILE: 29_Craps/csharp/Craps/UserInterface.cs class UserInterface (line 8) | public class UserInterface method Intro (line 10) | public void Intro() method PlaceBet (line 29) | public int PlaceBet() method PlayAgain (line 38) | public bool PlayAgain(int winnings) method GoodBye (line 62) | public void GoodBye(int winnings) method NoPoint (line 78) | public void NoPoint(int diceRoll) method Point (line 83) | public void Point(int point) method ShowResult (line 88) | public void ShowResult(Result result, int diceRoll, int bet) method GetInt (line 125) | private int GetInt() FILE: 29_Craps/csharp/CrapsTester/CrapsTests.cs class DiceTests (line 8) | [TestClass] method SixSidedDiceReturnsValidRolls (line 11) | [TestMethod] method TwentySidedDiceReturnsValidRolls (line 22) | [TestMethod] method DiceRollsAreRandom (line 33) | [TestMethod] FILE: 29_Craps/java/src/Craps.java class Craps (line 7) | public class Craps { method main (line 10) | public static void main(String[] args) { method playCraps (line 25) | public static double playCraps(double winnings) { method rollDice (line 37) | public static int rollDice() { method setPoint (line 41) | private static double setPoint(int point, double wager) { method makePoint (line 46) | private static double makePoint(int point, double wager) { method win (line 56) | private static double win(int roll, double wager) { method lose (line 64) | private static double lose(int roll, double wager) { method naturalWin (line 71) | public static double naturalWin(int roll, double wager) { method winningsUpdate (line 77) | public static void winningsUpdate(double winnings) { method winningsReport (line 85) | public static void winningsReport(double winnings) { method stillInterested (line 95) | public static boolean stillInterested(double winnings) { method getWager (line 102) | public static double getWager() { method getInput (line 107) | public static double getInput() { FILE: 29_Craps/javascript/craps.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function roll (line 45) | function roll() function main (line 51) | async function main() FILE: 29_Craps/python/craps.py function throw_dice (line 17) | def throw_dice() -> int: function main (line 21) | def main() -> None: FILE: 29_Craps/ruby/craps.rb class CRAPSGAME (line 1) | class CRAPSGAME method displayHeading (line 6) | def displayHeading method displayStanding (line 15) | def displayStanding method rollDice (line 30) | def rollDice method placeBet (line 35) | def placeBet method loseBetBy (line 41) | def loseBetBy amount method winBetBy (line 45) | def winBetBy amount method askQuit? (line 49) | def askQuit? method pointRoll (line 56) | def pointRoll point, wager method play (line 82) | def play method endPlay (line 110) | def endPlay FILE: 29_Craps/rust/src/craps_game.rs type GameState (line 3) | enum GameState { type CrapsGame (line 9) | pub struct CrapsGame { method new (line 17) | pub fn new() -> Self { method tick (line 28) | pub fn tick(&mut self) -> bool { method point_roll (line 38) | fn point_roll(&mut self) -> bool { method new_round (line 55) | fn new_round(&mut self) -> bool { method player_win (line 88) | fn player_win(&mut self) { method player_lose (line 99) | fn player_lose(&mut self) { method print_wallet (line 114) | fn print_wallet(&self) { method roll (line 118) | fn roll() -> u8 { method game_over (line 127) | fn game_over(&mut self) { method prompt_roll (line 131) | fn prompt_roll(&mut self) { FILE: 29_Craps/rust/src/main.rs function main (line 5) | fn main() { FILE: 29_Craps/rust/src/util.rs type Response (line 3) | pub enum Response { function read_line (line 8) | pub fn read_line() -> String { function read_numeric (line 18) | pub fn read_numeric(message: &str) -> usize { function prompt (line 47) | pub fn prompt(msg: &str) -> Response { FILE: 30_Cube/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 16) | public Game(IReadWrite io, IRandom random) method Play (line 22) | public void Play() method PlaySeries (line 36) | private void PlaySeries(float balance) method PlayGame (line 59) | private bool PlayGame() method Lose (line 81) | private bool Lose(Stream text) method Win (line 87) | private bool Win(Stream text) method MoveIsLegal (line 93) | private bool MoveIsLegal((float, float, float) from, (float, float, fl... FILE: 30_Cube/csharp/IOExtensions.cs class IOExtensions (line 3) | internal static class IOExtensions method ReadWager (line 5) | internal static float? ReadWager(this IReadWrite io, float balance) FILE: 30_Cube/csharp/RandomExtensions.cs class RandomExtensions (line 3) | internal static class RandomExtensions method NextLocation (line 5) | internal static (float, float, float) NextLocation(this IRandom random... method NextCoordinate (line 8) | private static float NextCoordinate(this IRandom random, int bias) FILE: 30_Cube/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Prompts (line 20) | internal static class Prompts class Formats (line 29) | internal static class Formats method GetString (line 34) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 41) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 30_Cube/csharp/ZerosGenerator.cs class ZerosGenerator (line 3) | internal class ZerosGenerator : IRandom method NextFloat (line 5) | public float NextFloat() => 0; method PreviousFloat (line 7) | public float PreviousFloat() => 0; method Reseed (line 9) | public void Reseed(int seed) { } FILE: 30_Cube/java/src/Cube.java class Cube (line 15) | public class Cube { method main (line 34) | public static void main(String[] args) { method Cube (line 38) | public Cube() { method placeMines (line 48) | private void placeMines() { method play (line 62) | public void play() { method doAnotherRound (line 130) | private boolean doAnotherRound() { method printInstructions (line 142) | public void printInstructions() { method readParsedBoolean (line 172) | private boolean readParsedBoolean() { method isMoveValid (line 187) | private boolean isMoveValid(Location from, Location to) { class Location (line 191) | public class Location { method Location (line 194) | public Location(int x, int y, int z) { method equals (line 203) | @Override method hashCode (line 218) | @Override FILE: 30_Cube/javascript/cube.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 30_Cube/python/cube.py function mine_position (line 13) | def mine_position() -> Tuple[int, int, int]: function parse_move (line 17) | def parse_move(move: str) -> Tuple[int, int, int]: function play_game (line 24) | def play_game() -> None: function print_instructions (line 97) | def print_instructions() -> None: function main (line 118) | def main() -> None: FILE: 30_Cube/ruby/cube.rb function getYesOrNoResponseTo (line 7) | def getYesOrNoResponseTo prompt function greeting (line 14) | def greeting function landMindStringFrom (line 46) | def landMindStringFrom x, y, z function assignLandMines (line 51) | def assignLandMines function initializePot (line 68) | def initializePot function startGame (line 72) | def startGame function goodbye (line 95) | def goodbye function bust (line 102) | def bust function tryAgain (line 107) | def tryAgain function isLegalMove? (line 114) | def isLegalMove? newLocation function displayStandings (line 176) | def displayStandings function didWin? (line 185) | def didWin? location function youWin (line 189) | def youWin amount function youLose (line 200) | def youLose amount function landMine (line 217) | def landMine betAmount function gameLoop (line 223) | def gameLoop betAmount FILE: 30_Cube/rust/src/game.rs type Position (line 3) | pub type Position = (u8, u8, u8); type Game (line 5) | pub struct Game { method new (line 13) | pub fn new() -> Self { method play (line 22) | pub fn play(&mut self) -> bool { method get_bet (line 66) | fn get_bet(&self) -> Option { method ask_position (line 82) | fn ask_position(&self, msg: &str) -> (bool, Position) { method calculate_wallet (line 89) | fn calculate_wallet(&mut self, win: bool) { method reset_game (line 101) | fn reset_game(&mut self) { FILE: 30_Cube/rust/src/main.rs function main (line 6) | fn main() { FILE: 30_Cube/rust/src/util.rs function get_random_position (line 5) | pub fn get_random_position() -> Position { function get_random_axis (line 9) | fn get_random_axis() -> u8 { function get_landmines (line 13) | pub fn get_landmines() -> Vec { function read_line (line 27) | fn read_line() -> Result { function prompt_bool (line 35) | pub fn prompt_bool(msg: &str) -> bool { function prompt_number (line 50) | pub fn prompt_number(msg: &str) -> usize { function prompt_position (line 61) | pub fn prompt_position(msg: &str, prev_pos: Position) -> Option { FILE: 31_Depth_Charge/csharp/Controller.cs class Controller (line 8) | static class Controller method InputDimension (line 18) | public static int InputDimension() method InputCoordinates (line 40) | public static (int x, int y, int depth) InputCoordinates(int trailNumber) method InputPlayAgain (line 66) | public static bool InputPlayAgain() FILE: 31_Depth_Charge/csharp/Program.cs class Program (line 5) | class Program method Main (line 7) | static void Main(string[] args) FILE: 31_Depth_Charge/csharp/View.cs class View (line 8) | static class View method ShowBanner (line 10) | public static void ShowBanner() method ShowInstructions (line 19) | public static void ShowInstructions(int maximumGuesses) method ShowStartGame (line 30) | public static void ShowStartGame() method ShowGuessPlacement (line 36) | public static void ShowGuessPlacement((int x, int y, int depth) actual... method ShowGameResult (line 59) | public static void ShowGameResult((int x, int y, int depth) submarineL... method ShowFarewell (line 74) | public static void ShowFarewell() method ShowInvalidNumber (line 79) | public static void ShowInvalidNumber() method ShowInvalidDimension (line 84) | public static void ShowInvalidDimension() method ShowTooFewCoordinates (line 89) | public static void ShowTooFewCoordinates() method ShowTooManyCoordinates (line 94) | public static void ShowTooManyCoordinates() method ShowInvalidYesOrNo (line 99) | public static void ShowInvalidYesOrNo() method PromptDimension (line 104) | public static void PromptDimension() method PromptGuess (line 109) | public static void PromptGuess(int trailNumber) method PromptPlayAgain (line 115) | public static void PromptPlayAgain() FILE: 31_Depth_Charge/java/DepthCharge.java class DepthCharge (line 16) | public class DepthCharge { method DepthCharge (line 20) | public DepthCharge() { method play (line 26) | public void play() { method showIntro (line 33) | private static void showIntro() { method startGame (line 41) | private void startGame() { method getReport (line 132) | public void getReport(int a, int b, int c, int x, int y, int z) { method main (line 179) | public static void main(String[] args) { FILE: 31_Depth_Charge/javascript/depthcharge.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 31_Depth_Charge/python/depth_charge.py function show_welcome (line 13) | def show_welcome() -> None: function get_num_charges (line 24) | def get_num_charges() -> Tuple[int, int]: function ask_for_new_game (line 40) | def ask_for_new_game() -> None: function show_shot_result (line 49) | def show_shot_result(shot, location) -> None: function get_shot_input (line 72) | def get_shot_input() -> Tuple[int, int, int]: function play_game (line 88) | def play_game(search_area, num_charges) -> None: function main (line 117) | def main() -> None: FILE: 31_Depth_Charge/ruby/depthcharge.rb class DepthCharge (line 3) | class DepthCharge method run_game (line 4) | def run_game method output_title (line 19) | def output_title method get_input_y_or_n (line 25) | def get_input_y_or_n(message) method get_input_positive_integer (line 42) | def get_input_positive_integer(message) method print_instructions (line 64) | def print_instructions method debug_game (line 84) | def debug_game method setup_game (line 93) | def setup_game method setup_enemy (line 100) | def setup_enemy method game_loop (line 106) | def game_loop method output_game_status (line 132) | def output_game_status method you_win (line 137) | def you_win method missed_shot (line 142) | def missed_shot method you_lose (line 167) | def you_lose method get_input_another_game (line 172) | def get_input_another_game FILE: 31_Depth_Charge/rust/src/main.rs function input (line 12) | fn input(msg: &str) -> String { function main (line 20) | fn main() { function subroutine (line 122) | fn subroutine(x: i32, y: i32, z:i32, a:i32, b:i32, c:i32) { function replay (line 134) | fn replay() -> bool { FILE: 32_Diamond/csharp/Pattern.cs class Pattern (line 6) | internal class Pattern method Pattern (line 10) | public Pattern(IReadWrite io) method Draw (line 16) | public void Draw() method GetDiamondLines (line 39) | public static IEnumerable GetDiamondLines(float size) FILE: 32_Diamond/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Prompts (line 13) | internal static class Prompts method GetString (line 18) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 26) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 32_Diamond/csharp/StringBuilderExtensions.cs class StringBuilderExtensions (line 5) | internal static class StringBuilderExtensions method PadToLength (line 7) | internal static StringBuilder PadToLength(this StringBuilder builder, ... FILE: 32_Diamond/java/Diamond.java class Diamond (line 15) | public class Diamond { method Diamond (line 26) | public Diamond() { method play (line 33) | public void play() { method showIntro (line 41) | private void showIntro() { method startGame (line 50) | private void startGame() { method main (line 156) | public static void main(String[] args) { FILE: 32_Diamond/javascript/diamond.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 32_Diamond/python/diamond.py function print_diamond (line 10) | def print_diamond(begin_width, end_width, step, width, count) -> None: function main (line 29) | def main() -> None: FILE: 32_Diamond/ruby/diamond.rb function intro (line 1) | def intro function get_facets (line 11) | def get_facets function get_diamond_lines (line 20) | def get_diamond_lines(facets) function draw_diamonds (line 30) | def draw_diamonds(lines) function main (line 35) | def main FILE: 32_Diamond/rust/src/lib.rs type Config (line 8) | pub struct Config { method new (line 13) | pub fn new() -> Result> { function run (line 42) | pub fn run(config: &Config) -> Result<(), Box> { function print_diamond_line (line 68) | fn print_diamond_line(diamond_width: isize,row: isize, line_width:isize... function n_chars (line 100) | fn n_chars(n:isize, character: char) -> String { function get_string_from_user_input (line 112) | fn get_string_from_user_input(prompt: &str) -> Result(prompt: &str,... FILE: 32_Diamond/rust/src/main.rs function main (line 12) | fn main() { function welcome (line 33) | fn welcome() { FILE: 33_Dice/csharp/Game.cs class Game (line 6) | public class Game method GameLoop (line 10) | public void GameLoop() method DisplayIntroText (line 24) | private void DisplayIntroText() method GetInput (line 48) | private int GetInput() method DisplayCounts (line 61) | private void DisplayCounts(int[] counter) method CountRolls (line 74) | private int[] CountRolls(int x) method TryAgain (line 87) | private bool TryAgain() FILE: 33_Dice/csharp/Program.cs class Program (line 3) | public class Program method Main (line 5) | public static void Main(string[] args) FILE: 33_Dice/csharp/RollGenerator.cs class RollGenerator (line 6) | public class RollGenerator method ReseedRNG (line 10) | public static void ReseedRNG(int seed) => _rnd = new Random(seed); method Rolls (line 12) | public IEnumerable<(int die1, int die2)> Rolls() FILE: 33_Dice/java/src/Dice.java class Dice (line 13) | public class Dice { type GAME_STATE (line 18) | private enum GAME_STATE { method Dice (line 30) | public Dice() { method play (line 39) | public void play() { method intro (line 78) | private void intro() { method displayTextAndGetNumber (line 96) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 106) | private String displayTextAndGetInput(String text) { method yesEntered (line 117) | private boolean yesEntered(String text) { method stringIsAnyValue (line 130) | private boolean stringIsAnyValue(String text, String... values) { method simulateTabs (line 141) | private String simulateTabs(int spaces) { FILE: 33_Dice/java/src/DiceGame.java class DiceGame (line 1) | public class DiceGame { method main (line 2) | public static void main(String[] args) { FILE: 33_Dice/javascript/dice.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 33_Dice/python/dice.py function main (line 29) | def main() -> None: FILE: 33_Dice/ruby/dice.rb function intro (line 1) | def intro function get_rolls (line 16) | def get_rolls function dice_roll (line 25) | def dice_roll = rand(6) + 1 function print_rolls (line 27) | def print_rolls(rolls) function main (line 34) | def main FILE: 33_Dice/rust/src/main.rs function main (line 31) | fn main() { function readinput (line 77) | fn readinput(str: &str) -> String { FILE: 34_Digits/csharp/Game.cs class GameSeries (line 3) | internal class GameSeries method GameSeries (line 10) | public GameSeries(IReadWrite io, IRandom random) method Play (line 16) | internal void Play() class Game (line 34) | internal class Game method Game (line 39) | public Game(IReadWrite io, IRandom random) method Play (line 45) | public void Play() method GuessDigits (line 64) | private int GuessDigits(IEnumerable digits, int correctGuesses) FILE: 34_Digits/csharp/Guesser.cs class Guesser (line 3) | internal class Guesser method Guesser (line 8) | public Guesser(IRandom random) method GuessNextDigit (line 13) | public int GuessNextDigit() method ObserveActualDigit (line 31) | public void ObserveActualDigit(int digit) => _matrices.ObserveDigit(di... FILE: 34_Digits/csharp/IOExtensions.cs class IOExtensions (line 3) | internal static class IOExtensions method Read10Digits (line 5) | internal static IEnumerable Read10Digits(this IReadWrite io, stri... FILE: 34_Digits/csharp/Matrix.cs class Matrix (line 3) | internal class Matrix method Matrix (line 8) | public Matrix(int width, int weight, Func seedFactory) method GetWeightedValue (line 24) | public int GetWeightedValue(int row) => _weight * _values[Index, row]; method IncrementValue (line 26) | public int IncrementValue(int row) => _values[Index, row]++; FILE: 34_Digits/csharp/Memory.cs class Memory (line 3) | public class Memory method Memory (line 7) | public Memory() method GetWeightedSum (line 17) | public int GetWeightedSum(int row) => _matrices.Select(m => m.GetWeigh... method ObserveDigit (line 19) | public void ObserveDigit(int digit) FILE: 34_Digits/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Prompts (line 20) | internal static class Prompts class Formats (line 27) | internal static class Formats method GetString (line 32) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 40) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 34_Digits/java/Digits.java class Digits (line 10) | public class Digits { method main (line 12) | public static void main(String[] args) { method readContinueChoice (line 117) | private static boolean readContinueChoice(Scanner scan) { method read10Numbers (line 130) | private static int[] read10Numbers(Scanner scan) { method printInstructions (line 152) | private static void printInstructions() { method readInstructionChoice (line 165) | private static boolean readInstructionChoice(Scanner scan) { method printIntro (line 178) | private static void printIntro() { FILE: 34_Digits/javascript/digits.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 34_Digits/python/Digits.py function print_intro (line 5) | def print_intro() -> None: function read_instruction_choice (line 12) | def read_instruction_choice() -> bool: function print_instructions (line 21) | def print_instructions() -> None: function read_10_numbers (line 34) | def read_10_numbers() -> List[int]: function read_continue_choice (line 51) | def read_continue_choice() -> bool: function print_summary_report (line 60) | def print_summary_report(running_correct: int) -> None: function main (line 74) | def main() -> None: FILE: 35_Even_Wins/javascript/evenwins.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 49) | async function main() FILE: 35_Even_Wins/javascript/gameofevenwins.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 35_Even_Wins/python/evenwins.py class MarbleCounts (line 27) | class MarbleCounts: function print_intro (line 33) | def print_intro() -> None: function marbles_str (line 48) | def marbles_str(n: int) -> str: function choose_first_player (line 52) | def choose_first_player() -> PlayerType: function toggle_player (line 66) | def toggle_player(whose_turn: PlayerType) -> PlayerType: function to_int (line 70) | def to_int(s: str) -> Tuple[bool, int]: function print_board (line 79) | def print_board(marbles: MarbleCounts) -> None: function human_turn (line 87) | def human_turn(marbles: MarbleCounts) -> None: function game_over (line 109) | def game_over(marbles: MarbleCounts) -> None: function computer_turn (line 123) | def computer_turn(marbles: MarbleCounts) -> None: function play_game (line 144) | def play_game(whose_turn: PlayerType) -> None: function main (line 164) | def main() -> None: FILE: 35_Even_Wins/rust/src/main.rs function print_intro (line 3) | fn print_intro() { type PlayerType (line 21) | enum PlayerType { type Game (line 27) | struct Game { method get_max_take (line 37) | fn get_max_take(&mut self) -> u32 { method take (line 44) | fn take(&mut self, num: u32) -> bool { method next (line 63) | fn next(&mut self) { method info (line 70) | fn info(&mut self) { method wininfo (line 81) | fn wininfo(&mut self) { function human_play (line 98) | fn human_play(game: &mut Game) { function compute_play (line 127) | fn compute_play(game: &mut Game) { function run_game (line 156) | fn run_game(turn: PlayerType) { function choose_first_player (line 181) | fn choose_first_player() -> PlayerType { function choose_play_again (line 200) | fn choose_play_again() -> bool { function main (line 219) | fn main() { FILE: 36_Flip_Flop/java/FlipFlop.java class FlipFlop (line 16) | public class FlipFlop { type Step (line 20) | private enum Step { method FlipFlop (line 25) | public FlipFlop() { method play (line 31) | public void play() { method showIntro (line 38) | private static void showIntro() { method startGame (line 46) | private void startGame() { method main (line 280) | public static void main(String[] args) { FILE: 36_Flip_Flop/javascript/flipflop.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 36_Flip_Flop/python/flipflop.py function flip_bits (line 31) | def flip_bits( function print_instructions (line 49) | def print_instructions() -> None: function main (line 64) | def main() -> None: FILE: 36_Flip_Flop/ruby/flipflop.rb function flip_letter (line 10) | def flip_letter(letter_number) function letter_at (line 19) | def letter_at(letter_number) function print_welcome (line 24) | def print_welcome function print_starting_message (line 45) | def print_starting_message function generate_new_game (line 58) | def generate_new_game function shuffle_board (line 63) | def shuffle_board(game, index, shuffle_function) function shuffle_function1 (line 78) | def shuffle_function1(game, index) function shuffle_function2 (line 84) | def shuffle_function2(game, index) function play_game (line 90) | def play_game FILE: 36_Flip_Flop/rust/src/game.rs type Game (line 1) | pub struct Game { method new (line 9) | pub fn new() -> Self { method play (line 18) | pub fn play(&mut self) -> bool { method flip (line 70) | fn flip(&mut self, i: u8) { method get_other (line 83) | fn get_other(&self, m: u8, equals_last_move: bool) -> u8 { method draw (line 96) | fn draw(&self) { method get_number (line 104) | fn get_number() -> u8 { method reset_board (line 115) | fn reset_board(&mut self) { method reset_game (line 119) | fn reset_game(&mut self) { FILE: 36_Flip_Flop/rust/src/main.rs function main (line 4) | fn main() { FILE: 37_Football/javascript/football.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function field_headers (line 66) | function field_headers() function separator (line 73) | function separator() function show_ball (line 81) | function show_ball() function show_scores (line 87) | function show_scores() function loss_posession (line 100) | function loss_posession() { function touchdown (line 109) | function touchdown() { function main (line 124) | async function main() FILE: 37_Football/javascript/ftball.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function fnf (line 56) | function fnf(x) function fng (line 61) | function fng(z) function show_score (line 66) | function show_score() function show_position (line 74) | function show_position() function offensive_td (line 83) | function offensive_td() function main (line 99) | async function main() FILE: 37_Football/python/football.py function ask_bool (line 39) | def ask_bool(prompt: str) -> bool: function ask_int (line 48) | def ask_int(prompt: str) -> int: function get_offense_defense (line 57) | def get_offense_defense() -> Tuple[int, int]: function field_headers (line 67) | def field_headers() -> None: function separator (line 72) | def separator() -> None: function show_ball (line 76) | def show_ball() -> None: function show_scores (line 82) | def show_scores() -> bool: function loss_posession (line 93) | def loss_posession() -> None: function touchdown (line 103) | def touchdown() -> None: function print_header (line 116) | def print_header() -> None: function print_instructions (line 122) | def print_instructions() -> None: function main (line 144) | def main() -> None: FILE: 38_Fur_Trader/c/furtrader.c function printAtColumn (line 33) | void printAtColumn( int column, const char *words ) function print (line 42) | void print( const char *words ) function showIntroduction (line 48) | void showIntroduction() function getNumericInput (line 65) | int getNumericInput() function getYesOrNo (line 91) | char getYesOrNo() function getFortChoice (line 118) | int getFortChoice() function showFortComment (line 145) | void showFortComment( int which_fort ) function getFursPurchase (line 182) | void getFursPurchase( int *furs ) function zeroInventory (line 201) | void zeroInventory( int *player_fur_count ) function sumInventory (line 214) | int sumInventory( int *player_fur_count ) function randomAB (line 231) | float randomAB(float a, float b) function randFloat (line 236) | float randFloat() function main (line 248) | int main( void ) FILE: 38_Fur_Trader/csharp/Game.cs class Game (line 5) | public class Game method RandomPriceGenerator (line 18) | internal double RandomPriceGenerator(double factor, double baseline) method GameLoop (line 30) | internal void GameLoop() method DisplayIntroText (line 58) | private void DisplayIntroText() method ContinueGame (line 85) | private bool ContinueGame() method PlayTurn (line 116) | private void PlayTurn(GameState state) method DisplayCosts (line 191) | internal void DisplayCosts(string fortname, double supplies, double ex... method ProcessExpeditionOutcome (line 208) | private void ProcessExpeditionOutcome(GameState state) method DisplaySelectedFortInformation (line 357) | private void DisplaySelectedFortInformation(int selectedFort) method TradeAtAnotherFort (line 386) | private bool TradeAtAnotherFort() method GetPelts (line 418) | private int GetPelts(int furCount) method GetSelectedFort (line 463) | private int GetSelectedFort() FILE: 38_Fur_Trader/csharp/GameState.cs class GameState (line 7) | internal class GameState method GameState (line 26) | internal GameState() method StartTurn (line 35) | internal void StartTurn() FILE: 38_Fur_Trader/csharp/Program.cs class Program (line 5) | public class Program method Main (line 11) | public static void Main(string[] args) FILE: 38_Fur_Trader/java/src/FurTrader.java class FurTrader (line 14) | public class FurTrader { type GAME_STATE (line 35) | private enum GAME_STATE { method FurTrader (line 57) | public FurTrader() { method play (line 66) | public void play() { method initPelts (line 213) | private ArrayList initPelts() { method confirmFort (line 230) | private boolean confirmFort(int fort) { method tradeAtFortHochelagaMontreal (line 262) | private void tradeAtFortHochelagaMontreal() { method tradeAtFortStadaconaQuebec (line 274) | private void tradeAtFortStadaconaQuebec() { method tradeAtFortNewYork (line 317) | private boolean tradeAtFortNewYork() { method resetPelts (line 358) | private void resetPelts() { method getPeltCount (line 372) | private int getPeltCount(String peltName) { method extendedTradingInfo (line 376) | private void extendedTradingInfo() { method gameStartupMessage (line 389) | private void gameStartupMessage() { method intro (line 395) | private void intro() { method formatNumber (line 411) | private String formatNumber(double number) { method displayTextAndGetNumber (line 422) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 432) | private String displayTextAndGetInput(String text) { method simulateTabs (line 443) | private String simulateTabs(int spaces) { method yesEntered (line 455) | private boolean yesEntered(String text) { method stringIsAnyValue (line 468) | private boolean stringIsAnyValue(String text, String... values) { FILE: 38_Fur_Trader/java/src/FurTraderGame.java class FurTraderGame (line 1) | public class FurTraderGame { method main (line 2) | public static void main(String[] args) { FILE: 38_Fur_Trader/java/src/Pelt.java class Pelt (line 4) | public class Pelt { method Pelt (line 9) | public Pelt(String name, int number) { method setPeltCount (line 14) | public void setPeltCount(int pelts) { method getNumber (line 18) | public int getNumber() { method getName (line 22) | public String getName() { method lostPelts (line 26) | public void lostPelts() { FILE: 38_Fur_Trader/javascript/furtrader.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function reset_stats (line 48) | function reset_stats() function main (line 55) | async function main() FILE: 38_Fur_Trader/python/furtrader.py function show_introduction (line 26) | def show_introduction() -> None: function get_fort_choice (line 37) | def get_fort_choice() -> int: function show_fort_comment (line 66) | def show_fort_comment(which_fort) -> None: function get_yes_or_no (line 90) | def get_yes_or_no() -> str: function get_furs_purchase (line 107) | def get_furs_purchase() -> List[int]: function main (line 127) | def main() -> None: FILE: 39_Golf/csharp/Program.cs class Program (line 181) | class Program method Main (line 183) | static void Main(string[] args) class Golf (line 191) | public class Golf method w (line 212) | static void w(string s) { Console.WriteLine(s); } method Golf (line 217) | public Golf() method NewHole (line 268) | void NewHole() method TeeUp (line 314) | void TeeUp() method Stroke (line 364) | void Stroke(double clubAmt, int clubIndex) method PlotBall (line 485) | Plot PlotBall(Ball ball, double strokeDistance, double degreesOff) method InterpretResults (line 512) | void InterpretResults(Plot plot, int flags) method ReportCurrentScore (line 619) | void ReportCurrentScore() method FindBall (line 654) | int FindBall(Ball ball, int flags) method IsOnFairway (line 676) | bool IsOnFairway(Ball ball) method IsOnGreen (line 683) | bool IsOnGreen(Ball ball) method IsInHazard (line 692) | bool IsInHazard(Ball ball, GameObjType hazard) method IsInRough (line 705) | bool IsInRough(Ball ball) method IsOutOfBounds (line 713) | bool IsOutOfBounds(Ball ball) method ScoreCardStartNewHole (line 720) | void ScoreCardStartNewHole() method ScoreCardRecordStroke (line 727) | void ScoreCardRecordStroke(Ball ball) method ScoreCardGetPreviousStroke (line 735) | Ball ScoreCardGetPreviousStroke() method ScoreCardGetTotal (line 742) | int ScoreCardGetTotal() method Ask (line 754) | void Ask(string question, int min, int max, Action callback) method Wait (line 783) | void Wait(Action callback) method ReviewBag (line 796) | void ReviewBag() method Quit (line 816) | void Quit() method GameOver (line 827) | void GameOver() class HoleInfo (line 1004) | class HoleInfo method HoleInfo (line 1012) | public HoleInfo(int hole, int yards, int par, Hazard[] hazard, strin... type GameObjType (line 1023) | public enum GameObjType { BALL, CUP, GREEN, FAIRWAY, ROUGH, TREES, WAT... class CircleGameObj (line 1027) | public class CircleGameObj method CircleGameObj (line 1034) | public CircleGameObj(int x, int y, int r, GameObjType type) class RectGameObj (line 1045) | public class RectGameObj method RectGameObj (line 1053) | public RectGameObj(int x, int y, int w, int l, GameObjType type) class HoleGeometry (line 1065) | public class HoleGeometry method HoleGeometry (line 1073) | public HoleGeometry(CircleGameObj cup, CircleGameObj green, RectGame... class Plot (line 1085) | public class Plot method Plot (line 1091) | public Plot(int x, int y, int offline) method GetDistance (line 1102) | double GetDistance(Point pt1, Point pt2) method IsInRectangle (line 1109) | bool IsInRectangle(CircleGameObj pt, RectGameObj rect) method ToRadians (line 1119) | double ToRadians(double angle) { return angle * (Math.PI / 180.0); } method ToDegrees360 (line 1124) | double ToDegrees360(double angle) method Odds (line 1137) | bool Odds(int x) FILE: 39_Golf/javascript/golf.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_obstacle (line 60) | function show_obstacle() function show_score (line 84) | function show_score() function main (line 91) | async function main() FILE: 39_Golf/python/golf.py function clear_console (line 127) | def clear_console() -> None: class Point (line 131) | class Point(NamedTuple): class GameObjType (line 136) | class GameObjType(enum.Enum): class CircleGameObj (line 147) | class CircleGameObj(NamedTuple): class RectGameObj (line 155) | class RectGameObj(NamedTuple): class HoleInfo (line 168) | class HoleInfo(NamedTuple): class HoleGeometry (line 176) | class HoleGeometry(NamedTuple): class Plot (line 185) | class Plot: function get_distance (line 191) | def get_distance(pt1: Point, pt2: Point) -> float: function is_in_rectangle (line 196) | def is_in_rectangle(pt: CircleGameObj, rect: RectGameObj) -> bool: function to_radians (line 206) | def to_radians(angle: float) -> float: function to_degrees_360 (line 210) | def to_degrees_360(angle: float) -> float: function odds (line 218) | def odds(x: int) -> bool: class Golf (line 394) | class Golf: method __init__ (line 429) | def __init__(self) -> None: method start_game (line 452) | def start_game(self) -> None: method ask_handicap (line 463) | def ask_handicap(self) -> None: method set_handicap_ask_difficulty (line 473) | def set_handicap_ask_difficulty(self, i: int) -> None: method set_difficulty_and_hole (line 488) | def set_difficulty_and_hole(self, j: int) -> None: method new_hole (line 493) | def new_hole(self) -> None: method set_putter_and_stroke (line 538) | def set_putter_and_stroke(self, strength: float) -> None: method ask_gauge (line 542) | def ask_gauge(self, c: int) -> None: method make_stroke (line 557) | def make_stroke(self, strength: float, c: int) -> None: method tee_up (line 560) | def tee_up(self) -> None: method stroke (line 578) | def stroke(self, club_amt: float, club_index: int) -> None: method plot_ball (line 697) | def plot_ball(self, ball: Ball, stroke_distance: float, degrees_off: f... method interpret_results (line 716) | def interpret_results(self, plot: Plot, flags: int) -> None: method report_current_score (line 813) | def report_current_score(self) -> None: method find_ball (line 843) | def find_ball(self, ball: Ball, flags: int) -> int: method is_on_fairway (line 872) | def is_on_fairway(self, ball: Ball) -> bool: method is_on_green (line 875) | def is_on_green(self, ball: Ball) -> bool: method hazard_hit (line 882) | def hazard_hit(self, h: Hazard, ball: Ball, hazard: GameObjType) -> bool: method is_in_hazard (line 886) | def is_in_hazard(self, ball: Ball, hazard: GameObjType) -> bool: method is_in_rough (line 892) | def is_in_rough(self, ball: Ball) -> bool: method is_out_of_bounds (line 897) | def is_out_of_bounds(self, ball: Ball) -> bool: method score_card_start_new_hole (line 900) | def score_card_start_new_hole(self) -> None: method score_card_record_stroke (line 903) | def score_card_record_stroke(self, ball: Ball) -> None: method score_card_get_previous_stroke (line 907) | def score_card_get_previous_stroke(self) -> Ball: method score_card_get_total (line 910) | def score_card_get_total(self) -> int: method ask (line 914) | def ask( method review_bag (line 939) | def review_bag(self) -> None: method quit_game (line 955) | def quit_game(self) -> None: method game_over (line 959) | def game_over(self) -> None: FILE: 40_Gomoko/java/Gomoko.java class Gomoko (line 10) | public class Gomoko { method main (line 15) | public static void main(String[] args) { method getComputerMove (line 74) | private static Move getComputerMove(Move playerMove, int[][] board, in... method printBoard (line 100) | private static void printBoard(int[][] board) { method getRandomMove (line 110) | private static Move getRandomMove(int[][] board, int boardSize) { method randomMove (line 121) | private static Move randomMove(int boardSize) { method isLegalMove (line 127) | private static boolean isLegalMove(Move move, int boardSize) { method printIntro (line 131) | private static void printIntro() { method readBoardSize (line 147) | private static int readBoardSize(Scanner scan) { method readMove (line 170) | private static Move readMove(Scanner scan) { class Move (line 189) | private static class Move { method Move (line 193) | public Move() { method Move (line 196) | public Move(int i, int j) { method toString (line 201) | @Override FILE: 40_Gomoko/javascript/gomoko.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function reset_stats (line 45) | function reset_stats() function print_board (line 57) | function print_board() function is_valid (line 69) | function is_valid() function main (line 77) | async function main() FILE: 40_Gomoko/python/Gomoko.py function print_board (line 5) | def print_board(A: List[List[Any]], n: int) -> None: function check_move (line 15) | def check_move(_I, _J, _N) -> bool: # 910 function print_banner (line 19) | def print_banner() -> None: function get_board_dimensions (line 33) | def get_board_dimensions() -> int: function get_move (line 44) | def get_move() -> Tuple[int, int]: function initialize_board (line 58) | def initialize_board(n: int) -> List[List[int]]: function main (line 67) | def main() -> None: FILE: 41_Guess/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 8) | public Game(IReadWrite io, IRandom random) method Play (line 14) | public void Play() method PlayGuessingRounds (line 33) | private void PlayGuessingRounds(float limit, int targetGuessCount) method IsGuessCorrect (line 59) | private bool IsGuessCorrect(float guess, int secretNumber) method ReportResult (line 67) | private void ReportResult(int guessCount, int targetGuessCount) FILE: 41_Guess/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Formats (line 16) | internal static class Formats class Prompts (line 23) | internal static class Prompts class Strings (line 28) | internal static class Strings method GetString (line 34) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 41) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 41_Guess/java/src/Guess.java class Guess (line 13) | public class Guess { type GAME_STATE (line 18) | private enum GAME_STATE { method Guess (line 42) | public Guess() { method play (line 51) | public void play() { method intro (line 108) | private void intro() { method linePadding (line 121) | private void linePadding() { method displayTextAndGetNumber (line 134) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 144) | private String displayTextAndGetInput(String text) { method simulateTabs (line 155) | private String simulateTabs(int spaces) { FILE: 41_Guess/java/src/GuessGame.java class GuessGame (line 1) | public class GuessGame { method main (line 2) | public static void main(String[] args) { FILE: 41_Guess/javascript/guess.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function make_space (line 45) | function make_space() function main (line 52) | async function main() FILE: 41_Guess/python/guess.py function insert_whitespaces (line 32) | def insert_whitespaces() -> None: function limit_set (line 36) | def limit_set() -> Tuple[int, int]: function main (line 57) | def main() -> None: FILE: 41_Guess/ruby/guess.rb function print_intro (line 1) | def print_intro function game_play (line 7) | def game_play(limit,choice_limit) function main (line 38) | def main FILE: 41_Guess/rust/src/main.rs function num_bits (line 28) | const fn num_bits() -> usize { std::mem::size_of::() * 8 } function main (line 30) | fn main() { function log_2 (line 79) | fn log_2(x:i32) -> u32 { function set_limit (line 84) | fn set_limit() -> i64 { function get_input (line 103) | fn get_input() -> String { FILE: 42_Gunner/csharp/Program.cs class Program (line 3) | class Program method Main (line 5) | static void Main(string[] args) method PlayGame (line 18) | static void PlayGame() method HitTheTarget (line 58) | static (bool, int) HitTheTarget(int maximumRange, int distanceToTarget) method CalculateDifferenceBetweenTargetAndImpact (line 87) | static int CalculateDifferenceBetweenTargetAndImpact(int maximumRange,... method PrintReturnToBase (line 94) | static void PrintReturnToBase() method GetElevation (line 99) | static int GetElevation() method PrintIntro (line 114) | static void PrintIntro() FILE: 42_Gunner/java/Gunner.java class Gunner (line 4) | public class Gunner { method main (line 13) | public static void main(String[] args) { method fightEnemy (line 57) | private static int fightEnemy(int maxRange) { method calculateError (line 94) | private static long calculateError(int maxRange, long target, double e... method println (line 101) | private static void println(String s) { method println (line 105) | private static void println() { FILE: 42_Gunner/javascript/gunner.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 57) | async function main() FILE: 42_Gunner/python/gunner.py function gunner (line 9) | def gunner() -> None: function main (line 72) | def main() -> None: FILE: 42_Gunner/rust/src/main.rs function main (line 8) | fn main() { type GunnerGame (line 24) | struct GunnerGame { method new (line 32) | fn new() -> Self { method run (line 44) | fn run(&mut self) -> PlayAgain { method handle_target (line 80) | fn handle_target(&mut self) -> bool { type PlayAgain (line 128) | enum PlayAgain { type Err (line 134) | type Err = Infallible; method from_str (line 136) | fn from_str(line: &str) -> Result { function get_input (line 145) | fn get_input>(prompt: S) -> R { FILE: 43_Hammurabi/csharp/ActionResult.cs type ActionResult (line 7) | public enum ActionResult FILE: 43_Hammurabi/csharp/Controller.cs class Controller (line 8) | public static class Controller method UpdateGameState (line 26) | public static GameState UpdateGameState( FILE: 43_Hammurabi/csharp/GameResult.cs type GameResult (line 6) | public record GameResult FILE: 43_Hammurabi/csharp/GameState.cs type GameState (line 6) | public record GameState FILE: 43_Hammurabi/csharp/GreatOffence.cs class GreatOffence (line 9) | public class GreatOffence : InvalidOperationException FILE: 43_Hammurabi/csharp/PerformanceRating.cs type PerformanceRating (line 7) | public enum PerformanceRating FILE: 43_Hammurabi/csharp/Program.cs class Program (line 6) | public static class Program method Main (line 10) | public static void Main(string[] args) FILE: 43_Hammurabi/csharp/Rules.cs class Rules (line 7) | public static class Rules method BeginGame (line 12) | public static GameState BeginGame() => method BeginTurn (line 31) | public static GameState BeginTurn(GameState state, Random random) => method BuyLand (line 48) | public static (GameState newState, ActionResult result) BuyLand(GameSt... method SellLand (line 67) | public static (GameState newState, ActionResult result) SellLand(GameS... method FeedPeople (line 87) | public static (GameState newState, ActionResult result) FeedPeople(Gam... method PlantCrops (line 104) | public static (GameState newState, ActionResult result) PlantCrops(Gam... method EndTurn (line 131) | public static GameState EndTurn(GameState state, Random random) method GetGameResult (line 165) | public static GameResult GetGameResult(IEnumerable history,... FILE: 43_Hammurabi/csharp/View.cs class View (line 8) | public static class View method ShowBanner (line 13) | public static void ShowBanner() method ShowCitySummary (line 27) | public static void ShowCitySummary(GameState state) method ShowLandPrice (line 52) | public static void ShowLandPrice(GameState state) method ShowSeparator (line 60) | public static void ShowSeparator() method ShowInvalidNumber (line 68) | public static void ShowInvalidNumber() method ShowInsufficientLand (line 76) | public static void ShowInsufficientLand(GameState state) method ShowInsufficientPopulation (line 84) | public static void ShowInsufficientPopulation(GameState state) method ShowInsufficientStores (line 92) | public static void ShowInsufficientStores(GameState state) method ShowGreatOffence (line 101) | public static void ShowGreatOffence() method ShowGameResult (line 111) | public static void ShowGameResult(GameResult result) method ShowFarewell (line 155) | public static void ShowFarewell() method PromptBuyLand (line 164) | public static void PromptBuyLand() method PromptSellLand (line 172) | public static void PromptSellLand() method PromptFeedPeople (line 180) | public static void PromptFeedPeople() method PromptPlantCrops (line 188) | public static void PromptPlantCrops() FILE: 43_Hammurabi/java/src/Hamurabi.java class Hamurabi (line 13) | public class Hamurabi { type GAME_STATE (line 41) | private enum GAME_STATE { method Hamurabi (line 59) | public Hamurabi() { method play (line 67) | public void play() { method starvedTooManyPeopleMessage (line 280) | private void starvedTooManyPeopleMessage(int starved) { method heavyHandedMessage (line 289) | private void heavyHandedMessage() { method couldHaveBeenBetterMessage (line 295) | private void couldHaveBeenBetterMessage() { method fantasticPerformanceMessage (line 302) | private void fantasticPerformanceMessage() { method notEnoughPeopleMessage (line 307) | private void notEnoughPeopleMessage() { method notEnoughBushelsMessage (line 312) | private void notEnoughBushelsMessage() { method notEnoughLandMessage (line 317) | private void notEnoughLandMessage() { method intro (line 322) | private void intro() { method displayTextAndGetNumber (line 339) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 349) | private String displayTextAndGetInput(String text) { method simulateTabs (line 360) | private String simulateTabs(int spaces) { FILE: 43_Hammurabi/java/src/HamurabiGame.java class HamurabiGame (line 1) | public class HamurabiGame { method main (line 2) | public static void main(String[] args) { FILE: 43_Hammurabi/javascript/hammurabi.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function exceeded_grain (line 48) | function exceeded_grain() function exceeded_acres (line 55) | function exceeded_acres() function main (line 61) | async function main() FILE: 43_Hammurabi/python/hamurabi.py function gen_random (line 4) | def gen_random() -> int: function bad_input_850 (line 8) | def bad_input_850() -> None: function bad_input_710 (line 13) | def bad_input_710(grain_bushels: int) -> None: function bad_input_720 (line 18) | def bad_input_720(acres: float) -> None: function national_fink (line 22) | def national_fink() -> None: function b_input (line 28) | def b_input(promptstring: str) -> int: function main (line 36) | def main() -> None: FILE: 43_Hammurabi/rust/src/main.rs function run (line 4) | fn run() { function get_input (line 216) | fn get_input() -> Option { function gen_random (line 225) | fn gen_random() -> u32 { function impossible_task (line 230) | fn impossible_task() { function insufficient_grain (line 235) | fn insufficient_grain(grain: u32) { function insufficient_land (line 240) | fn insufficient_land(acres: u32) { function insufficient_people (line 244) | fn insufficient_people(population: u32) { function national_fink (line 248) | fn national_fink() { function main (line 254) | fn main() { FILE: 44_Hangman/csharp/Graphic.cs class Graphic (line 8) | public class Graphic method Graphic (line 14) | public Graphic() method Print (line 44) | public void Print() method AddHead (line 57) | public void AddHead() method AddBody (line 71) | public void AddBody() method AddRightArm (line 79) | public void AddRightArm() method AddLeftArm (line 87) | public void AddLeftArm() method AddRightLeg (line 95) | public void AddRightLeg() method AddLeftLeg (line 101) | public void AddLeftLeg() method AddRightHand (line 107) | public void AddRightHand() method AddLeftHand (line 112) | public void AddLeftHand() method AddRightFoot (line 117) | public void AddRightFoot() method AddLeftFoot (line 123) | public void AddLeftFoot() FILE: 44_Hangman/csharp/Program.cs class Program (line 11) | static class Program method Main (line 13) | static void Main() method MainLoop (line 25) | static void MainLoop() method GameLoop (line 58) | static void GameLoop(string word) method GetLetterFromPlayer (line 140) | private static char GetLetterFromPlayer(char[] displayedWord, List GetWords() => new() method Tab (line 311) | private static string Tab(int length) => new string(' ', length); FILE: 44_Hangman/java/Hangman.java class Hangman (line 14) | public class Hangman { method main (line 28) | public static void main(String[] args) { method playRound (line 67) | private static boolean playRound(Scanner scan, String word) { method drawHangman (line 157) | private static void drawHangman(int m, String[][] hangmanPicture) { method printDiscoveredLetters (line 229) | private static void printDiscoveredLetters(char[] D$) { method printLettersUsed (line 234) | private static void printLettersUsed(Set lettersUsed) { method printIntro (line 241) | private static void printIntro() { FILE: 44_Hangman/javascript/hangman.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 68) | async function main() FILE: 44_Hangman/python/hangman.py class Canvas (line 13) | class Canvas: method __init__ (line 16) | def __init__(self, width: int = 12, height: int = 12, fill: str = " ")... method clear (line 24) | def clear(self, fill: str = " ") -> None: method render (line 29) | def render(self) -> str: method put (line 33) | def put(self, s: str, x: int, y: int) -> None: function init_gallows (line 39) | def init_gallows(canvas: Canvas) -> None: function draw_head (line 47) | def draw_head(canvas: Canvas) -> None: function draw_body (line 60) | def draw_body(canvas: Canvas) -> None: function draw_right_arm (line 65) | def draw_right_arm(canvas: Canvas) -> None: function draw_left_arm (line 70) | def draw_left_arm(canvas: Canvas) -> None: function draw_right_leg (line 77) | def draw_right_leg(canvas: Canvas) -> None: function draw_left_leg (line 82) | def draw_left_leg(canvas: Canvas) -> None: function draw_left_hand (line 87) | def draw_left_hand(canvas: Canvas) -> None: function draw_right_hand (line 91) | def draw_right_hand(canvas: Canvas) -> None: function draw_left_foot (line 95) | def draw_left_foot(canvas: Canvas) -> None: function draw_right_foot (line 100) | def draw_right_foot(canvas: Canvas) -> None: function play_game (line 173) | def play_game(guess_target: str) -> None: function main (line 235) | def main() -> None: FILE: 44_Hangman/ruby/hangman.rb class Canvas (line 1) | class Canvas method initialize (line 3) | def initialize width = 12, height = 12, fill = " " method render (line 15) | def render method put (line 24) | def put s, x, y method clear (line 29) | def clear fill = " " function init_gallows (line 38) | def init_gallows canvas function draw_head (line 50) | def draw_head canvas function draw_body (line 63) | def draw_body canvas function draw_right_arm (line 69) | def draw_right_arm canvas function draw_left_arm (line 75) | def draw_left_arm canvas function draw_right_leg (line 82) | def draw_right_leg canvas function draw_left_leg (line 87) | def draw_left_leg canvas function draw_left_hand (line 92) | def draw_left_hand canvas function draw_right_hand (line 96) | def draw_right_hand canvas function draw_left_foot (line 100) | def draw_left_foot canvas function draw_right_foot (line 105) | def draw_right_foot canvas function play_game (line 176) | def play_game guess_target function main (line 253) | def main FILE: 45_Hello/java/Hello.java class Hello (line 15) | public class Hello { method Hello (line 23) | public Hello() { method play (line 29) | public void play() { method showIntro (line 36) | private static void showIntro() { method startGame (line 44) | private void startGame() { method main (line 209) | public static void main(String[] args) { FILE: 45_Hello/javascript/hello.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 45_Hello/python/hello.py function get_yes_or_no (line 15) | def get_yes_or_no() -> Tuple[bool, Optional[bool], str]: function ask_enjoy_question (line 25) | def ask_enjoy_question(user_name: str) -> None: function prompt_for_problems (line 44) | def prompt_for_problems(user_name: str) -> str: function prompt_too_much_or_too_little (line 53) | def prompt_too_much_or_too_little() -> Tuple[bool, Optional[bool]]: function solve_sex_problem (line 62) | def solve_sex_problem(user_name: str) -> None: function solve_money_problem (line 80) | def solve_money_problem(user_name: str) -> None: function solve_health_problem (line 86) | def solve_health_problem(user_name: str) -> None: function solve_job_problem (line 93) | def solve_job_problem(user_name: str) -> None: function alert_unknown_problem_type (line 100) | def alert_unknown_problem_type(user_name: str, problem_type: str) -> None: function ask_question_loop (line 104) | def ask_question_loop(user_name: str) -> None: function ask_for_fee (line 131) | def ask_for_fee(user_name: str) -> None: function unhappy_goodbye (line 160) | def unhappy_goodbye(user_name: str) -> None: function happy_goodbye (line 167) | def happy_goodbye(user_name: str) -> None: function main (line 171) | def main() -> None: FILE: 45_Hello/ruby/hello.rb class Hello (line 1) | class Hello method start (line 2) | def start method get_yes_or_no (line 20) | def get_yes_or_no method ask_enjoy_question (line 31) | def ask_enjoy_question user_name method prompt_for_problems (line 53) | def prompt_for_problems user_name method prompt_too_much_or_too_little (line 62) | def prompt_too_much_or_too_little method solve_sex_problem (line 73) | def solve_sex_problem user_name method solve_health_problem (line 95) | def solve_health_problem user_name method solve_money_problem (line 102) | def solve_money_problem user_name method solve_job_problem (line 108) | def solve_job_problem user_name method alert_unknown_problem_type (line 115) | def alert_unknown_problem_type user_name, problem_type method ask_question_loop (line 119) | def ask_question_loop user_name method ask_for_fee (line 152) | def ask_for_fee user_name method unhappy_goodbye (line 179) | def unhappy_goodbye user_name method happy_goodbye (line 183) | def happy_goodbye user_name FILE: 45_Hello/rust/src/main.rs function main (line 11) | fn main() { FILE: 46_Hexapawn/csharp/Board.cs class Board (line 11) | internal class Board : IEnumerable, IEquatable method Board (line 15) | public Board() method Board (line 25) | public Board(params Pawn[] cells) method GetEnumerator (line 38) | public IEnumerator GetEnumerator() => _cells.OfType().GetE... method GetEnumerator (line 40) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); method ToString (line 42) | public override string ToString() method Equals (line 57) | public bool Equals(Board other) => other?.Zip(this).All(x => x.First =... method Equals (line 59) | public override bool Equals(object obj) => Equals(obj as Board); method GetHashCode (line 61) | public override int GetHashCode() FILE: 46_Hexapawn/csharp/Cell.cs class Cell (line 8) | internal class Cell method Cell (line 13) | private Cell(int number) method TryCreate (line 24) | public static bool TryCreate(float input, out Cell cell) method ToString (line 40) | public override string ToString() => _number.ToString(); FILE: 46_Hexapawn/csharp/Computer.cs class Computer (line 13) | internal class Computer method Computer (line 19) | public Computer(TextIO io, IRandom random) method TryMove (line 75) | public bool TryMove(Board board) method TryGetMoves (line 98) | private bool TryGetMoves(Board board, out List moves, out bool r... method TrySelectMove (line 116) | private bool TrySelectMove(List moves, out Move move) method ExcludeLastMoveFromFuturePlay (line 128) | private void ExcludeLastMoveFromFuturePlay() method Moves (line 134) | private static List Moves(params Move[] moves) => moves.ToList(); method IsFullyAdvanced (line 136) | public bool IsFullyAdvanced(Board board) => FILE: 46_Hexapawn/csharp/Game.cs class Game (line 7) | internal class Game method Game (line 12) | public Game(TextIO io) method Play (line 18) | public object Play(Human human, Computer computer) FILE: 46_Hexapawn/csharp/GameSeries.cs class GameSeries (line 10) | internal class GameSeries method GameSeries (line 17) | public GameSeries(TextIO io, IRandom random) method Play (line 25) | public void Play() FILE: 46_Hexapawn/csharp/Human.cs class Human (line 10) | internal class Human method Human (line 14) | public Human(TextIO io) method Move (line 19) | public void Move(Board board) method HasLegalMove (line 31) | public bool HasLegalMove(Board board) method HasLegalMove (line 46) | private bool HasLegalMove(Board board, Cell from) => method HasNoPawns (line 51) | public bool HasNoPawns(Board board) => board.All(c => c != White); method TryExecute (line 53) | public bool TryExecute(Board board, Move move) FILE: 46_Hexapawn/csharp/IReadWriteExtensions.cs class IReadWriteExtensions (line 8) | internal static class IReadWriteExtensions method GetYesNo (line 10) | internal static char GetYesNo(this IReadWrite io, string prompt) method ReadMove (line 28) | internal static Move ReadMove(this IReadWrite io, string prompt) FILE: 46_Hexapawn/csharp/Move.cs class Move (line 8) | internal class Move method Move (line 14) | public Move(Cell from, Cell to) method Deconstruct (line 21) | public void Deconstruct(out Cell from, out Cell to) method TryCreate (line 36) | public static bool TryCreate(float input1, float input2, out Move move) method Right (line 49) | public static Move Right(Cell from) => (from, from - 2); method Straight (line 50) | public static Move Straight(Cell from) => (from, from - 3); method Left (line 51) | public static Move Left(Cell from) => (from, from - 4); method IsStraightMoveToEmptySpace (line 53) | public bool IsStraightMoveToEmptySpace(Board board) => _metric == 3 &&... method IsLeftDiagonalToCapture (line 55) | public bool IsLeftDiagonalToCapture(Board board) => _metric == 4 && _f... method IsRightDiagonalToCapture (line 57) | public bool IsRightDiagonalToCapture(Board board) => method Execute (line 60) | public void Execute(Board board) method ToString (line 66) | public override string ToString() => $"from {_from} to {_to}"; FILE: 46_Hexapawn/csharp/Pawn.cs class Pawn (line 4) | internal class Pawn method Pawn (line 12) | private Pawn(char symbol) method ToString (line 17) | public override string ToString() => _symbol.ToString(); FILE: 46_Hexapawn/csharp/Resources/Resource.cs class Resource (line 7) | internal static class Resource class Streams (line 9) | internal static class Streams method GetStream (line 15) | private static Stream GetStream([CallerMemberName] string name = null) FILE: 46_Hexapawn/javascript/hexapawn.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_board (line 89) | function show_board() function mirror (line 101) | function mirror(x) function main (line 119) | async function main() FILE: 46_Hexapawn/python/hexapawn.py class ComputerMove (line 57) | class ComputerMove(NamedTuple): function print_centered (line 68) | def print_centered(msg: str) -> None: function print_header (line 73) | def print_header(title: str) -> None: function print_instructions (line 78) | def print_instructions() -> None: function prompt_yes_no (line 114) | def prompt_yes_no(msg: str) -> bool: function reverse_space_name (line 124) | def reverse_space_name(space_name: int) -> int: function is_space_in_center_column (line 132) | def is_space_in_center_column(space_name: int) -> bool: class BoardLayout (line 136) | class BoardLayout: method __init__ (line 137) | def __init__(self, cells: List[int], move_list: List[Tuple[int, int]])... method _check_match_no_mirror (line 141) | def _check_match_no_mirror(self, cell_list: List[int]) -> bool: method _check_match_with_mirror (line 147) | def _check_match_with_mirror(self, cell_list: List[int]) -> bool: method check_match (line 154) | def check_match(self, cell_list: List[int]) -> Tuple[bool, Optional[bo... method get_random_move (line 161) | def get_random_move( function get_move (line 199) | def get_move(board_index: int, move_index: int) -> Tuple[int, int]: function remove_move (line 208) | def remove_move(board_index: int, move_index: int) -> None: function init_board (line 217) | def init_board() -> List[int]: function print_board (line 221) | def print_board(board: List[int]) -> None: function get_coordinates (line 237) | def get_coordinates() -> Tuple[int, int]: function print_illegal (line 248) | def print_illegal() -> None: function board_contents (line 252) | def board_contents(board: List[int], space_number: int) -> int: function set_board (line 256) | def set_board(board: List[int], space_number: int, new_value: int) -> None: function is_legal_human_move (line 260) | def is_legal_human_move(board: List[int], m1: int, m2: int) -> bool: function player_piece_on_back_row (line 284) | def player_piece_on_back_row(board: List[int]) -> bool: function computer_piece_on_front_row (line 288) | def computer_piece_on_front_row(board: List[int]) -> bool: function all_human_pieces_captured (line 292) | def all_human_pieces_captured(board: List[int]) -> bool: function all_computer_pieces_captured (line 296) | def all_computer_pieces_captured(board: List[int]) -> bool: function human_win (line 300) | def human_win(last_computer_move: ComputerMove) -> None: function computer_win (line 307) | def computer_win(has_moves: bool) -> None: function show_scores (line 314) | def show_scores() -> None: function human_has_move (line 318) | def human_has_move(board: List[int]) -> bool: function get_board_spaces (line 347) | def get_board_spaces() -> Iterator[int]: function get_board_spaces_with (line 352) | def get_board_spaces_with(board: List[int], val: int) -> Iterator[int]: function get_human_spaces (line 359) | def get_human_spaces(board: List[int]) -> Iterator[int]: function get_empty_spaces (line 363) | def get_empty_spaces(board: List[int]) -> Iterator[int]: function get_computer_spaces (line 367) | def get_computer_spaces(board: List[int]) -> Iterator[int]: function has_computer_move (line 371) | def has_computer_move(board: List[int]) -> bool: function find_board_index_that_matches_board (line 396) | def find_board_index_that_matches_board(board: List[int]) -> Tuple[int, ... function pick_computer_move (line 407) | def pick_computer_move(board: List[int]) -> Optional[ComputerMove]: function get_human_move (line 424) | def get_human_move(board: List[int]) -> Tuple[int, int]: function apply_move (line 434) | def apply_move(board: List[int], m1: int, m2: int, piece_value: int) -> ... function play_game (line 439) | def play_game() -> None: function main (line 481) | def main() -> None: FILE: 47_Hi-Lo/java/src/HiLo.java class HiLo (line 12) | public class HiLo { type GAME_STATE (line 18) | private enum GAME_STATE { method HiLo (line 41) | public HiLo() { method play (line 54) | public void play() { method validateGuess (line 117) | private boolean validateGuess(int theGuess) { method init (line 133) | private void init() { method intro (line 138) | public void intro() { method playerGuess (line 157) | private int playerGuess() { method yesEntered (line 167) | private boolean yesEntered(String text) { method stringIsAnyValue (line 180) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 199) | private String displayTextAndGetInput(String text) { method randomNumber (line 210) | private int randomNumber() { FILE: 47_Hi-Lo/java/src/HiLoGame.java class HiLoGame (line 1) | public class HiLoGame { method main (line 3) | public static void main(String[] args) { FILE: 47_Hi-Lo/javascript/hi-lo.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 47_Hi-Lo/python/hilo.py function main (line 8) | def main() -> None: FILE: 47_Hi-Lo/ruby/hi_lo.rb function intro (line 5) | def intro function make_guess (line 18) | def make_guess function check_guess (line 23) | def check_guess function blew_it (line 36) | def blew_it function outro (line 41) | def outro FILE: 47_Hi-Lo/rust/src/main.rs function main (line 4) | fn main() { FILE: 48_High_IQ/java/src/HighIQ.java class HighIQ (line 14) | public class HighIQ { method HighIQ (line 26) | public HighIQ(Scanner scanner) { method play (line 46) | public void play() { method move (line 73) | public boolean move() { method isGameFinished (line 117) | public boolean isGameFinished() { method printBoard (line 134) | public void printBoard() { method getChar (line 143) | private char getChar(int position) { FILE: 48_High_IQ/java/src/HighIQGame.java class HighIQGame (line 3) | public class HighIQGame { method main (line 4) | public static void main(String[] args) { method printInstructions (line 15) | public static void printInstructions() { FILE: 48_High_IQ/javascript/highiq.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function print_board (line 60) | function print_board() function update_board (line 83) | function update_board() function check_game_over (line 130) | function check_game_over() function main (line 152) | async function main() FILE: 48_High_IQ/python/High_IQ.py function new_board (line 4) | def new_board() -> Dict[int, str]: function print_instructions (line 46) | def print_instructions() -> None: function print_board (line 79) | def print_board(board: Dict[int, str]) -> None: function play_game (line 114) | def play_game() -> None: function move (line 132) | def move(board: Dict[int, str]) -> bool: function main (line 165) | def main() -> None: function is_game_finished (line 172) | def is_game_finished(board) -> bool: FILE: 49_Hockey/javascript/hockey.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 54) | async function main() FILE: 49_Hockey/python/hockey.py class Team (line 20) | class Team: method show_lineup (line 36) | def show_lineup(self) -> None: function ask_binary (line 42) | def ask_binary(prompt: str, error_msg: str) -> bool: function get_team_names (line 52) | def get_team_names() -> Tuple[str, str]: function get_pass (line 60) | def get_pass() -> int: function get_minutes_per_game (line 71) | def get_minutes_per_game() -> int: function get_player_names (line 82) | def get_player_names(prompt: str) -> List[str]: function make_shot (line 91) | def make_shot( function print_header (line 124) | def print_header() -> None: function instructions (line 129) | def instructions() -> None: function team1_action (line 157) | def team1_action( function team2_action (line 216) | def team2_action( function final_message (line 266) | def final_message(team_a: Team, team_b: Team, player_index: List[int]) -... function main (line 295) | def main() -> None: function handle_hit (line 338) | def handle_hit( function handle_miss (line 395) | def handle_miss( function simulate_game_round (line 468) | def simulate_game_round( FILE: 50_Horserace/java/Horserace.java class Horserace (line 14) | public class Horserace { method main (line 29) | public static void main(String[] args) { method generateOdds (line 56) | private static int[] generateOdds(Random random) { method printOdds (line 64) | private static void printOdds(int R, int[] D) { method readDonePlaying (line 71) | private static boolean readDonePlaying(Scanner scan) { method runRace (line 81) | private static int[] runRace(int numberOfHorses, int sumOdds, int[] od... method sortHorsePositionsBasedOnCurrent (line 145) | private static void sortHorsePositionsBasedOnCurrent(int[] currentPosi... method calculatePositionChanges (line 163) | private static int calculatePositionChanges(int r, int d, Random rando... method printRaceResults (line 188) | private static void printRaceResults(int[] m, Map bets, i... method takeBets (line 206) | private static Map takeBets(Scanner scanner, List... method printHelp (line 227) | private static void printHelp(Scanner scanner) { method readChoice (line 241) | private static String readChoice(Scanner scanner) { method readInt (line 246) | private static int readInt(String prompt, Scanner scanner) { method readDouble (line 259) | private static double readDouble(String prompt, Scanner scanner) { method readBetNames (line 272) | private static List readBetNames(Scanner scanner) { method printHeader (line 284) | private static void printHeader() { class Bet (line 292) | private static class Bet { method Bet (line 297) | public Bet(String betName, int horseNumber, double amount) { method toString (line 303) | @Override FILE: 50_Horserace/javascript/horserace.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 55) | async function main() FILE: 50_Horserace/python/horserace.py function basic_print (line 7) | def basic_print(*zones, **kwargs) -> None: function basic_input (line 21) | def basic_input(prompt: str, type_conversion=None): function introduction (line 49) | def introduction() -> None: function setup_players (line 70) | def setup_players() -> List[str]: function setup_horses (line 80) | def setup_horses() -> List[float]: function print_horse_odds (line 92) | def print_horse_odds(odds) -> None: function get_bets (line 101) | def get_bets(player_names: List[str]) -> List[Tuple[int, float]]: function get_distance (line 124) | def get_distance(odd: float) -> int: function print_race_state (line 146) | def print_race_state(total_distance, race_pos) -> None: function simulate_race (line 180) | def simulate_race(odds) -> List[int]: function print_race_results (line 226) | def print_race_results(race_positions, odds, bets, player_names) -> None: function main_loop (line 245) | def main_loop(player_names, horse_odds) -> None: function main (line 260) | def main() -> None: FILE: 50_Horserace/rust/src/game.rs type Game (line 5) | pub struct Game { method new (line 11) | pub fn new() -> Self { method play (line 18) | pub fn play(&mut self) -> bool { method draw (line 38) | pub fn draw(&self) { FILE: 50_Horserace/rust/src/horses.rs type Horse (line 3) | pub struct Horse { method new (line 11) | fn new(name: &str, no: u8) -> Self { type Horses (line 21) | pub struct Horses { method new (line 26) | pub fn new() -> Self { method randomize_odds (line 41) | pub fn randomize_odds(&mut self) { method advance (line 56) | pub fn advance(&mut self) { method get_at (line 81) | pub fn get_at(&self, row: usize) -> Vec<&Horse> { method print_table (line 88) | pub fn print_table(&self) { method print_placements (line 102) | pub fn print_placements(&mut self) -> u8 { FILE: 50_Horserace/rust/src/main.rs function main (line 8) | fn main() { FILE: 50_Horserace/rust/src/players.rs type Player (line 4) | pub struct Player { method new (line 13) | fn new(name: String) -> Self { type Players (line 25) | pub struct Players { method new (line 30) | pub fn new() -> Self { method make_bets (line 50) | pub fn make_bets(&mut self) { method generate_players (line 99) | fn generate_players(n: i32) -> Vec { method process_winner (line 122) | pub fn process_winner(&mut self, no: u8) { method prompt_next_round (line 142) | pub fn prompt_next_round(&mut self) -> bool { FILE: 50_Horserace/rust/src/util.rs type PromptResult (line 3) | pub enum PromptResult { function prompt (line 9) | pub fn prompt(is_numeric: Option, msg: &str) -> PromptResult { FILE: 51_Hurkle/csharp/CardinalDirection.cs type CardinalDirection (line 3) | internal enum CardinalDirection FILE: 51_Hurkle/csharp/ConsoleHurkleView.cs class ConsoleHurkleView (line 5) | internal class ConsoleHurkleView : IHurkleView method GetGuess (line 7) | public GamePoint GetGuess(GuessViewModel guessViewModel) method ShowDirection (line 20) | public void ShowDirection(FailedGuessViewModel failedGuessViewModel) method ShowLoss (line 54) | public void ShowLoss(LossViewModel lossViewModel) method ShowVictory (line 61) | public void ShowVictory(VictoryViewModel victoryViewModel) FILE: 51_Hurkle/csharp/FailedGuessViewModel.cs class FailedGuessViewModel (line 3) | internal class FailedGuessViewModel FILE: 51_Hurkle/csharp/GamePoint.cs class GamePoint (line 3) | internal class GamePoint method GetDirectionTo (line 8) | public CardinalDirection GetDirectionTo(GamePoint target) FILE: 51_Hurkle/csharp/GuessViewModel.cs class GuessViewModel (line 3) | internal class GuessViewModel FILE: 51_Hurkle/csharp/HurkleGame.cs class HurkleGame (line 5) | internal class HurkleGame method HurkleGame (line 12) | public HurkleGame(int guesses, int gridSize, IHurkleView view) method PlayGame (line 19) | public void PlayGame() FILE: 51_Hurkle/csharp/IHurkleView.cs type IHurkleView (line 3) | internal interface IHurkleView method GetGuess (line 5) | GamePoint GetGuess(GuessViewModel guessViewModel); method ShowVictory (line 6) | void ShowVictory(VictoryViewModel victoryViewModel); method ShowDirection (line 7) | void ShowDirection(FailedGuessViewModel failedGuessViewModel); method ShowLoss (line 8) | void ShowLoss(LossViewModel lossViewModel); FILE: 51_Hurkle/csharp/LossViewModel.cs class LossViewModel (line 3) | internal class LossViewModel FILE: 51_Hurkle/csharp/Program.cs class Program (line 5) | class Program method Main (line 7) | static void Main(string[] args) FILE: 51_Hurkle/csharp/VictoryViewModel.cs class VictoryViewModel (line 3) | internal class VictoryViewModel FILE: 51_Hurkle/java/src/Hurkle.java class Hurkle (line 12) | public class Hurkle { type GAME_STATE (line 17) | private enum GAME_STATE { method Hurkle (line 40) | public Hurkle() { method play (line 51) | public void play() { method showDirectionOfHurkle (line 106) | private void showDirectionOfHurkle() { method foundHurkle (line 128) | private boolean foundHurkle() { method intro (line 141) | private void intro() { method randomNumber (line 164) | private int randomNumber() { method displayTextAndGetInput (line 175) | private String displayTextAndGetInput(String text) { method getDelimitedValue (line 188) | private int getDelimitedValue(String text, int pos) { FILE: 51_Hurkle/java/src/HurkleGame.java class HurkleGame (line 1) | public class HurkleGame { method main (line 3) | public static void main(String[] args) { FILE: 51_Hurkle/javascript/hurkle.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 51_Hurkle/python/hurkle.py function direction (line 8) | def direction(A, B, X, Y) -> None: function main (line 25) | def main() -> None: FILE: 51_Hurkle/ruby/hurkle.rb class Point (line 4) | class Point < Object method initialize (line 8) | def initialize(text="") method to_s (line 14) | def to_s method == (line 18) | def ==(other_point) method direction_to (line 22) | def direction_to(other_point) function main (line 28) | def main function say_introduction (line 44) | def say_introduction function guess (line 61) | def guess(hurkle_point, guess_num) function say_success (line 73) | def say_success(guess_num) function say_where_to_go (line 78) | def say_where_to_go(hurkle_point, guess_point) function say_failure (line 83) | def say_failure(hurkle_point) function say_play_again (line 89) | def say_play_again FILE: 51_Hurkle/rust/src/game.rs type Position (line 5) | type Position = (u8, u8); type Game (line 7) | pub struct Game { method new (line 13) | pub fn new() -> Self { method update (line 21) | pub fn update(&mut self) -> bool { method get_guess (line 31) | fn get_guess(&self) -> Position { method process_guess (line 69) | fn process_guess(&self, p: Position) -> bool { FILE: 51_Hurkle/rust/src/main.rs function main (line 5) | fn main() { FILE: 52_Kinema/java/src/Kinema.java class Kinema (line 13) | public class Kinema { type GAME_STATE (line 18) | private enum GAME_STATE { method Kinema (line 36) | public Kinema() { method play (line 45) | public void play() { method intro (line 120) | private void intro() { method calculate (line 126) | private boolean calculate(double playerAnswer, double correctAnswer) { method displayTextAndGetNumber (line 149) | private double displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 159) | private String displayTextAndGetInput(String text) { method simulateTabs (line 170) | private String simulateTabs(int spaces) { FILE: 52_Kinema/java/src/KinemaGame.java class KinemaGame (line 1) | public class KinemaGame { method main (line 2) | public static void main(String[] args) { FILE: 52_Kinema/javascript/kinema.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function evaluate_answer (line 47) | function evaluate_answer(str, a) function main (line 60) | async function main() FILE: 52_Kinema/python/kinema.py function do_quiz (line 23) | def do_quiz() -> None: function ask_player (line 53) | def ask_player(question: str, answer) -> int: function main (line 69) | def main() -> None: FILE: 52_Kinema/ruby/kinema.rb function close? (line 8) | def close?(guess, answer) function ask (line 12) | def ask(text, answer) FILE: 52_Kinema/rust/src/main.rs function subroutine (line 25) | fn subroutine(a: f64, q: &mut i32) { function main (line 55) | fn main() { FILE: 53_King/csharp/Country.cs class Country (line 3) | internal class Country method Country (line 15) | public Country(IReadWrite io, IRandom random) method Country (line 26) | public Country(IReadWrite io, IRandom random, float rallods, float cou... method GetStatus (line 36) | public string GetStatus(int landValue, int plantingCost) method SellLand (line 48) | public bool SellLand(int landValue, out float landSold) method DistributeRallods (line 63) | public bool DistributeRallods(out float rallodsGiven) method PlantLand (line 77) | public bool PlantLand(int plantingCost, out float landPlanted) method ControlPollution (line 93) | public bool ControlPollution(out float rallodsSpent) method TrySpend (line 107) | public bool TrySpend(float amount, float landValue) method RemoveTheDead (line 120) | public void RemoveTheDead(int deaths) => _countrymen = (int)(_countrym... method Migration (line 122) | public void Migration(int migration) => _countrymen = (int)(_countryme... method AddWorkers (line 124) | public void AddWorkers(int newWorkers) => _foreigners = (int)(_foreign... method SellCrops (line 126) | public void SellCrops(int income) => _rallods = (int)(_rallods + income); method EntertainTourists (line 128) | public void EntertainTourists(int income) FILE: 53_King/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 10) | public Game(IReadWrite io, IRandom random) method Play (line 16) | public void Play() method SetUpReign (line 30) | private Reign? SetUpReign() FILE: 53_King/csharp/IOExtensions.cs class IOExtensions (line 6) | internal static class IOExtensions method TryReadGameData (line 8) | internal static bool TryReadGameData(this IReadWrite io, IRandom rando... method TryReadValue (line 24) | internal static bool TryReadValue(this IReadWrite io, string prompt, o... method TryReadValue (line 34) | internal static bool TryReadValue(this IReadWrite io, string prompt, o... method TryReadValue (line 37) | internal static bool TryReadValue( method TryReadValue (line 45) | internal static bool TryReadValue( FILE: 53_King/csharp/Reign.cs class Reign (line 3) | internal class Reign method Reign (line 12) | public Reign(IReadWrite io, IRandom random) method Reign (line 17) | public Reign(IReadWrite io, IRandom random, Country country, float year) method PlayYear (line 25) | public bool PlayYear() method IsAtEndOfTerm (line 41) | private Result IsAtEndOfTerm() FILE: 53_King/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource method InstructionsText (line 13) | public static string InstructionsText(int years) => string.Format(GetS... method Status (line 15) | public static string Status( method SellLandError (line 35) | public static string SellLandError(float farmLand) method GiveRallodsError (line 44) | public static string GiveRallodsError(float rallods) => string.Format(... method PlantLandError2 (line 48) | public static string PlantLandError2(float farmLand) => string.Format(... method PlantLandError3 (line 49) | public static string PlantLandError3(float rallods) => string.Format(G... method PollutionError (line 52) | public static string PollutionError(float rallods) => string.Format(Ge... method DeathsStarvation (line 54) | public static string DeathsStarvation(float deaths) => string.Format(G... method DeathsPollution (line 55) | public static string DeathsPollution(int deaths) => string.Format(GetS... method FuneralExpenses (line 56) | public static string FuneralExpenses(int expenses) => string.Format(Ge... method WorkerMigration (line 59) | public static string WorkerMigration(int newWorkers) => string.Format(... method Migration (line 60) | public static string Migration(int migration) method LandPlanted (line 65) | public static string LandPlanted(float landPlanted) method Harvest (line 67) | public static string Harvest(int yield, int income, bool hasIndustry) method HarvestReason (line 69) | private static string HarvestReason(bool hasIndustry) => hasIndustry ?... method TourismEarnings (line 71) | public static string TourismEarnings(int income) => string.Format(GetS... method TourismDecrease (line 72) | public static string TourismDecrease(IRandom random) => string.Format(... method TourismReason (line 73) | private static string TourismReason(IRandom random) => GetStrings()[ra... method EndAlso (line 75) | private static string EndAlso(IRandom random) method EndCongratulations (line 83) | public static string EndCongratulations(int termLength) => string.Form... method EndConsequences (line 84) | private static string EndConsequences(IRandom random) => GetStrings()[... method EndForeignWorkers (line 85) | public static string EndForeignWorkers(IRandom random) => string.Forma... method EndManyDead (line 86) | public static string EndManyDead(int deaths, IRandom random) => string... method EndMoneyLeftOver (line 87) | public static string EndMoneyLeftOver() => GetString(); method EndOneThirdDead (line 88) | public static string EndOneThirdDead(IRandom random) => string.Format(... method SavedYearsError (line 91) | public static string SavedYearsError(int years) => string.Format(GetSt... method GetStrings (line 100) | private static string[] GetStrings([CallerMemberName] string? name = n... method GetString (line 102) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 109) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 53_King/csharp/Result.cs type Result (line 3) | internal record struct Result (bool IsGameOver, string Message) FILE: 53_King/csharp/ValidityTest.cs class ValidityTest (line 3) | internal class ValidityTest method ValidityTest (line 8) | public ValidityTest(Predicate isValid, string error) method ValidityTest (line 13) | public ValidityTest(Predicate isValid, Func getError) method IsValid (line 19) | public bool IsValid(float value, IReadWrite io) FILE: 53_King/csharp/Year.cs class Year (line 5) | internal class Year method Year (line 24) | public Year(Country country, IRandom random, IReadWrite io) method GetPlayerActions (line 36) | public Result? GetPlayerActions() method EvaluateResults (line 48) | public Result? EvaluateResults() method EvaluateDeaths (line 62) | public Result? EvaluateDeaths() method EvaluateMigration (line 97) | private Result? EvaluateMigration() method EvaluateAgriculture (line 115) | private Result? EvaluateAgriculture() method EvaluateTourism (line 129) | private Result? EvaluateTourism() method DetermineResult (line 146) | private Result? DetermineResult(float rallodsUnspent) FILE: 53_King/javascript/king.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function hate_your_guts (line 45) | function hate_your_guts() function main (line 55) | async function main() FILE: 53_King/python/king.py function ask_int (line 21) | def ask_int(prompt) -> int: class GameState (line 30) | class GameState: method set_market_conditions (line 51) | def set_market_conditions(self) -> None: method farmland (line 56) | def farmland(self) -> int: method settled_people (line 60) | def settled_people(self) -> int: method sell_land (line 63) | def sell_land(self, amount: int) -> None: method distribute_rallods (line 68) | def distribute_rallods(self, distribute: int) -> None: method spend_pollution_control (line 71) | def spend_pollution_control(self, spend: int) -> None: method plant (line 74) | def plant(self, sq_to_plant: int) -> None: method print_status (line 77) | def print_status(self) -> None: method handle_deaths (line 92) | def handle_deaths( method handle_tourist_trade (line 126) | def handle_tourist_trade(self) -> None: method handle_harvest (line 151) | def handle_harvest(self, planted_sq: int) -> None: method handle_foreign_workers (line 170) | def handle_foreign_workers( method handle_too_many_deaths (line 201) | def handle_too_many_deaths(self) -> None: method handle_third_died (line 214) | def handle_third_died(self) -> None: method handle_money_mismanagement (line 222) | def handle_money_mismanagement(self) -> None: method handle_too_many_foreigners (line 233) | def handle_too_many_foreigners(self) -> None: method end_game (line 239) | def end_game(self) -> None: method handle_congratulations (line 247) | def handle_congratulations(self) -> None: function print_header (line 257) | def print_header() -> None: function print_instructions (line 262) | def print_instructions() -> None: function ask_how_many_sq_to_plant (line 281) | def ask_how_many_sq_to_plant(state: GameState) -> int: function ask_pollution_control (line 302) | def ask_pollution_control(state: GameState) -> int: function ask_sell_to_industry (line 315) | def ask_sell_to_industry(state: GameState) -> int: function ask_distribute_rallods (line 339) | def ask_distribute_rallods(state: GameState) -> int: function resume (line 354) | def resume() -> GameState: function main (line 390) | def main() -> None: FILE: 53_King/rust/src/main.rs constant TERM_LENGTH (line 8) | const TERM_LENGTH: u32 = 8; function main (line 10) | fn main() { type State (line 34) | struct State { type RoundEnd (line 52) | enum RoundEnd { function init_state (line 57) | fn init_state(rng: &mut Rng) -> State { function print_state (line 73) | fn print_state(state: &State, land_price: u32, plant_price: u32) { function intro (line 93) | fn intro(mut input: R, rng: &mut Rng) -> io::Result { function next_round (line 193) | fn next_round( function departure_flavour (line 529) | fn departure_flavour(rng: &mut Rng) -> &'static str { function read_int (line 537) | fn read_int(mut input: R, buf: &mut String) -> io::Result( FILE: 54_Letter/csharp/Game.cs class Game (line 3) | internal static class Game method Play (line 14) | public static void Play() method PlayRound (line 28) | internal static void PlayRound() method DisplayIntroductionText (line 46) | internal static void DisplayIntroductionText() method DisplayRoundIntroduction (line 66) | internal static void DisplayRoundIntroduction() method DisplayGuessResult (line 77) | internal static void DisplayGuessResult(char letterToGuess, char lette... method DisplaySuccessMessage (line 103) | internal static void DisplaySuccessMessage(GameState gameState) method GetCharacterFromKeyboard (line 126) | internal static char GetCharacterFromKeyboard() FILE: 54_Letter/csharp/GameState.cs class GameState (line 6) | internal class GameState method GameState (line 11) | public GameState() method GetRandomLetter (line 30) | internal static char GetRandomLetter() FILE: 54_Letter/java/src/Letter.java class Letter (line 14) | public class Letter { type GAME_STATE (line 20) | private enum GAME_STATE { method Letter (line 40) | public Letter() { method play (line 51) | public void play() { method intro (line 109) | public void intro() { method simulateTabs (line 126) | private String simulateTabs(int spaces) { method displayTextAndGetInput (line 138) | private String displayTextAndGetInput(String text) { FILE: 54_Letter/java/src/LetterGame.java class LetterGame (line 1) | public class LetterGame { method main (line 3) | public static void main(String[] args) { FILE: 54_Letter/javascript/letter.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 54_Letter/python/letter.py function print_instructions (line 18) | def print_instructions() -> None: function play_game (line 26) | def play_game() -> None: function main (line 60) | def main() -> None: FILE: 54_Letter/ruby/letter.rb function win (line 16) | def win(turns) function play (line 23) | def play FILE: 54_Letter/rust/src/main.rs function main (line 5) | fn main() { FILE: 55_Life/csharp/Program.cs class Pattern (line 241) | public class Pattern method Pattern (line 247) | public Pattern(IReadOnlyCollection patternLines) method NormalizeWidth (line 254) | private string[] NormalizeWidth(IReadOnlyCollection patternLines) type CellState (line 265) | internal enum CellState class Simulation (line 273) | public class Simulation method StartNewGeneration (line 279) | public void StartNewGeneration() method IncreasePopulation (line 285) | public void IncreasePopulation() class Matrix (line 294) | class Matrix method Matrix (line 298) | public Matrix(int height, int width) method ToString (line 309) | public override string ToString() FILE: 55_Life/java/src/java/Life.java class Life (line 16) | public class Life { method Life (line 35) | public Life(String[] args) { method parse (line 39) | private void parse(String[] args) { method start (line 51) | public void start() { method advanceToNextGeneration (line 64) | private void advanceToNextGeneration() { method countNeighbours (line 93) | private int countNeighbours(int y, int x) { method readPattern (line 108) | private void readPattern() { method fillMatrix (line 128) | private void fillMatrix(List lines, int maxLineLength) { method floor (line 142) | private int floor(float f) { method printGameHeader (line 146) | private void printGameHeader() { method printIndented (line 152) | private void printIndented(int spaces, String str) { method printGeneration (line 156) | private void printGeneration() { method printGenerationHeader (line 166) | private void printGenerationHeader() { method main (line 178) | public static void main(String[] args) throws Exception { FILE: 55_Life/javascript/life.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 49) | async function main() FILE: 55_Life/python/life.py function print_centered (line 17) | def print_centered(msg) -> None: function print_header (line 22) | def print_header(title) -> None: function get_pattern (line 30) | def get_pattern() -> Dict[int, str]: function main (line 52) | def main() -> None: FILE: 55_Life/ruby/life.rb class Pattern (line 12) | class Pattern method initialize (line 16) | def initialize(max_generations: 10) method get_input (line 26) | def get_input method display (line 66) | def display method iterate (line 78) | def iterate function display_banner (line 139) | def display_banner function main (line 149) | def main FILE: 55_Life/rust/src/main.rs type CellState (line 18) | enum CellState { method fmt (line 28) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { constant HEIGHT (line 42) | const HEIGHT: usize = 24; constant WIDTH (line 43) | const WIDTH: usize = 70; type Board (line 45) | struct Board { method new (line 57) | fn new() -> Board { function main (line 71) | fn main() { function get_pattern (line 89) | fn get_pattern() -> Vec> { function parse_pattern (line 120) | fn parse_pattern(rows: Vec>) -> Board { function finish_cell_transitions (line 167) | fn finish_cell_transitions(board: &mut Board) { function print_board (line 223) | fn print_board(board: &Board) { function count_neighbors (line 239) | fn count_neighbors(board: &Board, row_index: usize, col_index: usize) ->... function mark_cell_transitions (line 257) | fn mark_cell_transitions(board: &mut Board) { function delay (line 273) | fn delay() { FILE: 56_Life_for_Two/csharp/Board.cs class Board (line 6) | internal class Board : IEnumerable method IsEmptyAt (line 32) | internal bool IsEmptyAt(Coordinates coordinates) => this[coordinates].... method ClearCell (line 34) | internal void ClearCell(Coordinates coordinates) => this[coordinates] ... method AddPlayer1Piece (line 35) | internal void AddPlayer1Piece(Coordinates coordinates) => this[coordin... method AddPlayer2Piece (line 36) | internal void AddPlayer2Piece(Coordinates coordinates) => this[coordin... method ToString (line 38) | public override string ToString() method GetCellDisplay (line 54) | private string GetCellDisplay(int x, int y) => method GetEnumerator (line 62) | public IEnumerator GetEnumerator() method GetEnumerator (line 73) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); FILE: 56_Life_for_Two/csharp/Coordinates.cs type Coordinates (line 3) | internal record Coordinates (int X, int Y) FILE: 56_Life_for_Two/csharp/Game.cs class Game (line 1) | internal class Game method Game (line 5) | public Game(IReadWrite io) method Play (line 10) | public void Play() FILE: 56_Life_for_Two/csharp/Generation.cs class Generation (line 1) | internal class Generation method Generation (line 5) | public Generation(Board board) method Create (line 25) | public static Generation Create(IReadWrite io) method CalculateNextGeneration (line 44) | public Generation CalculateNextGeneration() method AddPieces (line 56) | public void AddPieces(IReadWrite io) method CountNeighbours (line 74) | private void CountNeighbours() method ToString (line 88) | public override string ToString() => _board.ToString(); FILE: 56_Life_for_Two/csharp/IOExtensions.cs class IOExtensions (line 1) | internal static class IOExtensions method ReadCoordinates (line 3) | internal static Coordinates ReadCoordinates(this IReadWrite io, int pl... method ReadCoordinates (line 9) | internal static Coordinates ReadCoordinates(this IReadWrite io, Board ... FILE: 56_Life_for_Two/csharp/Life.cs class Life (line 3) | internal class Life : IEnumerable method Life (line 7) | public Life(IReadWrite io) method GetEnumerator (line 16) | public IEnumerator GetEnumerator() method GetEnumerator (line 30) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); FILE: 56_Life_for_Two/csharp/Piece.cs type Piece (line 6) | public struct Piece method Piece (line 21) | private Piece(int value) => _value = value; method NewNone (line 26) | public static Piece NewNone() => new(None); method NewPlayer1 (line 27) | public static Piece NewPlayer1() => new(Player1); method NewPlayer2 (line 28) | public static Piece NewPlayer2() => new(Player2); method AddNeighbour (line 30) | public Piece AddNeighbour(Piece neighbour) method GetNext (line 36) | public Piece GetNext() => new( method ToString (line 44) | public override string ToString() => FILE: 56_Life_for_Two/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Formats (line 15) | internal static class Formats class Strings (line 22) | internal static class Strings method GetString (line 27) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 34) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 56_Life_for_Two/java/LifeForTwo.java class LifeForTwo (line 13) | public class LifeForTwo { method main (line 36) | public static void main(String[] args) { method initializeGrid (line 95) | private static void initializeGrid(int[][] grid) { method computeCellScoresForOneGen (line 101) | private static void computeCellScoresForOneGen(int[][] grid) { method calculatePlayersScore (line 111) | private static Scores calculatePlayersScore(int[][] grid) { method resetGridForNextGen (line 130) | private static void resetGridForNextGen(int[][] grid) { method calculateScoreForOccupiedCell (line 148) | private static void calculateScoreForOccupiedCell(int[][] grid, int i,... method printGrid (line 165) | private static void printGrid(int[][] grid) { method printRowEdge (line 181) | private static void printRowEdge() { method mapChar (line 187) | private static char mapChar(int i) { method readUntilValidCoordinates (line 197) | private static Coordinate readUntilValidCoordinates(Scanner scanner, i... method readCoordinate (line 213) | private static Coordinate readCoordinate(Scanner scanner) { method printIntro (line 240) | private static void printIntro() { class Coordinate (line 248) | private static class Coordinate { method Coordinate (line 251) | public Coordinate(int x, int y) { method getX (line 256) | public int getX() { method getY (line 260) | public int getY() { method toString (line 264) | @Override method equals (line 272) | @Override method hashCode (line 280) | @Override class Scores (line 286) | private static class Scores { method Scores (line 290) | public Scores(int player1Score, int player2Score) { method getPlayer1Score (line 295) | public int getPlayer1Score() { method getPlayer2Score (line 299) | public int getPlayer2Score() { FILE: 56_Life_for_Two/javascript/lifefortwo.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_data (line 56) | function show_data() function process_board (line 103) | function process_board() function main (line 121) | async function main() FILE: 56_Life_for_Two/python/life_for_two.py function tab (line 23) | def tab(number) -> str: function display_header (line 30) | def display_header() -> None: function setup_board (line 37) | def setup_board() -> None: function modify_board (line 47) | def modify_board() -> None: function simulate_board (line 59) | def simulate_board() -> None: function display_board (line 70) | def display_board() -> None: function query_player (line 105) | def query_player(b) -> None: function check_winner (line 130) | def check_winner(m2, m3) -> None: function main (line 144) | def main() -> None: FILE: 57_Literature_Quiz/csharp/litquiz.cs class litquiz (line 5) | class litquiz method Main (line 10) | public static void Main(string[] args) method One (line 34) | public static void One() { method Two (line 55) | public static void Two() method Three (line 78) | public static void Three() method Four (line 105) | public static void Four() method End (line 129) | public static void End() FILE: 57_Literature_Quiz/java/src/LiteratureQuiz.java class LiteratureQuiz (line 13) | public class LiteratureQuiz { type GAME_STATE (line 18) | private enum GAME_STATE { method LiteratureQuiz (line 30) | public LiteratureQuiz() { method play (line 41) | public void play() { method intro (line 128) | public void intro() { method simulateTabs (line 149) | private String simulateTabs(int spaces) { method displayTextAndGetNumber (line 162) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 172) | private String displayTextAndGetInput(String text) { FILE: 57_Literature_Quiz/java/src/LiteratureQuizGame.java class LiteratureQuizGame (line 1) | public class LiteratureQuizGame { method main (line 3) | public static void main(String[] args) { FILE: 57_Literature_Quiz/javascript/litquiz.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 57_Literature_Quiz/javascript/litquiz.mjs function printAlign (line 5) | function printAlign(message = "", align = "left") { function equalIgnoreCase (line 22) | function equalIgnoreCase(correct, provided){ function evaluateQuestion (line 26) | async function evaluateQuestion(question, answerOptions, correctAnswer, ... function main (line 37) | async function main(){ FILE: 57_Literature_Quiz/python/litquiz.py class Question (line 14) | class Question(NamedTuple): method ask (line 21) | def ask(self) -> bool: function print_centered (line 69) | def print_centered(msg: str) -> None: function print_instructions (line 74) | def print_instructions() -> None: function main (line 85) | def main() -> None: FILE: 57_Literature_Quiz/rust/src/main.rs function print_instructions (line 4) | fn print_instructions() { function print_center (line 16) | fn print_center(text: String, width: usize) { function print_results (line 27) | fn print_results(score: usize, number_of_questions: usize) { function main (line 41) | fn main() { FILE: 58_Love/csharp/LovePattern.cs class LovePattern (line 6) | internal class LovePattern method LovePattern (line 25) | public LovePattern(string message) method Fill (line 30) | private void Fill(SourceCharacters source) method ToString (line 49) | public override string ToString() => FILE: 58_Love/csharp/Resources/Resource.cs class Resource (line 7) | internal static class Resource class Streams (line 9) | internal static class Streams method GetStream (line 14) | private static Stream GetStream([CallerMemberName] string name = null) FILE: 58_Love/csharp/SourceCharacters.cs class SourceCharacters (line 5) | internal class SourceCharacters method SourceCharacters (line 12) | public SourceCharacters(int lineLength, string message) method GetCharacters (line 24) | public ReadOnlySpan GetCharacters(int count) FILE: 58_Love/csharp/StringBuilderExtensions.cs class StringBuilderExtensions (line 5) | internal static class StringBuilderExtensions method AppendLines (line 7) | internal static StringBuilder AppendLines(this StringBuilder builder, ... FILE: 58_Love/java/src/Love.java class Love (line 15) | public class Love { method Love (line 26) | public Love() { method process (line 34) | public void process() { method intro (line 99) | private void intro() { method displayTextAndGetInput (line 116) | private String displayTextAndGetInput(String text) { method addSpaces (line 127) | private String addSpaces(int spaces) { method storeData (line 145) | private ArrayList storeData() { method main (line 165) | public static void main(String[] args) { FILE: 58_Love/javascript/love.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 59) | async function main() FILE: 58_Love/python/love.py function main (line 73) | def main() -> None: FILE: 58_Love/rust/src/main.rs function show_intro (line 3) | fn show_intro() { function main (line 14) | fn main() { FILE: 59_Lunar_LEM_Rocket/javascript/lem.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 59_Lunar_LEM_Rocket/javascript/lunar.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function formula_set_1 (line 59) | function formula_set_1() function formula_set_2 (line 68) | function formula_set_2() function formula_set_3 (line 75) | function formula_set_3() function main (line 86) | async function main() FILE: 59_Lunar_LEM_Rocket/python/lunar.py class PhysicalState (line 37) | class PhysicalState(NamedTuple): function print_centered (line 42) | def print_centered(msg: str) -> None: function print_header (line 47) | def print_header(title: str) -> None: function add_rjust (line 52) | def add_rjust(line: str, s: Any, pos: int) -> str: function add_ljust (line 65) | def add_ljust(line: str, s: str, pos: int) -> str: function print_instructions (line 76) | def print_instructions() -> None: function print_intro (line 84) | def print_intro() -> None: function format_line_for_report (line 92) | def format_line_for_report( class SimulationClock (line 113) | class SimulationClock: method __init__ (line 114) | def __init__(self, elapsed_time: float, time_until_next_prompt: float)... method time_for_prompt (line 118) | def time_for_prompt(self) -> bool: method advance (line 121) | def advance(self, delta_t: float) -> None: class Capsule (line 127) | class Capsule: method remaining_fuel (line 136) | def remaining_fuel(self) -> float: method is_out_of_fuel (line 139) | def is_out_of_fuel(self) -> bool: method update_state (line 142) | def update_state( method fuel_time_remaining (line 150) | def fuel_time_remaining(self) -> float: method predict_motion (line 155) | def predict_motion(self, delta_t: float) -> PhysicalState: method make_state_display_string (line 179) | def make_state_display_string(self, sim_clock: SimulationClock) -> str: method prompt_for_burn (line 191) | def prompt_for_burn(self, sim_clock: SimulationClock) -> None: function show_landing (line 198) | def show_landing(sim_clock: SimulationClock, capsule: Capsule) -> None: function show_out_of_fuel (line 216) | def show_out_of_fuel(sim_clock: SimulationClock, capsule: Capsule) -> None: function process_final_tick (line 227) | def process_final_tick( function handle_flyaway (line 253) | def handle_flyaway(sim_clock: SimulationClock, capsule: Capsule) -> bool: function end_sim (line 287) | def end_sim() -> None: function run_simulation (line 291) | def run_simulation() -> None: function main (line 335) | def main() -> None: FILE: 59_Lunar_LEM_Rocket/rust/rocket/src/main.rs function main (line 6) | fn main() { function input (line 91) | fn input(prompt:&str) -> String { function input_int (line 99) | fn input_int(prompt:&str) -> i32 { FILE: 60_Mastermind/csharp/Code.cs class Code (line 10) | public class Code method Code (line 21) | public Code(IEnumerable colors) method Compare (line 40) | public (int blacks, int whites) Compare(Code other) method ToString (line 88) | public override string ToString() => FILE: 60_Mastermind/csharp/CodeFactory.cs class CodeFactory (line 11) | public class CodeFactory method CodeFactory (line 38) | public CodeFactory(int positions, int colors) method Create (line 60) | public Code Create(int number) => method Create (line 69) | public Code Create(Random random) => method EnumerateCodes (line 76) | public IEnumerable EnumerateCodes() FILE: 60_Mastermind/csharp/ColorInfo.cs type ColorInfo (line 8) | public record ColorInfo FILE: 60_Mastermind/csharp/Colors.cs class Colors (line 6) | public static class Colors FILE: 60_Mastermind/csharp/Command.cs type Command (line 7) | public enum Command FILE: 60_Mastermind/csharp/Controller.cs class Controller (line 10) | public static class Controller method GetNumberOfColors (line 29) | public static int GetNumberOfColors() method GetNumberOfPositions (line 48) | public static int GetNumberOfPositions() method GetNumberOfRounds (line 60) | public static int GetNumberOfRounds() method GetCommand (line 82) | public static (Command command, Code? guess) GetCommand(int moveNumber... method WaitUntilReady (line 115) | public static void WaitUntilReady() method GetBlacksWhites (line 127) | public static (int blacks, int whites) GetBlacksWhites(Code code) method GetInteger (line 152) | private static int GetInteger(Action prompt) method TranslateColor (line 172) | private static int? TranslateColor(char c) => FILE: 60_Mastermind/csharp/EnumerableExtensions.cs class EnumerableExtensions (line 11) | public static class EnumerableExtensions method Cycle (line 22) | public static IEnumerable Cycle(int start, int count) method FindFirstIndex (line 55) | public static int? FindFirstIndex(this IEnumerable source, Func<... method FirstOrDefault (line 79) | public static T FirstOrDefault(this IEnumerable source, Func history) method ShowQuitGame (line 61) | public static void ShowQuitGame(Code code) method ShowResults (line 67) | public static void ShowResults(int blacks, int whites) method ShowHumanGuessedCode (line 72) | public static void ShowHumanGuessedCode(int guessNumber) method ShowHumanFailedToGuessCode (line 77) | public static void ShowHumanFailedToGuessCode(Code code) method ShowScores (line 85) | public static void ShowScores(int humanScore, int computerScore, bool ... method ShowComputerStartTurn (line 100) | public static void ShowComputerStartTurn() method ShowInconsistentInformation (line 105) | public static void ShowInconsistentInformation() method ShowComputerGuessedCode (line 111) | public static void ShowComputerGuessedCode(int guessNumber) method ShowComputerFailedToGuessCode (line 116) | public static void ShowComputerFailedToGuessCode() method PromptNumberOfColors (line 122) | public static void PromptNumberOfColors() method PromptNumberOfPositions (line 127) | public static void PromptNumberOfPositions() method PromptNumberOfRounds (line 132) | public static void PromptNumberOfRounds() method PromptGuess (line 137) | public static void PromptGuess(int moveNumber) method PromptReady (line 142) | public static void PromptReady() method PromptBlacksWhites (line 147) | public static void PromptBlacksWhites(Code code) method PromptTwoValues (line 153) | public static void PromptTwoValues() method PromptValidInteger (line 158) | public static void PromptValidInteger() method NotifyBadNumberOfPositions (line 163) | public static void NotifyBadNumberOfPositions() method NotifyInvalidColor (line 168) | public static void NotifyInvalidColor(char colorKey) method NotifyTooManyColors (line 173) | public static void NotifyTooManyColors(int maxColors) FILE: 60_Mastermind/java/Mastermind.java class Mastermind (line 35) | public class Mastermind { method pf (line 38) | static private void pf(String s, Object... o){ System.out.printf(s, o);} method pl (line 39) | static private void pl(String s){System.out.println(s);} method pl (line 40) | static private void pl(){System.out.println();} method main (line 42) | public static void main(String[] args) { type Color (line 51) | private enum Color { method Color (line 56) | Color(String name) { method play (line 69) | private void play() { method setup (line 80) | private static Mastermind setup() { method getMaxPositions (line 107) | private static int getMaxPositions(int numOfColors){ method Mastermind (line 123) | public Mastermind(int numOfColors, int positions, int rounds, int maxT... method playRound (line 143) | private void playRound(int round) { method humanTurn (line 150) | private void humanTurn() { method computerTurn (line 182) | private void computerTurn(){ method evaluateGuess (line 230) | private Guess evaluateGuess(int guessNum, String guess, String secretC... method validateGuess (line 260) | private boolean validateGuess(String guess) { method getScore (line 264) | private String getScore() { method printGuess (line 269) | private void printGuess(Guess g){ method displayBoard (line 273) | private void displayBoard() { method quit (line 281) | private void quit(String secretCode) { method generateColorCode (line 290) | private String generateColorCode() { method generateSolutionID (line 301) | private int generateSolutionID() { method solutionIdToColorCode (line 318) | private String solutionIdToColorCode(final int solution) { method displayColorCodes (line 331) | private static void displayColorCodes(int numOfColors) { method title (line 340) | private static void title() { method getInput (line 362) | private static T getInput(String descriptor, method getPositiveNumber (line 391) | private static int getPositiveNumber() { method getPositiveNumberUpTo (line 395) | private static int getPositiveNumberUpTo(long to) { method getPegCount (line 402) | private static int[] getPegCount(int upperBound) { method getWord (line 420) | private static String getWord() { FILE: 60_Mastermind/javascript/mastermind.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function initialize_qa (line 59) | function initialize_qa() function increment_qa (line 65) | function increment_qa() function convert_qa (line 83) | function convert_qa() function get_number (line 90) | function get_number() function convert_qa_hs (line 115) | function convert_qa_hs() function copy_hs (line 122) | function copy_hs() function board_printout (line 129) | function board_printout() function quit (line 150) | function quit() function show_score (line 161) | function show_score() function show_points (line 167) | function show_points() function main (line 178) | async function main() FILE: 60_Mastermind/python/mastermind.py function setup_game (line 7) | def setup_game() -> Tuple[int, int, int, int]: function main (line 39) | def main() -> None: function human_turn (line 50) | def human_turn() -> None: function computer_turn (line 92) | def computer_turn() -> None: function find_first_solution_of (line 139) | def find_first_solution_of(all_possibilities: List[int]) -> int: function get_invalid_letters (line 152) | def get_invalid_letters(user_command) -> str: function print_board (line 163) | def print_board(guesses) -> None: function possibility_to_color_code (line 171) | def possibility_to_color_code(possibility: int) -> str: function compare_two_positions (line 189) | def compare_two_positions(guess: str, answer: str) -> List[Union[str, in... function print_score (line 214) | def print_score(is_final_score: bool = False) -> None: FILE: 60_Mastermind/rust/Mastermind/src/main.rs constant COLORS (line 5) | const COLORS: [&str;8] = ["Black ", "White ","Red ","Green ","Orange ","... constant LETTERS (line 6) | const LETTERS: &str = "BWRGOYPT"; type CODE (line 8) | struct CODE { method new (line 16) | fn new() -> CODE { method new_random (line 22) | fn new_random(rng: &mut ThreadRng, num_colors: usize, num_positions: u... method new_from_int (line 35) | fn new_from_int(mut input_int: usize, num_colors: usize, num_positions... method new_from_string (line 54) | fn new_from_string(input_string: String, num_colors: usize) -> Option<... method _as_human_readible_chars (line 72) | fn _as_human_readible_chars(&self) -> String { method _as_human_readible_words (line 78) | fn _as_human_readible_words(&self) -> String { type GUESS (line 82) | struct GUESS { method new (line 91) | fn new(code: CODE) -> GUESS { method evaluate (line 98) | fn evaluate(&mut self, answer:&CODE) { function main (line 125) | fn main() { function welcome (line 347) | fn welcome() { function print_scores (line 359) | fn print_scores(human_score:usize, computer_score:usize) { function print_color_letter_table (line 367) | fn print_color_letter_table(num_colors: usize) { function print_board (line 375) | fn print_board(guesses: &Vec) { function get_number_from_user_input (line 390) | fn get_number_from_user_input(prompt:... FILE: 60_Mastermind/rust/Mastermind_refactored_for_conventions/src/lib.rs constant COLORS (line 10) | const COLORS: [&str;8] = ["Black ", "White ","Red ","Green ","Orange ","... constant LETTERS (line 11) | const LETTERS: &str = "BWRGOYPT"; type Config (line 14) | pub struct Config { method new (line 23) | pub fn new() -> Result> { function run (line 75) | pub fn run(config: &Config) -> Result<(), Box> { function play_round_computer_codemaker (line 111) | fn play_round_computer_codemaker(config: &Config) -> Option { function play_round_human_codemaker (line 174) | fn play_round_human_codemaker(config: &Config) -> Option{ type Code (line 283) | struct Code { method new (line 290) | fn new() -> Code { method new_from_int (line 295) | fn new_from_int(mut input_int: usize, config: &Config) -> Code { method new_from_string (line 312) | fn new_from_string(input_string: &str, config: &Config) -> Result String { method evaluate (line 338) | fn evaluate(&mut self, secret:&Code) -> Result<(),Box> { function print_scores (line 370) | fn print_scores(human_score:usize, computer_score:usize) { function print_color_letter_table (line 375) | fn print_color_letter_table(num_colors:usize) { function print_board (line 383) | fn print_board(guesses: &[Code]) { function get_string_from_user_input (line 394) | fn get_string_from_user_input(prompt: &str) -> Result(prompt: &str,... FILE: 60_Mastermind/rust/Mastermind_refactored_for_conventions/src/main.rs function main (line 12) | fn main() { function welcome (line 33) | fn welcome() { FILE: 61_Math_Dice/csharp/GameState.cs type GameState (line 3) | public enum GameState FILE: 61_Math_Dice/csharp/Program.cs class Program (line 5) | public static class Program method Main (line 19) | static void Main(string[] args) method GetAnswer (line 77) | private static int GetAnswer() method DrawDie (line 89) | private static void DrawDie(int pips) method Roll (line 99) | private static void Roll(ref int die) => die = random.Next(1, 7); method OuterRow (line 101) | private static string OuterRow(int pips, bool top) method CentreRow (line 111) | private static string CentreRow(int pips) FILE: 61_Math_Dice/csharp/StringExtensions.cs class StringExtensions (line 3) | public static class StringExtensions method CentreAlign (line 7) | public static string CentreAlign(this string value) FILE: 61_Math_Dice/java/Die.java class Die (line 3) | public class Die { method Die (line 12) | public Die() { method throwDie (line 20) | private void throwDie() { method getFaceValue (line 28) | public int getFaceValue() { method printDie (line 33) | public void printDie() { method printZero (line 66) | private void printZero() { method printTwo (line 70) | private void printTwo() { FILE: 61_Math_Dice/java/MathDice.java class MathDice (line 3) | public class MathDice { method main (line 5) | public static void main(String[] args) { FILE: 61_Math_Dice/javascript/mathdice.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 61_Math_Dice/python/mathdice.py function print_dice (line 16) | def print_dice(n: int) -> None: function main (line 49) | def main() -> None: FILE: 61_Math_Dice/ruby/mathdice.rb function intro (line 1) | def intro function game_play (line 12) | def game_play function print_dice (line 52) | def print_dice(roll) function print_one_left (line 85) | def print_one_left function print_one_mid (line 89) | def print_one_mid function print_one_right (line 93) | def print_one_right function print_two (line 97) | def print_two function print_blank (line 101) | def print_blank function main (line 107) | def main FILE: 61_Math_Dice/rust/src/main.rs function main (line 4) | fn main() { function welcome (line 58) | fn welcome() { function print_dice (line 73) | fn print_dice(dice_value:u8) { function get_number_from_user_input (line 106) | fn get_number_from_user_input(prompt: &str, error_message: &str, min:u8,... FILE: 62_Mugwump/csharp/Distance.cs type Distance (line 3) | internal struct Distance method Distance (line 7) | public Distance(float deltaX, float deltaY) method ToString (line 12) | public override string ToString() => _value.ToString("0.0"); FILE: 62_Mugwump/csharp/Game.cs class Game (line 5) | internal class Game method Game (line 10) | internal Game(TextIO io, IRandom random) method Play (line 16) | internal void Play(Func playAgain = null) method DisplayIntro (line 30) | private void DisplayIntro() method Play (line 37) | private void Play(Grid grid) FILE: 62_Mugwump/csharp/Grid.cs class Grid (line 6) | internal class Grid method Grid (line 11) | public Grid(TextIO io, IRandom random) method Check (line 17) | public bool Check(Position guess) method Reveal (line 33) | public void Reveal() FILE: 62_Mugwump/csharp/IRandomExtensions.cs class IRandomExtensions (line 3) | internal static class IRandomExtensions method NextPosition (line 5) | internal static Position NextPosition(this IRandom random, int maxX, i... FILE: 62_Mugwump/csharp/Mugwump.cs class Mugwump (line 3) | internal class Mugwump method Mugwump (line 8) | public Mugwump(int id, Position position) method FindFrom (line 14) | public (bool, Distance) FindFrom(Position guess) => (guess == _positio... method Reveal (line 16) | public string Reveal() => $"{this} is at {_position}"; method ToString (line 18) | public override string ToString() => $"Mugwump {_id}"; FILE: 62_Mugwump/csharp/Position.cs type Position (line 3) | internal record struct Position(float X, float Y) FILE: 62_Mugwump/csharp/TextIOExtensions.cs class TextIOExtensions (line 4) | internal static class TextIOExtensions method ReadGuess (line 6) | internal static Position ReadGuess(this TextIO io, string prompt) FILE: 62_Mugwump/java/src/Mugwump.java class Mugwump (line 14) | public class Mugwump { type GAME_STATE (line 25) | private enum GAME_STATE { method Mugwump (line 38) | public Mugwump() { method play (line 46) | public void play() { method intro (line 130) | private void intro() { method getDelimitedValue (line 153) | private int getDelimitedValue(String text, int pos) { method displayTextAndGetInput (line 164) | private String displayTextAndGetInput(String text) { method addSpaces (line 175) | private String addSpaces(int spaces) { method main (line 181) | public static void main(String[] args) { FILE: 62_Mugwump/javascript/mugwump.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 62_Mugwump/python/mugwump.py function introduction (line 6) | def introduction() -> None: function generate_mugwumps (line 22) | def generate_mugwumps(n: int = 4) -> List[List[int]]: function reveal_mugwumps (line 30) | def reveal_mugwumps(mugwumps: List[List[int]]) -> None: function calculate_distance (line 37) | def calculate_distance(guess: Tuple[int, int], mugwump: List[int]) -> fl... function play_again (line 41) | def play_again() -> None: function play_round (line 50) | def play_round() -> None: FILE: 62_Mugwump/rust/src/coordinate.rs type Coordinate (line 4) | pub struct Coordinate { method new (line 12) | pub fn new(pos: (u8, u8), has_mugwump: bool, mugwump_number: i32) -> S... method get_pos (line 30) | pub fn get_pos(&self) -> (u8, u8) { type CoordState (line 36) | pub enum CoordState { FILE: 62_Mugwump/rust/src/draw.rs function draw_board (line 3) | pub fn draw_board(coords: &Vec, show_mugwumps: bool) { FILE: 62_Mugwump/rust/src/game.rs type Game (line 9) | pub struct Game { method new (line 16) | pub fn new(show_board: bool) -> Self { method tick (line 59) | pub fn tick(&mut self) -> Option { method check_position (line 98) | fn check_position(&mut self, pos: (u8, u8)) { method print_distances (line 117) | fn print_distances(&self, (x, y): (u8, u8)) { method input_coordinate (line 134) | fn input_coordinate(&self) -> (u8, u8) { method get_mugwumps (line 156) | fn get_mugwumps(&self) -> Vec<&Coordinate> { FILE: 62_Mugwump/rust/src/main.rs function main (line 8) | fn main() { FILE: 62_Mugwump/rust/src/util.rs function prompt (line 3) | pub fn prompt(msg: &str) -> String { function prompt_bool (line 15) | pub fn prompt_bool(msg: &str) -> Option { FILE: 63_Name/csharp/Program.cs class Program (line 5) | public class Program method Main (line 7) | static void Main(string[] args) FILE: 63_Name/csharp/StringExtensions.cs class StringExtensions (line 5) | public static class StringExtensions method CentreAlign (line 9) | public static string CentreAlign(this string value) method Reverse (line 17) | public static string Reverse(this string value) method Sort (line 29) | public static string Sort(this string value) FILE: 63_Name/java/Name.java class Name (line 4) | public class Name { method printempty (line 6) | public static void printempty() { System.out.println(" "); } method print (line 8) | public static void print(String toprint) { System.out.println(toprint); } method main (line 10) | public static void main(String[] args) { FILE: 63_Name/javascript/name.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 49) | async function main() FILE: 63_Name/python/name.py function is_yes_ish (line 10) | def is_yes_ish(answer: str) -> bool: function main (line 15) | def main() -> None: FILE: 63_Name/ruby/name.rb function is_yes_ish (line 1) | def is_yes_ish answer function main (line 7) | def main FILE: 63_Name/rust/src/main.rs function main (line 11) | fn main() { FILE: 64_Nicomachus/csharp/program.cs class Nicomachus (line 6) | class Nicomachus method DisplayIntro (line 8) | private void DisplayIntro() method PromptYesNo (line 19) | private bool PromptYesNo(string Prompt) method PromptForNumber (line 39) | private int PromptForNumber(string Prompt) method PlayOneRound (line 56) | private void PlayOneRound() method Play (line 98) | public void Play() class Program (line 113) | class Program method Main (line 115) | static void Main(string[] args) FILE: 64_Nicomachus/java/src/Nicomachus.java class Nicomachus (line 14) | public class Nicomachus { type GAME_STATE (line 21) | private enum GAME_STATE { method Nicomachus (line 35) | public Nicomachus() { method play (line 43) | public void play() throws Exception { method intro (line 104) | private void intro() { method displayTextAndGetNumber (line 119) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 129) | private String displayTextAndGetInput(String text) { method addSpaces (line 140) | private String addSpaces(int spaces) { method yesEntered (line 152) | private boolean yesEntered(String text) { method noEntered (line 162) | private boolean noEntered(String text) { method stringIsAnyValue (line 175) | private boolean stringIsAnyValue(String text, String... values) { method main (line 180) | public static void main(String[] args) throws Exception { FILE: 64_Nicomachus/javascript/nicomachus.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 49) | async function main() FILE: 64_Nicomachus/python/nicomachus.py function get_yes_or_no (line 18) | def get_yes_or_no() -> bool: function play_game (line 28) | def play_game() -> None: function main (line 54) | def main() -> None: FILE: 64_Nicomachus/rust/src/main.rs function main (line 3) | fn main() { function question (line 33) | fn question(n: &str) -> i32 { function prompt (line 46) | fn prompt(msg: String) -> bool { function read_line (line 63) | fn read_line() -> String { FILE: 65_Nim/javascript/nim.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 50) | async function main() function game_completed (line 261) | function game_completed() FILE: 65_Nim/python/Traditional_NIM.py class NIM (line 5) | class NIM: method __init__ (line 6) | def __init__(self) -> None: method remove_pegs (line 9) | def remove_pegs(self, command) -> None: method get_ai_move (line 32) | def get_ai_move(self) -> Tuple[int, int]: method _command_integrity (line 40) | def _command_integrity(self, num, pile) -> bool: method print_pegs (line 43) | def print_pegs(self) -> None: method help (line 47) | def help(self) -> None: method check_for_win (line 61) | def check_for_win(self) -> bool: function main (line 69) | def main() -> None: FILE: 65_Nim/ruby/nim.rb function displayTheRules (line 17) | def displayTheRules function sub1570 (line 33) | def sub1570 function playAnother (line 44) | def playAnother function sub490 (line 62) | def sub490 # get number of piles function getPileSizes (line 69) | def getPileSizes function sub440 (line 82) | def sub440 # get win option function machineMove (line 111) | def machineMove function machineLoses (line 135) | def machineLoses function machineWins (line 143) | def machineWins function sub840 (line 151) | def sub840 function sub920 (line 167) | def sub920 function sub940 (line 176) | def sub940 function sub1380 (line 237) | def sub1380 function yourMove (line 252) | def yourMove FILE: 65_Nim/rust/src/main.rs function main (line 14) | fn main() { type WinState (line 133) | enum WinState { method is_game_on (line 143) | fn is_game_on(&self) -> bool { function machines_turn (line 149) | fn machines_turn( function human_turn (line 311) | fn human_turn(winner_take_last: bool, np: i32, piles: &mut [f64; 100]) -... function one_if_all_zero (line 343) | fn one_if_all_zero(np: i32, piles: &[f64; 100]) -> i32 { function instructions (line 356) | fn instructions() { function input (line 373) | fn input(prompt: &str) -> String { function input_int (line 385) | fn input_int(prompt: &str) -> i32 { function input_2int (line 396) | fn input_2int(prompt: &str) -> (i32, i32) { FILE: 66_Number/csharp/program.cs class Number (line 5) | class Number method DisplayIntro (line 7) | private void DisplayIntro() method PromptForGuess (line 24) | private int PromptForGuess() method GetRandomNumbers (line 46) | private void GetRandomNumbers(out int Random1, out int Random2, out in... method Play (line 71) | private void Play() method PlayTheGame (line 110) | public void PlayTheGame() class Program (line 117) | class Program method Main (line 119) | static void Main(string[] args) FILE: 66_Number/java/1/Number.java class Number (line 7) | public class Number { method printempty (line 11) | public static void printempty() { System.out.println(" "); } method print (line 13) | public static void print(String toprint) { System.out.println(toprint); } method main (line 15) | public static void main(String[] args) { FILE: 66_Number/java/2/Number.java class Number (line 3) | public class Number { method main (line 5) | public static void main(String[] args) { method randomNumber (line 46) | private static int randomNumber(int x) { method printIntro (line 51) | private static void printIntro() { FILE: 66_Number/javascript/number.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 66_Number/python/number.py function print_instructions (line 12) | def print_instructions() -> None: function fnr (line 22) | def fnr() -> int: function main (line 26) | def main() -> None: FILE: 66_Number/rust/src/main.rs function main (line 4) | fn main() { function welcome (line 48) | fn welcome() { FILE: 67_One_Check/csharp/Board.cs class Board (line 3) | internal class Board method Board (line 9) | public Board() method PlayMove (line 25) | public bool PlayMove(IReadWrite io) method TryMove (line 44) | public bool TryMove(Move move) method IsPieceJumpingPieceToEmptySpace (line 58) | private bool IsPieceJumpingPieceToEmptySpace(Move move) => this[move.F... method GetReport (line 60) | public string GetReport() => string.Format(Formats.Results, _moveCount... method ToString (line 62) | public override string ToString() => FILE: 67_One_Check/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 7) | public Game(IReadWrite io) method Play (line 12) | public void Play() class IOExtensions (line 32) | internal static class IOExtensions method ReadYesNo (line 34) | internal static string ReadYesNo(this IReadWrite io, string prompt) FILE: 67_One_Check/csharp/Move.cs class Move (line 3) | internal class Move FILE: 67_One_Check/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Formats (line 16) | internal static class Formats class Prompts (line 21) | internal static class Prompts class Strings (line 28) | internal static class Strings method GetString (line 34) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 42) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 67_One_Check/java/OneCheck.java class OneCheck (line 16) | public class OneCheck { type Step (line 20) | private enum Step { method OneCheck (line 24) | public OneCheck() { method play (line 30) | public void play() { method showIntro (line 37) | private static void showIntro() { method startGame (line 45) | private void startGame() { method printBoard (line 220) | public void printBoard(int[] positions) { method main (line 245) | public static void main(String[] args) { FILE: 67_One_Check/javascript/onecheck.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 67_One_Check/python/onecheck.py function main (line 10) | def main() -> None: function play_game (line 45) | def play_game() -> Tuple[str, str]: function try_again (line 105) | def try_again() -> bool: FILE: 68_Orbit/csharp/program.cs class Orbit (line 5) | class Orbit method DisplayIntro (line 7) | private void DisplayIntro() method PromptYesNo (line 76) | private bool PromptYesNo(string Prompt) method PromptForNumber (line 96) | private int PromptForNumber(string Prompt) method PlayOneRound (line 113) | private void PlayOneRound() method Play (line 172) | public void Play() class Program (line 190) | class Program method Main (line 192) | static void Main(string[] args) FILE: 68_Orbit/java/Orbit.java class Orbit (line 17) | public class Orbit { method Orbit (line 21) | public Orbit() { method play (line 27) | public void play() { method showIntro (line 34) | private static void showIntro() { method startGame (line 101) | private void startGame() { method main (line 185) | public static void main(String[] args) { FILE: 68_Orbit/javascript/orbit.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 68_Orbit/python/orbit.py function print_centered (line 15) | def print_centered(msg: str) -> None: function print_instructions (line 20) | def print_instructions() -> None: function get_yes_or_no (line 84) | def get_yes_or_no() -> bool: function game_over (line 95) | def game_over(is_success: bool) -> bool: function play_game (line 106) | def play_game() -> bool: function main (line 144) | def main() -> None: FILE: 68_Orbit/ruby/orbit.rb function print_centered (line 3) | def print_centered(msg) function print_instructions (line 8) | def print_instructions function get_yes_or_no (line 60) | def get_yes_or_no() function game_over (line 73) | def game_over(is_success) function play_game (line 84) | def play_game function main (line 115) | def main FILE: 68_Orbit/rust/src/lib.rs type Config (line 10) | pub struct Config { method new (line 14) | pub fn new() -> Result> { function run (line 26) | pub fn run(_config: &Config) -> Result<(), Box> { function play_game (line 38) | fn play_game() -> bool { type Polar (line 91) | struct Polar { method new (line 97) | fn new(angle:f64, radius:f64) -> Polar { method new_from_degrees (line 105) | fn new_from_degrees(angle:usize, radius:f64) -> Polar { method distance_from (line 111) | fn distance_from(&self,other:&Polar) -> f64 { function get_bomb_from_user_input (line 117) | fn get_bomb_from_user_input() -> Polar { function get_string_from_user_input (line 145) | fn get_string_from_user_input(prompt: &str) -> Result(prompt: &str,... FILE: 68_Orbit/rust/src/main.rs function main (line 15) | fn main() { function welcome (line 36) | fn welcome() { FILE: 69_Pizza/csharp/CustomerMap.cs class CustomerMap (line 5) | internal class CustomerMap method CustomerMap (line 10) | public CustomerMap(int mapSize) method GetCustomerOnPosition (line 22) | public string GetCustomerOnPosition(int x, int y) method ToString (line 36) | public override string ToString() method IsPositionOutOfRange (line 75) | private bool IsPositionOutOfRange(int x, int y) method GenerateCustomerMap (line 86) | private string[,] GenerateCustomerMap() method GetCustomerNames (line 108) | private static string[] GetCustomerNames(int numberOfCustomers) method AppendXLine (line 119) | private void AppendXLine(StringBuilder mapToDisplay, int horizontalSpace) FILE: 69_Pizza/csharp/PizzaGame.cs class PizzaGame (line 3) | internal class PizzaGame method Play (line 12) | public void Play() method StartDelivery (line 41) | private void StartDelivery(string playerName) method GetRandomCustomer (line 71) | private string GetRandomCustomer() method DeliverPizzaByPlayer (line 84) | private void DeliverPizzaByPlayer(string playerName, string deliverPiz... method GetCustomerFromPlayerInput (line 111) | private string GetCustomerFromPlayerInput(string userInput) method ShowHeader (line 129) | private void ShowHeader() method GetPlayerName (line 142) | private string GetPlayerName() method ShowIntroduction (line 151) | private void ShowIntroduction(string playerName) method ShowMap (line 162) | private void ShowMap() method AskForMoreDirections (line 182) | private bool AskForMoreDirections() method ShowMoreDirections (line 194) | private void ShowMoreDirections(string playerName) method AskIfPlayerUnderstand (line 209) | private bool AskIfPlayerUnderstand() method EndDelivery (line 231) | private void EndDelivery(string playerName) method GetPlayerInput (line 242) | private string GetPlayerInput(string question) method AskQuestionWithYesNoResponse (line 261) | private static bool AskQuestionWithYesNoResponse(string question) method WriteEmptyLine (line 288) | private void WriteEmptyLine(int numberOfEmptyLines = 1) FILE: 69_Pizza/csharp/Program.cs class Program (line 3) | internal class Program method Main (line 5) | static void Main(string[] args) FILE: 69_Pizza/csharp/StringBuilderExtensions.cs class StringBuilderExtensions (line 5) | internal static class StringBuilderExtensions method AppendLine (line 13) | public static void AppendLine(this StringBuilder stringBuilder, string... FILE: 69_Pizza/java/src/Pizza.java class Pizza (line 12) | public class Pizza { type GAME_STATE (line 16) | private enum GAME_STATE { method Pizza (line 48) | public Pizza() { method play (line 59) | public void play() { method drawMap (line 185) | private void drawMap() { method intro (line 216) | private void intro() { method extendedIntro (line 225) | private void extendedIntro() { method displayMoreDirections (line 235) | private void displayMoreDirections() { method init (line 247) | private void init() { method getDelimitedValue (line 259) | private int getDelimitedValue(String text, int pos) { method yesEntered (line 271) | private boolean yesEntered(String text) { method yesOrNoEntered (line 282) | private boolean yesOrNoEntered(String text) { method stringIsAnyValue (line 294) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 313) | private String displayTextAndGetInput(String text) { FILE: 69_Pizza/java/src/PizzaGame.java class PizzaGame (line 1) | public class PizzaGame { method main (line 3) | public static void main(String[] args) { FILE: 69_Pizza/javascript/pizza.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 50) | async function main() FILE: 69_Pizza/python/pizza.py function print_centered (line 17) | def print_centered(msg: str) -> None: function print_header (line 22) | def print_header(title: str) -> None: function print_ticks (line 30) | def print_ticks() -> None: function print_ruler (line 35) | def print_ruler() -> None: function print_street (line 39) | def print_street(i: int) -> None: function print_map (line 55) | def print_map() -> None: function print_instructions (line 67) | def print_instructions() -> str: function yes_no_prompt (line 92) | def yes_no_prompt(msg: str) -> bool: function print_more_directions (line 104) | def print_more_directions(player_name: str) -> None: function calculate_customer_index (line 116) | def calculate_customer_index(x: int, y: int) -> int: function deliver_to (line 120) | def deliver_to(customer_index, customer_name, player_name) -> bool: function play_game (line 136) | def play_game(num_turns, player_name) -> None: function main (line 153) | def main() -> None: FILE: 69_Pizza/ruby/pizza.rb class Pizza (line 1) | class Pizza method start (line 4) | def start method print_street (line 35) | def print_street index method print_map (line 52) | def print_map method print_instructions (line 64) | def print_instructions method yes_no_prompt (line 83) | def yes_no_prompt msg method print_more_directions (line 103) | def print_more_directions player_name method calculate_customer_index (line 113) | def calculate_customer_index x,y method deliver_to (line 117) | def deliver_to customer_index, customer_name, player_name method play_game (line 136) | def play_game num_turns, player_name FILE: 69_Pizza/rust/src/main.rs function print_centered (line 4) | fn print_centered(text: &str) { function read_line (line 8) | fn read_line() -> Result { function read_number (line 15) | fn read_number() -> Result { function print_banner (line 21) | fn print_banner() { function print_instructions (line 29) | fn print_instructions() -> Result { function print_ruler (line 54) | fn print_ruler() { function print_ticks (line 58) | fn print_ticks() { function print_street (line 65) | fn print_street(i: u32) { function print_map (line 81) | fn print_map() { function yes_no_prompt (line 94) | fn yes_no_prompt(text: &str) -> Result> { function play_game (line 104) | fn play_game(turns: u32, player_name: &str) -> Result<()> { function main (line 134) | fn main() -> Result<()> { FILE: 70_Poetry/csharp/Context.cs class Context (line 3) | internal class Context method Context (line 14) | public Context(IReadWrite io, IRandom random) method WritePhrase (line 35) | public void WritePhrase() method MaybeWriteComma (line 41) | public void MaybeWriteComma() method WriteSpaceOrNewLine (line 51) | public void WriteSpaceOrNewLine() method Update (line 65) | public void Update(IRandom random) method MaybeIndent (line 72) | public void MaybeIndent() method ResetGroup (line 80) | public void ResetGroup() method MaybeCompleteStanza (line 86) | public bool MaybeCompleteStanza() method MaybeCapitalise (line 99) | internal string MaybeCapitalise(string text) => method SkipNextComma (line 102) | public void SkipNextComma() => _skipComma = true; method EndLine (line 104) | public void EndLine() FILE: 70_Poetry/csharp/Phrase.cs class Phrase (line 3) | internal class Phrase method Phrase (line 45) | private Phrase(Predicate condition, string text) method Phrase (line 50) | private Phrase(string text, Action update) method Phrase (line 55) | private Phrase(string text) method Phrase (line 60) | private Phrase(Predicate condition, string text, Action _phrases[context.Gr... method Write (line 69) | public void Write(IReadWrite io, Context context) FILE: 70_Poetry/csharp/Poem.cs class Poem (line 5) | internal class Poem method Compose (line 7) | internal static void Compose(IReadWrite io, IRandom random) FILE: 70_Poetry/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams method GetStream (line 13) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 70_Poetry/java/Poetry.java class Poetry (line 13) | public class Poetry { type Step (line 19) | private enum Step { method play (line 24) | public void play() { method showIntro (line 31) | private void showIntro() { method startGame (line 39) | private void startGame() { method main (line 259) | public static void main(String[] args) { FILE: 70_Poetry/javascript/poetry.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 70_Poetry/python/poetry.py class State (line 16) | class State: function print_centered (line 25) | def print_centered(msg: str) -> None: function process_phrase_1 (line 30) | def process_phrase_1(state: State) -> str: function process_phrase_2 (line 42) | def process_phrase_2(state: State) -> None: function process_phrase_3 (line 56) | def process_phrase_3(state: State) -> None: function process_phrase_4 (line 70) | def process_phrase_4(state: State) -> None: function maybe_comma (line 82) | def maybe_comma(state: State) -> None: function pick_phrase (line 99) | def pick_phrase(state: State) -> None: function main (line 110) | def main() -> None: FILE: 70_Poetry/ruby/poetry.rb class State (line 3) | class State method initialize (line 6) | def initialize function print_centered (line 17) | def print_centered msg function process_phrase_1 (line 22) | def process_phrase_1 state function process_phrase_2 (line 35) | def process_phrase_2 state function process_phrase_3 (line 50) | def process_phrase_3 state function process_phrase_4 (line 65) | def process_phrase_4 state function maybe_comma (line 77) | def maybe_comma state function pick_phrase (line 97) | def pick_phrase state function main (line 108) | def main FILE: 71_Poker/csharp/Cards/Card.cs type Card (line 3) | internal record struct Card (Rank Rank, Suit Suit) FILE: 71_Poker/csharp/Cards/Deck.cs class Deck (line 5) | internal class Deck method Deck (line 10) | public Deck() method Shuffle (line 15) | public void Shuffle(IRandom _random) method DealCard (line 25) | public Card DealCard() => _cards[_nextCard++]; method DealHand (line 27) | public Hand DealHand() => new Hand(Enumerable.Range(0, 5).Select(_ => ... FILE: 71_Poker/csharp/Cards/Hand.cs class Hand (line 5) | internal class Hand method Hand (line 11) | private Hand() method Hand (line 17) | public Hand(IEnumerable cards) method Hand (line 22) | private Hand(IEnumerable cards, bool isAfterDraw) method Replace (line 38) | public Hand Replace(int cardNumber, Card newCard) method Analyze (line 46) | private (HandRank, Card, int) Analyze() method ToString (line 107) | public override string ToString() FILE: 71_Poker/csharp/Cards/HandRank.cs class HandRank (line 3) | internal class HandRank method HandRank (line 21) | private HandRank(int value, string displayName, Func? su... method ToString (line 28) | public string ToString(Card highCard) => $"{_displayName}{_suffixSelec... FILE: 71_Poker/csharp/Cards/Rank.cs type Rank (line 3) | internal struct Rank : IComparable method Rank (line 27) | private Rank(int value, string? name = null) method ToString (line 33) | public override string ToString() => _name; method CompareTo (line 35) | public int CompareTo(Rank other) => this - other; method Equals (line 47) | public override bool Equals(object? obj) => obj is Rank other && this ... method GetHashCode (line 49) | public override int GetHashCode() => _value.GetHashCode(); FILE: 71_Poker/csharp/Cards/Suit.cs type Suit (line 3) | internal enum Suit FILE: 71_Poker/csharp/Game.cs class Game (line 7) | internal class Game method Game (line 12) | public Game(IReadWrite io, IRandom random) method Play (line 18) | internal void Play() FILE: 71_Poker/csharp/IReadWriteExtensions.cs class IReadWriteExtensions (line 6) | internal static class IReadWriteExtensions method ReadYesNo (line 8) | internal static bool ReadYesNo(this IReadWrite io, string prompt) method ReadNumber (line 19) | internal static float ReadNumber(this IReadWrite io) => io.ReadNumber(... method ReadNumber (line 21) | internal static int ReadNumber(this IReadWrite io, string prompt, int ... method ReadHumanStrategy (line 32) | internal static Strategy ReadHumanStrategy(this IReadWrite io, bool no... FILE: 71_Poker/csharp/Players/Computer.cs class Computer (line 7) | internal class Computer : Player method Computer (line 12) | public Computer(int bank, IReadWrite io, IRandom random) method NewHand (line 22) | public override void NewHand() method DrawCards (line 38) | protected override void DrawCards(Deck deck) method GetWager (line 68) | public int GetWager(int wager) method TryBuyWatch (line 90) | public bool TryBuyWatch() method RaiseFunds (line 110) | public void RaiseFunds() method CheckFunds (line 123) | public void CheckFunds() { IsBroke = Balance <= Table.Ante; } method TakeWinnings (line 125) | public override void TakeWinnings() FILE: 71_Poker/csharp/Players/Human.cs class Human (line 6) | internal class Human : Player method Human (line 10) | public Human(int bank, IReadWrite io) method DrawCards (line 19) | protected override void DrawCards(Deck deck) method SetWager (line 34) | internal bool SetWager() method RaiseFunds (line 60) | public void RaiseFunds() method ReceiveWatch (line 73) | public void ReceiveWatch() method SellWatch (line 79) | public void SellWatch(int amount) method TakeWinnings (line 85) | public override void TakeWinnings() FILE: 71_Poker/csharp/Players/Player.cs class Player (line 5) | internal abstract class Player method Player (line 10) | protected Player(int bank) method Sit (line 26) | public void Sit(Table table) => _table = table; method NewHand (line 28) | public virtual void NewHand() method AnteUp (line 35) | public int AnteUp() method DrawCards (line 41) | public void DrawCards() method DrawCards (line 47) | protected abstract void DrawCards(Deck deck); method TakeWinnings (line 49) | public virtual void TakeWinnings() method Fold (line 55) | public void Fold() FILE: 71_Poker/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams method GetStream (line 14) | private static Stream GetStream([CallerMemberName] string? name = null) FILE: 71_Poker/csharp/Strategies/Bet.cs class Bet (line 3) | internal class Bet : Strategy method Bet (line 5) | public Bet(int amount) => Value = amount; FILE: 71_Poker/csharp/Strategies/Bluff.cs class Bluff (line 3) | internal class Bluff : Bet method Bluff (line 5) | public Bluff(int amount, int? keepMask) FILE: 71_Poker/csharp/Strategies/Check.cs class Check (line 3) | internal class Check : Strategy FILE: 71_Poker/csharp/Strategies/Fold.cs class Fold (line 3) | internal class Fold : Strategy FILE: 71_Poker/csharp/Strategies/None.cs class None (line 3) | internal class None : Strategy FILE: 71_Poker/csharp/Strategies/Raise.cs class Raise (line 3) | internal class Raise : Bet method Raise (line 5) | public Raise() : base(2) { } FILE: 71_Poker/csharp/Strategies/Strategy.cs class Strategy (line 3) | internal abstract class Strategy method Bet (line 9) | public static Strategy Bet(float amount) => new Bet((int)amount); method Bet (line 10) | public static Strategy Bet(int amount) => new Bet(amount); method Bluff (line 11) | public static Strategy Bluff(int amount, int? keepMask = null) => new ... FILE: 71_Poker/csharp/Table.cs class Table (line 7) | internal class Table method Table (line 13) | public Table(IReadWrite io, IRandom random, Deck deck, Human human, Co... method PlayHand (line 30) | internal void PlayHand() method Deal (line 69) | private void Deal(IRandom random) method Draw (line 82) | private void Draw() method GetWagers (line 91) | private void GetWagers(string betFormat, string checkMessage, bool all... method GetWagers (line 109) | private void GetWagers() method CollectBets (line 151) | internal void CollectBets() method SomeoneHasFolded (line 158) | private bool SomeoneHasFolded() method SomeoneIsBroke (line 179) | private bool SomeoneIsBroke() => Human.IsBroke || Computer.IsBroke; method GetWinner (line 181) | private Player? GetWinner() method ShouldPlayAnotherHand (line 197) | internal bool ShouldPlayAnotherHand() FILE: 71_Poker/java/Poker.java class Poker (line 19) | public class Poker { method main (line 21) | public static void main(String[] args) { method run (line 55) | void run() { method printWelcome (line 61) | void printWelcome() { method tab (line 76) | void tab(int number) { method random0to10 (line 80) | int random0to10() { method removeHundreds (line 84) | int removeHundreds(long x) { method startAgain (line 88) | void startAgain() { method playRound (line 93) | void playRound() { method playerMoves (line 171) | void playerMoves() { method computerOpens (line 177) | void computerOpens() { method computerMoves (line 184) | @SuppressWarnings("StatementWithEmptyBody") method promptPlayerDrawCards (line 198) | void promptPlayerDrawCards() { method inputPlayerDrawCards (line 204) | void inputPlayerDrawCards() { method computerDrawing (line 220) | void computerDrawing() { method drawNextCard (line 241) | void drawNextCard() { method drawCard (line 246) | @SuppressWarnings("StatementWithEmptyBody") method playerDrawsCards (line 269) | void playerDrawsCards() { method startPlayerBettingAndReaction (line 282) | void startPlayerBettingAndReaction() { method playerBetsAndComputerReacts (line 316) | void playerBetsAndComputerReacts() { method checkWinnerAfterFirstBetAndCompareHands (line 331) | void checkWinnerAfterFirstBetAndCompareHands() { method compareHands (line 336) | void compareHands() { method printHandDescriptionResult (line 367) | void printHandDescriptionResult() { method handIsDrawn (line 386) | void handIsDrawn() { method someoneWinsWithFlush (line 392) | void someoneWinsWithFlush() { method checkWinnerAfterFirstBet (line 402) | @SuppressWarnings("StatementWithEmptyBody") method computerWins (line 415) | void computerWins() { method potStatusAndNextRoundPrompt (line 421) | void potStatusAndNextRoundPrompt() { method yesFromPrompt (line 432) | private boolean yesFromPrompt() { method computerChecks (line 445) | void computerChecks() { method humanWins (line 452) | void humanWins() { method generateCards (line 459) | void generateCards(int Z) { method showHand (line 483) | void showHand() { method printCardValueAtIndex (line 496) | void printCardValueAtIndex(int Z) { method printCardValue (line 501) | void printCardValue() { method printCardColorAtIndex (line 516) | void printCardColorAtIndex(int Z) { method printCardColor (line 521) | void printCardColor() { method describeHand (line 534) | void describeHand() { method schmaltzHand (line 612) | void schmaltzHand() { method fullHouse (line 633) | void fullHouse() { method playersTurn (line 638) | void playersTurn() { method readString (line 643) | String readString() { method promptAndInputPlayerBet (line 648) | @SuppressWarnings("StatementWithEmptyBody") method readFloat (line 664) | private float readFloat() { method playerBetInvalidAmount (line 673) | void playerBetInvalidAmount() { method processPlayerBet (line 678) | void processPlayerBet() { method humanCanAffordBet (line 687) | void humanCanAffordBet() { method processComputerMove (line 701) | void processComputerMove() { method computerRaises (line 727) | void computerRaises() { method computerFolds (line 735) | void computerFolds() { method computerRaisesOrSees (line 740) | void computerRaisesOrSees() { method computerSees (line 748) | void computerSees() { method moveMoneyToPot (line 754) | void moveMoneyToPot() { method computerBusted (line 760) | void computerBusted() { method computerBroke (line 765) | @SuppressWarnings("StatementWithEmptyBody") method _int (line 774) | private int _int(float v) { method playerBuyBackWatch (line 778) | private boolean playerBuyBackWatch() { method playerBuyBackTieRack (line 789) | private boolean playerBuyBackTieRack() { method playerBroke (line 801) | @SuppressWarnings("StatementWithEmptyBody") method playerBusted (line 811) | private void playerBusted() { method playerSellWatch (line 816) | private boolean playerSellWatch() { method playerSellTieTack (line 833) | private boolean playerSellTieTack() { FILE: 71_Poker/javascript/poker.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function fna (line 66) | function fna(x) function fnb (line 71) | function fnb(x) function im_busted (line 76) | function im_busted() function deal_card (line 82) | function deal_card() function show_cards (line 108) | function show_cards() function show_number (line 124) | function show_number() function show_suit (line 139) | function show_suit() function evaluate_hand (line 152) | function evaluate_hand() function get_prompt (line 254) | function get_prompt(question, def) function player_low_in_money (line 263) | function player_low_in_money() function computer_low_in_money (line 301) | function computer_low_in_money() function ask_for_bet (line 339) | function ask_for_bet() function check_for_win (line 400) | function check_for_win(type) function show_hand (line 417) | function show_hand() function main (line 436) | async function main() FILE: 72_Queen/csharp/Computer.cs class Computer (line 3) | internal class Computer method Computer (line 9) | public Computer(IRandom random) method GetMove (line 14) | public Position GetMove(Position from) method FindMove (line 17) | private Move FindMove(Position from) FILE: 72_Queen/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 9) | public Game(IReadWrite io, IRandom random) method PlaySeries (line 16) | internal void PlaySeries() method PlayGame (line 38) | private Result PlayGame() type Result (line 56) | private enum Result { ComputerWins, HumanWins, HumanForfeits }; FILE: 72_Queen/csharp/IOExtensions.cs class IOExtensions (line 3) | internal static class IOExtensions method ReadYesNo (line 5) | internal static bool ReadYesNo(this IReadWrite io, string prompt) method ReadPosition (line 17) | internal static Position ReadPosition( FILE: 72_Queen/csharp/Move.cs type Move (line 3) | internal record struct Move(int Diagonal, int Row) FILE: 72_Queen/csharp/Position.cs type Position (line 3) | internal record struct Position(int Diagonal, int Row) FILE: 72_Queen/csharp/RandomExtensions.cs class RandomExtensions (line 3) | internal static class RandomExtensions method NextMove (line 5) | internal static Move NextMove(this IRandom random) FILE: 72_Queen/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Prompts (line 22) | internal static class Prompts class Strings (line 30) | internal static class Strings method ComputerMove (line 32) | public static string ComputerMove(Position position) => string.Forma... method GetPrompt (line 35) | private static string GetPrompt([CallerMemberName] string? name = null... method GetString (line 37) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 44) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 72_Queen/java/Queen.java class Queen (line 10) | public class Queen { method main (line 31) | public static void main(String[] args) { method playOneGame (line 62) | private static void playOneGame(Move firstMove) { method getUserFirstMove (line 99) | private static Move getUserFirstMove() { method getValidUserMove (line 122) | private static Move getValidUserMove(ComputerMove latestComputerMove) { method printWonByForfeit (line 136) | private static void printWonByForfeit() { method validateUserMove (line 140) | private static boolean validateUserMove(Move userMove, ComputerMove co... method getUserMove (line 166) | private static Move getUserMove() { method printComputerWins (line 173) | private static void printComputerWins() { method askForAnotherGame (line 178) | private static boolean askForAnotherGame() { method isTopmostRowOrRightmostColumn (line 192) | private static boolean isTopmostRowOrRightmostColumn(Move move) { method getComputerMove (line 196) | private static ComputerMove getComputerMove(Move userMove) { method evaluatePositionAndGetMove (line 227) | private static Optional evaluatePositionAndGetMove(int n... method evaluateComputerMove (line 235) | private static EvaluationResult evaluateComputerMove(int u, int t) { method printCongratulatoryMessage (line 244) | private static void printCongratulatoryMessage() { method getMovePositionInRandomDirection (line 255) | private static ComputerMove getMovePositionInRandomDirection(int u1, i... method calculateMove (line 270) | private static int calculateMove(int u, int t, int uChange, int tChang... method printBoard (line 277) | private static void printBoard() { method askAndShowInstructions (line 291) | private static void askAndShowInstructions() { method printWithTab (line 306) | private static void printWithTab(String message, int tab) { method showInstructions (line 314) | private static void showInstructions() { class ComputerMove (line 333) | private static class ComputerMove { method ComputerMove (line 338) | private ComputerMove(int move) { class EvaluationResult (line 346) | private static class EvaluationResult { method EvaluationResult (line 350) | public EvaluationResult(int move, boolean favourablePosition) { class Move (line 358) | private static class Move { method Move (line 363) | private Move(int move) { FILE: 72_Queen/javascript/queen.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_instructions (line 61) | function show_instructions() function show_map (line 81) | function show_map() function test_move (line 96) | function test_move() function random_move (line 104) | function random_move() function computer_move (line 121) | function computer_move() function main (line 143) | async function main() FILE: 72_Queen/python/queen.py function loc_to_num (line 81) | def loc_to_num(location: Tuple[int, int], fix_align: bool = False) -> str: function num_to_loc (line 98) | def num_to_loc(num: int) -> Tuple[int, int]: function intro (line 134) | def intro() -> None: function get_move (line 143) | def get_move(current_loc: Optional[Tuple[int, int]]) -> Tuple[int, int]: function random_computer_move (line 186) | def random_computer_move(location: Tuple[int, int]) -> Tuple[int, int]: function computer_move (line 200) | def computer_move(location: Tuple[int, int]) -> Tuple[int, int]: function main_game (line 226) | def main_game() -> None: function ask (line 250) | def ask(prompt: str) -> bool: FILE: 72_Queen/rust/src/ai.rs constant PREFERRED_MOVES (line 3) | const PREFERRED_MOVES: [u8; 5] = [158, 72, 75, 126, 127]; constant SAFE_MOVES (line 4) | const SAFE_MOVES: [u8; 2] = [44, 41]; function get_computer_move (line 6) | pub fn get_computer_move(loc: u8) -> u8 { function random_move (line 20) | fn random_move(l: u8) -> u8 { FILE: 72_Queen/rust/src/game.rs type Game (line 6) | pub struct Game { method new (line 15) | pub fn new() -> Self { method update (line 39) | pub fn update(&mut self) -> bool { method set_start_location (line 65) | fn set_start_location(&mut self) { method player_move (line 86) | fn player_move(&mut self, loc: u8) { method check_location (line 106) | fn check_location(&self) -> bool { method draw (line 115) | fn draw(&self, loc: u8) { FILE: 72_Queen/rust/src/main.rs function main (line 10) | fn main() { FILE: 72_Queen/rust/src/util.rs type PromptResult (line 3) | pub enum PromptResult { function prompt (line 9) | pub fn prompt(is_numeric: Option, msg: &str) -> PromptResult { function is_move_legal (line 42) | pub fn is_move_legal(loc: u8, mov: u8) -> bool { function is_legal_start (line 56) | pub fn is_legal_start(loc: u8) -> bool { function print_gameover (line 77) | pub fn print_gameover(win: bool, forfeit: bool) { function intro (line 92) | pub fn intro() { FILE: 73_Reverse/csharp/Reverse.Tests/Generators/PositiveIntegerGenerator.cs class PositiveIntegerGenerator (line 5) | public static class PositiveIntegerGenerator method Generate (line 7) | public static Arbitrary Generate() => FILE: 73_Reverse/csharp/Reverse.Tests/ReverserTests.cs class ReverserTests (line 9) | public class ReverserTests method Constructor_CannotAcceptNumberLessThanZero (line 11) | [Fact] method Constructor_CreatesRandomArrayOfSpecifiedLength (line 19) | [Property(Arbitrary = new[] { typeof(PositiveIntegerGenerator) })] method ConstructorArray_MaxElementValueIsEqualToSize (line 27) | [Property(Arbitrary = new[] { typeof(PositiveIntegerGenerator) })] method ConstructorArray_ReturnsRandomArrayWithDistinctElements (line 35) | [Property(Arbitrary = new[] { typeof(PositiveIntegerGenerator) })] method Reverse_WillReverseEntireArray (line 46) | [Theory] method Reverse_WithSpecifiedIndex_ReversesItemsUpToThatIndex (line 60) | [Fact] method Reverse_WithIndexOne_DoesNothing (line 73) | [Fact] method Reverse_WithIndexGreaterThanArrayLength_DoesNothing (line 86) | [Fact] method Reverse_WithIndexLessThanZero_DoesNothing (line 99) | [Fact] method IsArrayInAscendingOrder_WhenArrayElementsAreInNumericAscendingOrder_ReturnsTrue (line 112) | [Theory] method IsArrayInOrder_WhenArrayElementsAreNotInNumericAscendingOrder_ReturnsFalse (line 126) | [Fact] method GetArrayString_ReturnsSpaceSeparatedElementsOfArrayInStringFormat (line 137) | [Fact] FILE: 73_Reverse/csharp/Reverse.Tests/TestReverser.cs class TestReverser (line 3) | internal class TestReverser : Reverser method TestReverser (line 5) | public TestReverser(int arraySize) : base(arraySize) { } method GetArray (line 7) | public int[] GetArray() method SetArray (line 12) | public void SetArray(int[] array) FILE: 73_Reverse/csharp/Reverse/Program.cs class Program (line 5) | class Program method Main (line 8) | static void Main(string[] args) method ReadNextInput (line 59) | private static int ReadNextInput() method ReadIntegerInput (line 81) | private static int ReadIntegerInput() method PrintList (line 88) | private static void PrintList(string list) method PrintTitle (line 95) | private static void PrintTitle() method DisplayRules (line 105) | private static void DisplayRules() FILE: 73_Reverse/csharp/Reverse/Reverser.cs class Reverser (line 6) | public class Reverser method Reverser (line 10) | public Reverser(int arraySize) method Reverse (line 15) | public void Reverse(int index) method IsArrayInAscendingOrder (line 31) | public bool IsArrayInAscendingOrder() method CreateRandomArray (line 44) | private int[] CreateRandomArray(int size) method GetArrayString (line 70) | public string GetArrayString() FILE: 73_Reverse/java/Reverse.java class Reverse (line 16) | public class Reverse { type Step (line 22) | private enum Step { method Reverse (line 26) | public Reverse() { method play (line 32) | public void play() { method showIntro (line 39) | private static void showIntro() { method startGame (line 49) | private void startGame() { method findDuplicates (line 178) | public boolean findDuplicates(int[] board, int length) { method printBoard (line 195) | public void printBoard(int[] board) { method printRules (line 210) | public void printRules() { method main (line 235) | public static void main(String[] args) { FILE: 73_Reverse/javascript/reverse.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function print_rules (line 49) | function print_rules() function print_list (line 74) | function print_list() function main (line 84) | async function main() FILE: 73_Reverse/python/reverse.py function main (line 8) | def main() -> None: function game_loop (line 26) | def game_loop() -> None: function print_list (line 69) | def print_list(numbers) -> None: function print_rules (line 73) | def print_rules() -> None: FILE: 73_Reverse/ruby/reverse.rb function displayTheRules (line 6) | def displayTheRules function printList (line 22) | def printList function makeRandomList (line 28) | def makeRandomList function checkForWin? (line 37) | def checkForWin? (triesSoFar) function reverseIt (line 52) | def reverseIt (howManyToReverse, triesSoFar) function askHowManyToReverse (line 73) | def askHowManyToReverse FILE: 73_Reverse/rust/src/main.rs function input (line 12) | fn input(msg: &str) -> String { function main (line 20) | fn main() { function sub2 (line 145) | fn sub2(a: &Vec, n: usize) { function sub1 (line 155) | fn sub1(n: usize) { function replay (line 195) | fn replay() -> bool { FILE: 74_Rock_Scissors_Paper/csharp/Choice.cs class Choice (line 3) | public class Choice method Choice (line 9) | public Choice(string selector, string name) { method Beats (line 14) | public bool Beats(Choice choice) FILE: 74_Rock_Scissors_Paper/csharp/Choices.cs class Choices (line 5) | public class Choices method Choices (line 14) | static Choices() method GetRandom (line 23) | public static Choice GetRandom() method TryGetBySelector (line 28) | public static bool TryGetBySelector(string selector, out Choice choice) FILE: 74_Rock_Scissors_Paper/csharp/Game.cs class Game (line 6) | public class Game method PlayGame (line 12) | public void PlayGame() method WriteFinalScore (line 37) | public void WriteFinalScore() method GetHumanChoice (line 46) | public Choice GetHumanChoice() FILE: 74_Rock_Scissors_Paper/csharp/Program.cs class Program (line 5) | static class Program method Main (line 7) | static void Main(string[] args) method GetNumberOfGames (line 31) | static int GetNumberOfGames() FILE: 74_Rock_Scissors_Paper/java/src/RockScissors.java class RockScissors (line 14) | public class RockScissors { type GAME_STATE (line 25) | private enum GAME_STATE { type WINNER (line 37) | private enum WINNER { method RockScissors (line 50) | public RockScissors() { method play (line 58) | public void play() { method intro (line 167) | private void intro() { method displayTextAndGetNumber (line 180) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 190) | private String displayTextAndGetInput(String text) { method addSpaces (line 201) | private String addSpaces(int spaces) { method main (line 207) | public static void main(String[] args) { FILE: 74_Rock_Scissors_Paper/javascript/rockscissors.mjs function getGameCount (line 16) | async function getGameCount() { function getUserInput (line 28) | async function getUserInput() { function game (line 38) | async function game() { FILE: 74_Rock_Scissors_Paper/python/rockscissors.py function play_game (line 9) | def play_game() -> None: function main (line 75) | def main() -> None: FILE: 74_Rock_Scissors_Paper/ruby/rockscissors.rb function center_text (line 15) | def center_text(text) function ask_for_number_of_games (line 19) | def ask_for_number_of_games function ask_for_human_move (line 28) | def ask_for_human_move function calculate_result (line 38) | def calculate_result(human_move, computer_move) FILE: 74_Rock_Scissors_Paper/rust/src/main.rs function main (line 11) | fn main() { type Choice (line 77) | pub enum Choice { method new_random (line 85) | fn new_random(rng: &mut TlsWyRand) -> Choice { type Winner (line 91) | pub enum Winner { method decide_winner (line 101) | pub fn decide_winner(my_choice: Choice, your_choice: Choice) -> Winner { function input_int (line 118) | fn input_int(prompt: &str, number: &mut i32) { function winner_test (line 133) | fn winner_test() { FILE: 75_Roulette/csharp/Bet.cs type Bet (line 3) | internal record struct Bet(BetType Type, int Number, int Wager) FILE: 75_Roulette/csharp/BetType.cs type BetType (line 3) | internal record struct BetType(int Value) FILE: 75_Roulette/csharp/Croupier.cs class Croupier (line 3) | internal class Croupier method Pay (line 15) | internal string Pay(Bet bet) method Take (line 28) | internal string Take(Bet bet) method CutCheck (line 36) | public void CutCheck(IReadWrite io, IRandom random) FILE: 75_Roulette/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 10) | public Game(IReadWrite io, IRandom random) method Play (line 18) | public void Play() FILE: 75_Roulette/csharp/IOExtensions.cs class IOExtensions (line 3) | internal static class IOExtensions method ReadBetCount (line 5) | internal static int ReadBetCount(this IReadWrite io) method ReadBet (line 14) | internal static Bet ReadBet(this IReadWrite io, int number) method IsValidInt (line 32) | internal static bool IsValidInt(this float value, int minValue, int ma... FILE: 75_Roulette/csharp/Resources/Resource.cs class Resource (line 7) | internal static class Resource class Streams (line 9) | internal static class Streams class Strings (line 20) | internal static class Strings method Black (line 22) | public static string Black(int number) => Slot(number); method Red (line 23) | public static string Red(int number) => Slot(number); method Slot (line 24) | private static string Slot(int number, [CallerMemberName] string? co... method Lose (line 27) | public static string Lose(Bet bet) => Outcome(bet.Wager, bet.Number); method Win (line 28) | public static string Win(Bet bet) => Outcome(bet.Payout, bet.Number); method Outcome (line 29) | private static string Outcome(int amount, int number, [CallerMemberN... method Totals (line 32) | public static string Totals(int me, int you) => string.Format(GetStr... method Check (line 34) | public static string Check(IRandom random, string payee, int amount) class Prompts (line 38) | internal static class Prompts method Bet (line 42) | public static string Bet(int number) => string.Format(GetPrompt(), n... method GetPrompt (line 47) | private static string GetPrompt([CallerMemberName] string? name = null... method GetString (line 49) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 56) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 75_Roulette/csharp/Slot.cs class Slot (line 5) | internal class Slot method Slot (line 9) | public Slot (string name, params BetType[] coveringBets) method IsCoveredBy (line 17) | public bool IsCoveredBy(Bet bet) => _coveringBets.Contains(bet.Type); FILE: 75_Roulette/csharp/Table.cs class Table (line 3) | internal class Table method Table (line 9) | public Table(Croupier croupier, IReadWrite io, IRandom random) method Play (line 16) | public bool Play() method SpinWheel (line 29) | private Slot SpinWheel() method AcceptBets (line 37) | private IReadOnlyList AcceptBets() method SettleBets (line 64) | private void SettleBets(IReadOnlyList bets, Slot slot) FILE: 75_Roulette/csharp/Wheel.cs class Wheel (line 5) | internal class Wheel method Wheel (line 49) | public Wheel(IRandom random) => _random = random; method Spin (line 51) | public Slot Spin() => _slots[_random.Next(_slots.Length)]; FILE: 75_Roulette/java/iterative/Roulette.java class Roulette (line 9) | public class Roulette { method Roulette (line 22) | public Roulette(PrintStream out, InputStream in) { method main (line 30) | public static void main(String[] args) { method play (line 34) | public void play() { method printInstructions (line 82) | public void printInstructions() { method queryBets (line 132) | private Bet[] queryBets() { method betResults (line 169) | private void betResults(Bet[] bets, int num) { method playAgain (line 207) | private boolean playAgain() { method printCheck (line 223) | private void printCheck() { class Bet (line 268) | public class Bet { method Bet (line 272) | public Bet(int num, int amount) { FILE: 75_Roulette/java/oop/Bet.java class Bet (line 5) | public class Bet { method Bet (line 10) | public Bet(int on, int of) { method isValid (line 15) | public boolean isValid() { method m (line 21) | private int m(boolean isWon, int odds) { method winsOn (line 28) | public int winsOn(Wheel w) { FILE: 75_Roulette/java/oop/Roulette.java class Roulette (line 12) | public class Roulette { method main (line 13) | public static void main(String args[]) throws Exception { method Roulette (line 25) | public Roulette() { method setSeed (line 33) | private void setSeed(long l) { method play (line 37) | public void play() { method intro (line 78) | private void intro() throws IOException { method instructions (line 84) | private void instructions() { method betAndSpin (line 139) | private boolean betAndSpin() throws IOException { method tab (line 231) | private void tab(int n) { FILE: 75_Roulette/java/oop/Wheel.java class Wheel (line 6) | public class Wheel { method Wheel (line 18) | public Wheel() { method setSeed (line 22) | void setSeed(long l) { method spin (line 27) | public void spin() { method value (line 41) | public String value() { method zero (line 48) | public boolean zero() { method isNumber (line 53) | public boolean isNumber() { method number (line 58) | public int number() { method color (line 64) | public int color() { FILE: 75_Roulette/javascript/roulette.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 54) | async function main() FILE: 75_Roulette/python/roulette.py function print_instructions (line 9) | def print_instructions() -> None: function query_bets (line 63) | def query_bets() -> Tuple[List[int], List[int]]: function bet_results (line 96) | def bet_results(bet_ids: List[int], bet_values: List[int], result) -> int: function print_check (line 136) | def print_check(amount: int) -> None: function main (line 153) | def main() -> None: function string_to_bool (line 210) | def string_to_bool(string: str) -> bool: FILE: 75_Roulette/rust/src/main.rs function main (line 7) | fn main() { FILE: 75_Roulette/rust/src/util.rs constant INSTRUCTIONS (line 5) | pub const INSTRUCTIONS: [&str; 38] = [ constant REDS (line 46) | pub const REDS: [u8; 18] = [ function process_bet (line 50) | pub fn process_bet(bet_num: u8, spin: u8) -> (bool, u8) { function is_within_range (line 72) | fn is_within_range(r: RangeInclusive, n: u8) -> bool { function print_check (line 76) | pub fn print_check(money: usize, date: Vec) { FILE: 76_Russian_Roulette/csharp/Program.cs class Program (line 5) | public class Program method Main (line 7) | public static void Main(string[] args) method PrintTitle (line 28) | private static void PrintTitle() method PrintInstructions (line 38) | private static void PrintInstructions(bool includeRevolver) method PlayGame (line 55) | private static GameResult PlayGame() type GameResult (line 99) | private enum GameResult FILE: 76_Russian_Roulette/java/src/RussianRoulette.java class RussianRoulette (line 14) | public class RussianRoulette { type GAME_STATE (line 22) | private enum GAME_STATE { method RussianRoulette (line 34) | public RussianRoulette() { method play (line 42) | public void play() { method intro (line 97) | private void intro() { method displayTextAndGetNumber (line 111) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 121) | private String displayTextAndGetInput(String text) { method addSpaces (line 132) | private String addSpaces(int spaces) { method main (line 138) | public static void main(String[] args) { FILE: 76_Russian_Roulette/javascript/russianroulette.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 76_Russian_Roulette/python/russianroulette.py function initial_message (line 22) | def initial_message() -> None: function parse_input (line 29) | def parse_input() -> int: function main (line 37) | def main() -> None: FILE: 76_Russian_Roulette/ruby/russianroulette.rb function parse_input (line 15) | def parse_input FILE: 76_Russian_Roulette/rust/src/main.rs function main (line 5) | fn main() { FILE: 77_Salvo/csharp/Coordinate.cs type Coordinate (line 3) | internal record struct Coordinate(int Value) FILE: 77_Salvo/csharp/Extensions/IOExtensions.cs class IOExtensions (line 3) | internal static class IOExtensions method ReadPosition (line 5) | internal static Position ReadPosition(this IReadWrite io) => Position.... method ReadValidPosition (line 7) | internal static Position ReadValidPosition(this IReadWrite io) method ReadPositions (line 19) | internal static IEnumerable ReadPositions(this IReadWrite io... FILE: 77_Salvo/csharp/Extensions/RandomExtensions.cs class RandomExtensions (line 3) | internal static class RandomExtensions method NextShipPosition (line 5) | internal static (Position, Offset) NextShipPosition(this IRandom random) method NextCoordinate (line 14) | private static Coordinate NextCoordinate(this IRandom random) method NextOffset (line 17) | private static int NextOffset(this IRandom random) => random.Next(-1, 2); method GetRandomShipPositionInRange (line 19) | internal static (Position, Offset) GetRandomShipPositionInRange(this I... FILE: 77_Salvo/csharp/Fleet.cs class Fleet (line 6) | internal class Fleet method Fleet (line 10) | internal Fleet(IReadWrite io) method Fleet (line 22) | internal Fleet(IRandom random) method ReceiveShots (line 56) | internal void ReceiveShots(IEnumerable shots, Action r... FILE: 77_Salvo/csharp/Game.cs class Game (line 3) | internal class Game method Game (line 8) | public Game(IReadWrite io, IRandom random) method Play (line 14) | internal void Play() FILE: 77_Salvo/csharp/Offset.cs type Offset (line 3) | internal record struct Offset(int X, int Y) FILE: 77_Salvo/csharp/Position.cs type Position (line 3) | internal record struct Position(Coordinate X, Coordinate Y) FILE: 77_Salvo/csharp/Resources/Resource.cs class Resource (line 6) | internal static class Resource class Streams (line 8) | internal static class Streams class Strings (line 18) | internal static class Strings method YouHaveShots (line 21) | public static string YouHaveShots(int number) => Format(number); method IHaveShots (line 22) | public static string IHaveShots(int number) => Format(number); method YouHit (line 23) | public static string YouHit(string shipName) => Format(shipName); method IHit (line 24) | public static string IHit(string shipName) => Format(shipName); method ShotBefore (line 25) | public static string ShotBefore(int turnNumber) => Format(turnNumber); method Turn (line 26) | public static string Turn(int number) => Format(number); class Prompts (line 29) | internal static class Prompts method Format (line 36) | private static string Format(T value, [CallerMemberName] string? na... method GetString (line 39) | private static string GetString([CallerMemberName] string? name = null) method GetStream (line 46) | private static Stream GetStream([CallerMemberName] string? name = null... FILE: 77_Salvo/csharp/Ships/Battleship.cs class Battleship (line 3) | internal sealed class Battleship : Ship method Battleship (line 5) | internal Battleship(IReadWrite io) method Battleship (line 10) | internal Battleship(IRandom random) FILE: 77_Salvo/csharp/Ships/Cruiser.cs class Cruiser (line 3) | internal sealed class Cruiser : Ship method Cruiser (line 5) | internal Cruiser(IReadWrite io) method Cruiser (line 10) | internal Cruiser(IRandom random) FILE: 77_Salvo/csharp/Ships/Destroyer.cs class Destroyer (line 3) | internal sealed class Destroyer : Ship method Destroyer (line 5) | internal Destroyer(string nameIndex, IReadWrite io) method Destroyer (line 10) | internal Destroyer(string nameIndex, IRandom random) FILE: 77_Salvo/csharp/Ships/Ship.cs class Ship (line 3) | internal abstract class Ship method Ship (line 7) | protected Ship(IReadWrite io, string? nameSuffix = null) method Ship (line 13) | protected Ship(IRandom random, string? nameSuffix = null) method IsHit (line 30) | internal bool IsHit(Position position) => _positions.Remove(position); method DistanceTo (line 32) | internal float DistanceTo(Ship other) method ToString (line 35) | public override string ToString() FILE: 77_Salvo/csharp/Targetting/ComputerShotSelector.cs class ComputerShotSelector (line 3) | internal class ComputerShotSelector : ShotSelector method ComputerShotSelector (line 10) | internal ComputerShotSelector(Fleet source, IRandom random, IReadWrite... method GetShots (line 19) | protected override IEnumerable GetShots() method RecordHit (line 29) | internal void RecordHit(Ship ship, int turn) => _knownHitsStrategy.Rec... method GetSelectionStrategy (line 31) | private ShotSelectionStrategy GetSelectionStrategy() FILE: 77_Salvo/csharp/Targetting/HumanShotSelector.cs class HumanShotSelector (line 3) | internal class HumanShotSelector : ShotSelector method HumanShotSelector (line 7) | internal HumanShotSelector(Fleet source, IReadWrite io) method GetShots (line 13) | protected override IEnumerable GetShots() FILE: 77_Salvo/csharp/Targetting/KnownHitsShotSelectionStrategy.cs class KnownHitsShotSelectionStrategy (line 3) | internal class KnownHitsShotSelectionStrategy : ShotSelectionStrategy method KnownHitsShotSelectionStrategy (line 7) | internal KnownHitsShotSelectionStrategy(ShotSelector shotSelector) method GetShots (line 14) | internal override IEnumerable GetShots(int numberOfShots) method RecordHit (line 60) | internal void RecordHit(Ship ship, int turn) FILE: 77_Salvo/csharp/Targetting/SearchPattern.cs class SearchPattern (line 5) | internal class SearchPattern method TryGetOffset (line 12) | internal bool TryGetOffset(out Offset offset) method Reset (line 21) | internal void Reset() => _nextIndex = 0; FILE: 77_Salvo/csharp/Targetting/SearchPatternShotSelector.cs class SearchPatternShotSelectionStrategy (line 3) | internal class SearchPatternShotSelectionStrategy : ShotSelectionStrategy method SearchPatternShotSelectionStrategy (line 10) | internal SearchPatternShotSelectionStrategy(ShotSelector shotSelector,... method GetShots (line 16) | internal override IEnumerable GetShots(int numberOfShots) method SearchFrom (line 27) | private void SearchFrom(int numberOfShots, Position candidateShot) method FindValidShots (line 39) | private bool FindValidShots(int numberOfShots, ref Position candidateS... method IsValidShot (line 53) | private bool IsValidShot(Position candidate) FILE: 77_Salvo/csharp/Targetting/ShotSelectionStrategy.cs class ShotSelectionStrategy (line 3) | internal abstract class ShotSelectionStrategy method ShotSelectionStrategy (line 6) | protected ShotSelectionStrategy(ShotSelector shotSelector) method GetShots (line 11) | internal abstract IEnumerable GetShots(int numberOfShots); method WasSelectedPreviously (line 13) | protected bool WasSelectedPreviously(Position position) => _shotSelect... method WasSelectedPreviously (line 15) | protected bool WasSelectedPreviously(Position position, out int turn) FILE: 77_Salvo/csharp/Targetting/ShotSelector.cs class ShotSelector (line 3) | internal abstract class ShotSelector method ShotSelector (line 8) | internal ShotSelector(Fleet source) method WasSelectedPreviously (line 16) | internal bool WasSelectedPreviously(Position position) => _previousSho... method WasSelectedPreviously (line 18) | internal bool WasSelectedPreviously(Position position, out int turn) method GetShots (line 21) | internal IEnumerable GetShots(int turnNumber) method GetShots (line 30) | protected abstract IEnumerable GetShots(); FILE: 77_Salvo/csharp/TurnHandler.cs class TurnHandler (line 5) | internal class TurnHandler method TurnHandler (line 16) | public TurnHandler(IReadWrite io, IRandom random) method PlayTurn (line 28) | public Winner? PlayTurn() method AskWhoStarts (line 34) | private bool AskWhoStarts() method PlayComputerTurn (line 53) | private Winner? PlayComputerTurn() method PlayHumanTurn (line 75) | private Winner? PlayHumanTurn() FILE: 77_Salvo/csharp/Winner.cs type Winner (line 3) | internal enum Winner FILE: 77_Salvo/javascript/salvo.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function sgn (line 61) | function sgn(k) function fna (line 70) | function fna(k) function fnb (line 75) | function fnb(k) function generate_random (line 80) | function generate_random() function main (line 89) | async function main() FILE: 77_Salvo/python/salvo.py function random_x_y (line 104) | def random_x_y() -> CoordinateType: function input_coord (line 112) | def input_coord() -> CoordinateType: function generate_ship_coordinates (line 143) | def generate_ship_coordinates(ship: int) -> List[CoordinateType]: function create_blank_board (line 208) | def create_blank_board() -> BoardType: function print_board (line 213) | def print_board(board: BoardType) -> None: function place_ship (line 231) | def place_ship(board: BoardType, coords: List[CoordinateType], ship: int... function generate_board (line 249) | def generate_board() -> Tuple[BoardType, List[List[CoordinateType]]]: function execute_shot (line 272) | def execute_shot( function calculate_shots (line 288) | def calculate_shots(board: BoardType) -> int: function initialize_game (line 303) | def initialize_game() -> None: function execute_turn (line 386) | def execute_turn(turn: bool, current_turn: int) -> int: function main (line 448) | def main() -> None: FILE: 78_Sine_Wave/java/src/SineWave.java class SineWave (line 10) | public class SineWave { method main (line 12) | public static void main(String[] args) { FILE: 78_Sine_Wave/python/sinewave.py function main (line 28) | def main() -> None: FILE: 78_Sine_Wave/ruby/sinewave.rb function intro (line 1) | def intro function main (line 6) | def main FILE: 78_Sine_Wave/rust/src/main.rs function main (line 1) | fn main() { function welcome (line 32) | fn welcome() { FILE: 79_Slalom/csharp/program.cs class Slalom (line 5) | class Slalom method DisplayIntro (line 13) | private void DisplayIntro() method DisplayInstructions (line 21) | private void DisplayInstructions() method PromptYesNo (line 45) | private bool PromptYesNo(string Prompt) method PromptForGates (line 65) | private int PromptForGates() method PromptForRate (line 101) | private int PromptForRate() method PromptForOption (line 131) | private int PromptForOption() method PromptForCommand (line 161) | private string PromptForCommand() method ExceedGateSpeed (line 193) | private bool ExceedGateSpeed(double MaxGateSpeed, double MPH, double T... method DoARun (line 228) | private void DoARun(int NumberOfGates, int Rating) method PlayOneRound (line 361) | private void PlayOneRound() method PlayTheGame (line 417) | public void PlayTheGame() class Program (line 424) | class Program method Main (line 426) | static void Main(string[] args) FILE: 79_Slalom/java/Slalom.java class Slalom (line 14) | public class Slalom { method main (line 25) | public static void main(String[] args) { method run (line 51) | private static void run(int numGates, Scanner scan, Random random) { method evaluateAndUpdateMedals (line 82) | private static Medals evaluateAndUpdateMedals(float totalTimeTaken, in... method runThroughGates (line 105) | private static float runThroughGates(int numGates, Scanner scan, Rando... method checkAndProcessIfOverMaxSpeed (line 188) | private static boolean checkAndProcessIfOverMaxSpeed(Random random, in... method readRaceAgainChoice (line 208) | private static boolean readRaceAgainChoice(Scanner scan) { method printSpeed (line 222) | private static void printSpeed(int speed) { method printHowLong (line 226) | private static void printHowLong(float t, Random random) { method readOption (line 230) | private static int readOption(Scanner scan) { method readSkierRating (line 249) | private static int readSkierRating(Scanner scan) { method printApproxMaxSpeeds (line 267) | private static void printApproxMaxSpeeds(int numGates) { method printInstructions (line 276) | private static void printInstructions() { method readMenuOption (line 297) | private static MenuChoice readMenuOption(Scanner scan) { method printMenu (line 313) | private static void printMenu() { method readNumberOfGatesChoice (line 319) | private static int readNumberOfGatesChoice(Scanner scan) { method printIntro (line 332) | private static void printIntro() { type MenuChoice (line 338) | private enum MenuChoice { class DisqualifiedException (line 342) | private static class DisqualifiedException extends Exception { class WipedOutOrSnaggedAFlag (line 345) | private static class WipedOutOrSnaggedAFlag extends Exception { class Medals (line 348) | private static class Medals { method Medals (line 353) | public Medals(int gold, int silver, int bronze) { method getGold (line 359) | public int getGold() { method getSilver (line 363) | public int getSilver() { method getBronze (line 367) | public int getBronze() { FILE: 79_Slalom/javascript/slalom.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_instructions (line 51) | function show_instructions() function show_speeds (line 75) | function show_speeds() function main (line 86) | async function main() FILE: 79_Slalom/python/slalom.py function ask (line 10) | def ask(question: str) -> str: function ask_int (line 15) | def ask_int(question: str) -> int: function pre_run (line 20) | def pre_run(gates, max_speeds) -> None: function run (line 53) | def run(gates, lvl, max_speeds) -> None: function main (line 133) | def main() -> None: FILE: 80_Slots/java/src/Slots.java class Slots (line 13) | public class Slots { type GAME_STATE (line 28) | private enum GAME_STATE { type WINNINGS (line 39) | private enum WINNINGS { method WINNINGS (line 48) | WINNINGS(int mult) { method calculateWinnings (line 55) | public int calculateWinnings(int bet) { method Slots (line 69) | public Slots() { method play (line 78) | public void play() { method intro (line 202) | private void intro() { method displayTextAndGetNumber (line 218) | private int displayTextAndGetNumber(String text) { method displayTextAndGetInput (line 228) | private String displayTextAndGetInput(String text) { method yesEntered (line 239) | private boolean yesEntered(String text) { method stringIsAnyValue (line 252) | private boolean stringIsAnyValue(String text, String... values) { method simulateTabs (line 263) | private String simulateTabs(int spaces) { method winningSymbol (line 277) | private int winningSymbol(int reel1, int reel2, int reel3) { method randomSymbol (line 294) | private int randomSymbol() { FILE: 80_Slots/java/src/SlotsGame.java class SlotsGame (line 1) | public class SlotsGame { method main (line 2) | public static void main(String[] args) { FILE: 80_Slots/javascript/slots.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 80_Slots/python/slots.py function initial_message (line 40) | def initial_message() -> None: function input_betting (line 49) | def input_betting() -> int: function beeping (line 65) | def beeping() -> None: function spin_wheels (line 73) | def spin_wheels() -> List[str]: function adjust_profits (line 83) | def adjust_profits(wheel: List[str], m: int, profits: int) -> int: function final_message (line 121) | def final_message(profits: int) -> None: function main (line 130) | def main() -> None: FILE: 80_Slots/ruby/slots.rb function greeting (line 3) | def greeting function overLimit (line 17) | def overLimit function underMinimum (line 21) | def underMinimum function tenBells (line 28) | def tenBells function fiveBells (line 35) | def fiveBells function goodbye (line 39) | def goodbye function payUp (line 45) | def payUp function brokeEven (line 49) | def brokeEven function collectWinnings (line 53) | def collectWinnings function win (line 57) | def win winType, bet FILE: 81_Splat/csharp/Program.cs class Splat (line 6) | class Splat method DisplayIntro (line 24) | private void DisplayIntro() method PromptYesNo (line 36) | private bool PromptYesNo(string Prompt) method WriteRandomBadResult (line 56) | private void WriteRandomBadResult() method WriteColumnOutput (line 68) | private void WriteColumnOutput(double Column1, double Column2) method WriteColumnOutput (line 75) | private void WriteColumnOutput(double Column1, string Column2) method WriteColumnOutput (line 82) | private void WriteColumnOutput(string Column1, string Column2) method WriteSuccessfulResults (line 89) | private void WriteSuccessfulResults(double Distance) method PlayOneRound (line 154) | private void PlayOneRound() method PlayTheGame (line 301) | public void PlayTheGame() class Program (line 321) | class Program method Main (line 323) | static void Main(string[] args) FILE: 81_Splat/java/src/Splat.java class Splat (line 20) | public class Splat { method main (line 25) | public static void main(String[] args) { method run (line 29) | public void run() { method showIntroduction (line 57) | private void showIntroduction() { method buildInitialConditions (line 66) | private InitialJumpConditions buildInitialConditions() { method promptTerminalVelocity (line 73) | private float promptTerminalVelocity() { method promptFloat (line 83) | private float promptFloat(String prompt){ method promptGravitationalAcceleration (line 94) | private float promptGravitationalAcceleration() { method executeJump (line 101) | private JumpResult executeJump(InitialJumpConditions initial, float ch... method computeDistance (line 119) | private float computeDistance(InitialJumpConditions initial, float i, ... method showJumpResults (line 128) | private void showJumpResults(InitialJumpConditions initial, JumpResult... method showSplatMessage (line 170) | private void showSplatMessage(InitialJumpConditions initial, JumpResul... method computeTimeOfSplat (line 178) | private double computeTimeOfSplat(InitialJumpConditions initial, JumpR... method countWorseHistoricalJumps (line 187) | private int countWorseHistoricalJumps(JumpResult jump) { method showCleverSplatMessage (line 193) | private void showCleverSplatMessage() { method playAgain (line 209) | private boolean playAgain() { method mphToFeetPerSec (line 216) | private float mphToFeetPerSec(float speed) { method askYesNo (line 220) | private boolean askYesNo(String prompt) { method chooseRandomAcceleration (line 235) | private float chooseRandomAcceleration() { type Planet (line 241) | enum Planet { method Planet (line 257) | Planet(String message, float acceleration) { method pickRandom (line 262) | static Planet pickRandom() { method getMessage (line 266) | String getMessage() { method getAcceleration (line 270) | float getAcceleration() { class JumpResult (line 276) | static class JumpResult { method JumpResult (line 280) | public JumpResult(float distance) { method isSplat (line 284) | boolean isSplat() { method hasReachedTerminalVelocity (line 288) | boolean hasReachedTerminalVelocity() { method getDistance (line 292) | float getDistance() { method setDistance (line 296) | void setDistance(float distance) { method setReachedTerminalVelocity (line 300) | void setReachedTerminalVelocity() { class InitialJumpConditions (line 306) | static class InitialJumpConditions { method InitialJumpConditions (line 313) | private InitialJumpConditions(float originalTerminalVelocity, float ... method create (line 323) | private static InitialJumpConditions create(float terminalVelocity, ... method plusMinus5Percent (line 329) | private static float plusMinus5Percent(float value) { method getOriginalTerminalVelocity (line 333) | float getOriginalTerminalVelocity() { method getOriginalAcceleration (line 337) | float getOriginalAcceleration() { method getTerminalVelocity (line 341) | float getTerminalVelocity() { method getAcceleration (line 345) | float getAcceleration() { method getAltitude (line 349) | int getAltitude() { method getTimeOfTerminalAccelerationReached (line 353) | float getTimeOfTerminalAccelerationReached() { FILE: 81_Splat/javascript/splat.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 48) | async function main() FILE: 81_Splat/python/splat.py function numeric_input (line 32) | def numeric_input(question, default=0) -> float: function yes_no_input (line 42) | def yes_no_input(question: str, default="YES") -> bool: function get_terminal_velocity (line 50) | def get_terminal_velocity() -> float: function get_acceleration (line 63) | def get_acceleration() -> float: function get_freefall_time (line 73) | def get_freefall_time() -> float: function jump (line 88) | def jump() -> float: function pick_random_celestial_body (line 184) | def pick_random_celestial_body() -> Tuple[str, float]: function jump_stats (line 202) | def jump_stats(previous_jumps, chute_altitude) -> Tuple[int, int]: function print_splat (line 213) | def print_splat(time_on_impact) -> None: function print_results (line 234) | def print_results(n_previous_jumps, n_better) -> None: function print_centered (line 279) | def print_centered(msg: str) -> None: function print_header (line 285) | def print_header() -> None: function main (line 296) | def main() -> None: FILE: 81_Splat/rust/src/celestial_body.rs type CelestialBody (line 4) | pub enum CelestialBody { method get_acceleration (line 18) | pub fn get_acceleration(&self) -> f32 { method print_acceleration_message (line 35) | pub fn print_acceleration_message(&self) { function random_celestial_body (line 48) | pub fn random_celestial_body() -> Option { FILE: 81_Splat/rust/src/game.rs type Game (line 3) | pub struct Game { method new (line 11) | pub fn new() -> Game { method tick (line 45) | pub fn tick(&mut self) -> f32 { FILE: 81_Splat/rust/src/main.rs function main (line 8) | fn main() { FILE: 81_Splat/rust/src/stats.rs type Stats (line 8) | pub struct Stats { method new (line 13) | pub fn new() -> Option { method add_altitude (line 58) | pub fn add_altitude(&mut self, a: f32) { method write (line 77) | fn write(&self) { FILE: 81_Splat/rust/src/utility.rs constant DEATH_MESSAGES (line 5) | const DEATH_MESSAGES: [&str; 10] = [ function read_line (line 18) | pub fn read_line() -> String { function prompt_bool (line 26) | pub fn prompt_bool(msg: &str, template: bool) -> bool { function prompt_numeric (line 44) | pub fn prompt_numeric(msg: &str) -> f32 { function get_altitude (line 58) | pub fn get_altitude() -> f32 { function get_terminal_velocity (line 62) | pub fn get_terminal_velocity(bool_msg: &str, num_msg: &str) -> f32 { function get_acceleration (line 75) | pub fn get_acceleration(bool_msg: &str, num_msg: &str) -> f32 { function get_random_float (line 91) | fn get_random_float(min: f32, max: f32) -> f32 { function print_splat (line 95) | pub fn print_splat(t: f32) { function print_random (line 100) | fn print_random(msg: &str, choices: &[&str]) { function print_win (line 110) | pub fn print_win(total: usize, placement: usize) { FILE: 82_Stars/csharp/Game.cs class Game (line 8) | internal class Game method Game (line 15) | public Game(TextIO io, IRandom random, int maxNumber, int maxGuessCount) method Play (line 23) | internal void Play(Func playAgain) method DisplayIntroduction (line 33) | private void DisplayIntroduction() method Play (line 45) | private void Play() method AcceptGuesses (line 57) | private void AcceptGuesses(int target) method DisplayStars (line 76) | private void DisplayStars(int target, float guess) method DisplayWin (line 92) | private void DisplayWin(int guessCount) method DisplayLoss (line 100) | private void DisplayLoss(int target) FILE: 82_Stars/csharp/Resources/Resource.cs class Resource (line 7) | internal static class Resource class Streams (line 9) | internal static class Streams class Formats (line 14) | internal static class Formats method GetString (line 19) | private static string GetString([CallerMemberName] string name = null) method GetStream (line 26) | private static Stream GetStream([CallerMemberName] string name = null) FILE: 82_Stars/java/src/Stars.java class Stars (line 13) | public class Stars { type GAME_STATE (line 18) | private enum GAME_STATE { method Stars (line 43) | public Stars() { method play (line 55) | public void play() { method showStars (line 125) | private void showStars() { method stars (line 151) | private String stars(int number) { method init (line 161) | private void init() { method instructions (line 166) | public void instructions() { method intro (line 175) | public void intro() { method playerGuess (line 186) | private int playerGuess() { method yesEntered (line 196) | private boolean yesEntered(String text) { method stringIsAnyValue (line 209) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 228) | private String displayTextAndGetInput(String text) { method randomNumber (line 238) | private int randomNumber() { FILE: 82_Stars/java/src/StarsGame.java class StarsGame (line 3) | public class StarsGame { method main (line 5) | public static void main(String[] args) { FILE: 82_Stars/javascript/stars.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 49) | async function main() FILE: 82_Stars/python/stars.py function print_instructions (line 31) | def print_instructions() -> None: function print_stars (line 41) | def print_stars(secret_number, guess) -> None: function get_guess (line 47) | def get_guess(prompt: str) -> int: function main (line 54) | def main() -> None: FILE: 82_Stars/ruby/stars.rb class Stars (line 1) | class Stars method start (line 5) | def start method print_instructions (line 50) | def print_instructions method get_guess (line 59) | def get_guess method print_stars (line 74) | def print_stars secret_number, guess FILE: 82_Stars/rust/src/main.rs function main (line 4) | fn main() { function match_guess (line 69) | fn match_guess(diff: i32) { FILE: 83_Stock_Market/csharp/Assets.cs type Assets (line 8) | public record Assets FILE: 83_Stock_Market/csharp/Broker.cs class Broker (line 11) | public static class Broker method Apply (line 30) | public static (Assets newAssets, TransactionResult result) Apply(Asset... FILE: 83_Stock_Market/csharp/Company.cs type Company (line 6) | public record Company FILE: 83_Stock_Market/csharp/Controller.cs class Controller (line 7) | public static class Controller method StartGame (line 12) | public static void StartGame() method GetYesOrNo (line 33) | public static bool GetYesOrNo(Action prompt) method UpdateAssets (line 61) | public static Assets UpdateAssets(Assets assets, IEnumerable ... method GetTransactionAmount (line 95) | public static int GetTransactionAmount(Company company) FILE: 83_Stock_Market/csharp/Extensions/EnumerableExtensions.cs class EnumerableExtensions (line 11) | public static class EnumerableExtensions method SelectAndAggregate (line 38) | public static IEnumerable SelectAndAggregate( method Zip (line 102) | public static IEnumerable Zip( FILE: 83_Stock_Market/csharp/Extensions/ImmutableArrayExtensions.cs class ImmutableArrayExtensions (line 9) | public static class ImmutableArrayExtensions method Map (line 27) | public static ImmutableArray Map(this Immut... FILE: 83_Stock_Market/csharp/Extensions/RandomExtensions.cs class RandomExtensions (line 9) | public static class RandomExtensions method Integers (line 40) | public static IEnumerable Integers(this Random random, int min, i... FILE: 83_Stock_Market/csharp/Program.cs class Program (line 7) | class Program method Main (line 21) | static void Main() FILE: 83_Stock_Market/csharp/StockMarket.cs class StockMarket (line 12) | public static class StockMarket method Simulate (line 24) | public static IEnumerable Simulate(ImmutableArray... method AdjustSharePrice (line 75) | private static Company AdjustSharePrice(Random random, Company company... method Trends (line 108) | public static IEnumerable Trends(Random random, int minDays, i... method GenerateTrend (line 120) | private static double GenerateTrend(Random random) => method PriceSpikes (line 143) | private static IEnumerable PriceSpikes(Random random, int compan... FILE: 83_Stock_Market/csharp/TradingDay.cs type TradingDay (line 9) | public record TradingDay FILE: 83_Stock_Market/csharp/TransactionResult.cs type TransactionResult (line 6) | public enum TransactionResult FILE: 83_Stock_Market/csharp/View.cs class View (line 11) | public static class View method ShowBanner (line 13) | public static void ShowBanner() method ShowInstructions (line 22) | public static void ShowInstructions() method ShowCompanies (line 42) | public static void ShowCompanies(IEnumerable companies) method ShowTradeResults (line 55) | public static void ShowTradeResults(TradingDay day, TradingDay previou... method ShowAssets (line 91) | public static void ShowAssets(Assets assets, IEnumerable comp... method ShowOversold (line 104) | public static void ShowOversold() method ShowOverspent (line 110) | public static void ShowOverspent(double amount) method ShowFarewell (line 116) | public static void ShowFarewell() method ShowSeparator (line 121) | public static void ShowSeparator() method ShowChar (line 127) | public static void ShowChar(char c) method PromptShowInstructions (line 132) | public static void PromptShowInstructions() method PromptContinue (line 137) | public static void PromptContinue() method PromptEnterTransactions (line 142) | public static void PromptEnterTransactions() method PromptBuySellCompany (line 147) | public static void PromptBuySellCompany(Company company) method PromptValidInteger (line 152) | public static void PromptValidInteger() FILE: 83_Stock_Market/java/StockMarket.java class StockMarket (line 38) | public class StockMarket { method main (line 42) | public static void main(String[] args) { method randomNumber (line 204) | private static int randomNumber(int lowerBound, int upperBound) { method newMarketTrendSlope (line 208) | private static double newMarketTrendSlope() { method printPortfolio (line 212) | private static void printPortfolio(boolean firstRound, List sto... method readStockTransactions (line 233) | private static void readStockTransactions(List stocks, Scanner ... method readANumber (line 242) | private static int readANumber(Scanner scan) { method adjustAllStockValues (line 260) | private static void adjustAllStockValues(List stocks, boolean l... method randomlyChangeTrendSignAndSlopeAndDuration (line 309) | private static double randomlyChangeTrendSignAndSlopeAndDuration() { method initStocks (line 319) | private static List initStocks() { method printGameHelp (line 329) | private static void printGameHelp(Scanner scan) { method printIntro (line 354) | private static void printIntro() { class Stock (line 363) | private static class Stock { method Stock (line 372) | public Stock(double stockValue, String stockName, String stockCode) { method getStockName (line 378) | public String getStockName() { method getStockCode (line 382) | public String getStockCode() { method getStockValue (line 386) | public double getStockValue() { method getPortfolioContents (line 390) | public double getPortfolioContents() { method setPortfolioContents (line 394) | public void setPortfolioContents(double portfolioContents) { method getTransactionQuantity (line 398) | public double getTransactionQuantity() { method setTransactionQuantity (line 402) | public void setTransactionQuantity(double transactionQuantity) { method getChangeStockValue (line 406) | public double getChangeStockValue() { method setChangeStockValue (line 410) | public void setChangeStockValue(double changeStockValue) { method toString (line 414) | @Override FILE: 83_Stock_Market/javascript/stockmarket.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function randomize_initial (line 62) | function randomize_initial() function main (line 132) | async function main() FILE: 83_Stock_Market/python/Stock_Market.py class Stock_Market (line 5) | class Stock_Market: method __init__ (line 6) | def __init__(self) -> None: method total_assets (line 33) | def total_assets(self) -> float: method _generate_day_change (line 36) | def _generate_day_change(self) -> None: method update_prices (line 42) | def update_prices(self) -> None: method print_exchange_average (line 47) | def print_exchange_average(self) -> None: method get_average_change (line 55) | def get_average_change(self) -> float: method print_first_day (line 62) | def print_first_day(self) -> None: method take_inputs (line 74) | def take_inputs(self) -> List[str]: method print_trading_day (line 90) | def print_trading_day(self) -> None: method update_cash_assets (line 103) | def update_cash_assets(self, new_holdings) -> None: method update_stock_assets (line 115) | def update_stock_assets(self) -> None: method print_assets (line 122) | def print_assets(self) -> None: method _check_transaction (line 127) | def _check_transaction(self, new_holdings) -> bool: method update_holdings (line 148) | def update_holdings(self, new_holdings) -> None: function print_instruction (line 153) | def print_instruction() -> None: function main (line 177) | def main() -> None: FILE: 84_Super_Star_Trek/csharp/Commands/Command.cs type Command (line 5) | internal enum Command FILE: 84_Super_Star_Trek/csharp/Commands/CommandExtensions.cs class CommandExtensions (line 6) | internal static class CommandExtensions method GetDescription (line 8) | internal static string GetDescription(this Command command) => FILE: 84_Super_Star_Trek/csharp/Commands/CommandResult.cs class CommandResult (line 3) | internal class CommandResult method CommandResult (line 8) | private CommandResult(bool isGameOver) method CommandResult (line 13) | private CommandResult(float timeElapsed) method Elapsed (line 21) | public static CommandResult Elapsed(float timeElapsed) => new(timeElap... FILE: 84_Super_Star_Trek/csharp/Game.cs class Game (line 12) | internal class Game method Game (line 25) | internal Game(TextIO io, IRandom random) method DoIntroduction (line 35) | internal void DoIntroduction() method Play (line 47) | internal void Play() method Initialise (line 73) | private void Initialise() method BuildCurrentQuadrant (line 116) | private Quadrant BuildCurrentQuadrant() => new(_galaxy[_currentQuadran... method Replay (line 118) | internal bool Replay() => _galaxy.StarbaseCount > 0 && _io.ReadExpecte... method CheckIfStranded (line 120) | private bool CheckIfStranded() method CalculateEfficiency (line 126) | private float CalculateEfficiency() => FILE: 84_Super_Star_Trek/csharp/IRandomExtensions.cs class IRandomExtensions (line 6) | internal static class IRandomExtensions method NextCoordinate (line 8) | internal static Coordinates NextCoordinate(this IRandom random) => method Next1To8Inclusive (line 15) | internal static int Next1To8Inclusive(this IRandom random) => (int)(ra... FILE: 84_Super_Star_Trek/csharp/IReadWriteExtensions.cs class IReadWriteExtensions (line 10) | internal static class IReadWriteExtensions method WaitForAnyKeyButEnter (line 12) | internal static void WaitForAnyKeyButEnter(this IReadWrite io, string ... method GetCoordinates (line 18) | internal static (float X, float Y) GetCoordinates(this IReadWrite io, ... method TryReadNumberInRange (line 21) | internal static bool TryReadNumberInRange( method ReadExpectedString (line 33) | internal static bool ReadExpectedString(this IReadWrite io, string pro... method ReadCommand (line 36) | internal static Command ReadCommand(this IReadWrite io) method TryReadCourse (line 57) | internal static bool TryReadCourse(this IReadWrite io, string prompt, ... method GetYesNo (line 70) | internal static bool GetYesNo(this IReadWrite io, string prompt, YesNo... type YesNoMode (line 84) | internal enum YesNoMode FILE: 84_Super_Star_Trek/csharp/Objects/Enterprise.cs class Enterprise (line 13) | internal class Enterprise method Enterprise (line 22) | public Enterprise(int maxEnergy, Coordinates sector, IReadWrite io, IR... method Add (line 59) | internal Enterprise Add(Subsystem system) method StartIn (line 67) | internal void StartIn(Quadrant quadrant) method GetCondition (line 73) | private string GetCondition() => method Execute (line 82) | internal CommandResult Execute(Command command) method Refuel (line 89) | internal void Refuel() => TotalEnergy = _maxEnergy; method ToString (line 91) | public override string ToString() => "<*>"; method UseEnergy (line 93) | internal void UseEnergy(float amountUsed) method TakeHit (line 98) | internal CommandResult TakeHit(Coordinates sector, int hitStrength) method TakeDamage (line 119) | private void TakeDamage(float hitStrength) method RepairSystems (line 132) | internal void RepairSystems(float repairWorkDone) method VaryConditionOfRandomSystem (line 154) | internal void VaryConditionOfRandomSystem() method Move (line 172) | internal float Move(Course course, float warpFactor, int distance) method MoveWithinQuadrant (line 193) | private (Coordinates, Coordinates)? MoveWithinQuadrant(Course course, ... method MoveBeyondQuadrant (line 214) | private (Coordinates, Coordinates) MoveBeyondQuadrant(Course course, i... method GetTimeElapsed (line 226) | private float GetTimeElapsed(Coordinates finalQuadrant, float warpFact... FILE: 84_Super_Star_Trek/csharp/Objects/Klingon.cs class Klingon (line 7) | internal class Klingon method Klingon (line 11) | internal Klingon(Coordinates sector, IRandom random) method ToString (line 22) | public override string ToString() => "+K+"; method FireOn (line 24) | internal CommandResult FireOn(Enterprise enterprise) method TakeHit (line 34) | internal bool TakeHit(int hitStrength) method MoveTo (line 42) | internal void MoveTo(Coordinates newSector) => Sector = newSector; FILE: 84_Super_Star_Trek/csharp/Objects/Star.cs class Star (line 3) | internal class Star method ToString (line 5) | public override string ToString() => " * "; FILE: 84_Super_Star_Trek/csharp/Objects/Starbase.cs class Starbase (line 8) | internal class Starbase method Starbase (line 13) | internal Starbase(Coordinates sector, IRandom random, IReadWrite io) method ToString (line 22) | public override string ToString() => ">!<"; method TryRepair (line 24) | internal bool TryRepair(Enterprise enterprise, out float repairTime) method ProtectEnterprise (line 43) | internal void ProtectEnterprise() => _io.WriteLine(Strings.Protected); FILE: 84_Super_Star_Trek/csharp/Resources/Strings.cs class Strings (line 7) | internal static class Strings method GetResource (line 59) | private static string GetResource([CallerMemberName] string name = "") FILE: 84_Super_Star_Trek/csharp/Space/Coordinates.cs type Coordinates (line 8) | internal record Coordinates FILE: 84_Super_Star_Trek/csharp/Space/Course.cs class Course (line 13) | internal class Course method Course (line 28) | internal Course(float direction) method GetSectorsFrom (line 52) | internal IEnumerable GetSectorsFrom(Coordinates start) method GetDestination (line 70) | internal (bool, Coordinates, Coordinates) GetDestination(Coordinates q... method GetNewCoordinate (line 78) | private static (bool, int, int) GetNewCoordinate(int quadrant, int sec... FILE: 84_Super_Star_Trek/csharp/Space/Galaxy.cs class Galaxy (line 10) | internal class Galaxy method Galaxy (line 16) | static Galaxy() method Galaxy (line 22) | internal Galaxy(IRandom random) method GetQuadrantName (line 53) | private static string GetQuadrantName(Coordinates coordinates) => method GetNeighborhood (line 56) | internal IEnumerable> GetNeighborhood(Quadra... method GetNeighborhoodRow (line 60) | private IEnumerable GetNeighborhoodRow(Quadrant quadrant... FILE: 84_Super_Star_Trek/csharp/Space/Quadrant.cs class Quadrant (line 12) | internal class Quadrant method Quadrant (line 21) | internal Quadrant( method ToString (line 62) | public override string ToString() => _info.Name; method PositionObject (line 64) | private T PositionObject(Func objectFactory) method PositionObject (line 71) | private void PositionObject(Func objectFactory, i... method Display (line 79) | internal void Display(string textFormat) method HasObjectAt (line 96) | internal bool HasObjectAt(Coordinates coordinates) => _sectors.Contain... method TorpedoCollisionAt (line 98) | internal bool TorpedoCollisionAt(Coordinates coordinates, out string m... method Remove (line 127) | internal string Remove(Klingon klingon) method KlingonsMoveAndFire (line 134) | internal CommandResult KlingonsMoveAndFire() method KlingonsFireOnEnterprise (line 147) | internal CommandResult KlingonsFireOnEnterprise() method GetRandomEmptySector (line 164) | private Coordinates GetRandomEmptySector() method GetDisplayLines (line 176) | internal IEnumerable GetDisplayLines() => Enumerable.Range(0, ... method GetDisplayLine (line 178) | private string GetDisplayLine(int x) => method SetEnterpriseSector (line 187) | internal void SetEnterpriseSector(Coordinates sector) FILE: 84_Super_Star_Trek/csharp/Space/QuadrantInfo.cs class QuadrantInfo (line 5) | internal class QuadrantInfo method QuadrantInfo (line 9) | private QuadrantInfo(Coordinates coordinates, string name, int klingon... method Create (line 28) | internal static QuadrantInfo Create(Coordinates coordinates, string na... method AddKlingon (line 43) | internal void AddKlingon() => KlingonCount += 1; method AddStarbase (line 45) | internal void AddStarbase() => HasStarbase = true; method MarkAsKnown (line 47) | internal void MarkAsKnown() => _isKnown = true; method Scan (line 49) | internal string Scan() method ToString (line 55) | public override string ToString() => _isKnown ? $"{KlingonCount}{(HasS... method RemoveKlingon (line 57) | internal void RemoveKlingon() method RemoveStarbase (line 65) | internal void RemoveStarbase() => HasStarbase = false; FILE: 84_Super_Star_Trek/csharp/StringExtensions.cs class StringExtensions (line 3) | internal static class StringExtensions method Pluralize (line 5) | internal static string Pluralize(this string singular, int quantity) =... FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/ComputerFunction.cs class ComputerFunction (line 6) | internal abstract class ComputerFunction method ComputerFunction (line 8) | protected ComputerFunction(string description, IReadWrite io) method Execute (line 18) | internal abstract void Execute(Quadrant quadrant); FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/CumulativeGalacticRecord.cs class CumulativeGalacticRecord (line 8) | internal class CumulativeGalacticRecord : GalacticReport method CumulativeGalacticRecord (line 10) | internal CumulativeGalacticRecord(IReadWrite io, Galaxy galaxy) method WriteHeader (line 15) | protected override void WriteHeader(Quadrant quadrant) method GetRowData (line 22) | protected override IEnumerable GetRowData() => FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/DirectionDistanceCalculator.cs class DirectionDistanceCalculator (line 7) | internal class DirectionDistanceCalculator : NavigationCalculator method DirectionDistanceCalculator (line 12) | internal DirectionDistanceCalculator(Enterprise enterprise, IReadWrite... method Execute (line 19) | internal override void Execute(Quadrant quadrant) FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/GalacticReport.cs class GalacticReport (line 8) | internal abstract class GalacticReport : ComputerFunction method GalacticReport (line 10) | internal GalacticReport(string description, IReadWrite io, Galaxy galaxy) method WriteHeader (line 18) | protected abstract void WriteHeader(Quadrant quadrant); method GetRowData (line 20) | protected abstract IEnumerable GetRowData(); method Execute (line 22) | internal sealed override void Execute(Quadrant quadrant) FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/GalaxyRegionMap.cs class GalaxyRegionMap (line 9) | internal class GalaxyRegionMap : GalacticReport method GalaxyRegionMap (line 11) | internal GalaxyRegionMap(IReadWrite io, Galaxy galaxy) method WriteHeader (line 16) | protected override void WriteHeader(Quadrant quadrant) => method GetRowData (line 19) | protected override IEnumerable GetRowData() => FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/NavigationCalculator.cs class NavigationCalculator (line 7) | internal abstract class NavigationCalculator : ComputerFunction method NavigationCalculator (line 9) | protected NavigationCalculator(string description, IReadWrite io) method WriteDirectionAndDistance (line 14) | protected void WriteDirectionAndDistance(Coordinates from, Coordinates... method WriteDirectionAndDistance (line 20) | protected void WriteDirectionAndDistance((float X, float Y) from, (flo... method Write (line 26) | private void Write(float direction, float distance) FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/StarbaseDataCalculator.cs class StarbaseDataCalculator (line 8) | internal class StarbaseDataCalculator : NavigationCalculator method StarbaseDataCalculator (line 12) | internal StarbaseDataCalculator(Enterprise enterprise, IReadWrite io) method Execute (line 18) | internal override void Execute(Quadrant quadrant) FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/StatusReport.cs class StatusReport (line 8) | internal class StatusReport : ComputerFunction method StatusReport (line 14) | internal StatusReport(Game game, Galaxy galaxy, Enterprise enterprise,... method Execute (line 22) | internal override void Execute(Quadrant quadrant) FILE: 84_Super_Star_Trek/csharp/Systems/ComputerFunctions/TorpedoDataCalculator.cs class TorpedoDataCalculator (line 8) | internal class TorpedoDataCalculator : NavigationCalculator method TorpedoDataCalculator (line 12) | internal TorpedoDataCalculator(Enterprise enterprise, IReadWrite io) method Execute (line 18) | internal override void Execute(Quadrant quadrant) FILE: 84_Super_Star_Trek/csharp/Systems/DamageControl.cs class DamageControl (line 8) | internal class DamageControl : Subsystem method DamageControl (line 13) | internal DamageControl(Enterprise enterprise, IReadWrite io) method ExecuteCommandCore (line 20) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method WriteDamageReport (line 44) | internal void WriteDamageReport() FILE: 84_Super_Star_Trek/csharp/Systems/LibraryComputer.cs class LibraryComputer (line 8) | internal class LibraryComputer : Subsystem method LibraryComputer (line 13) | internal LibraryComputer(IReadWrite io, params ComputerFunction[] func... method CanExecuteCommand (line 20) | protected override bool CanExecuteCommand() => IsOperational("Computer... method ExecuteCommandCore (line 22) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method GetFunctionIndex (line 32) | private int GetFunctionIndex() FILE: 84_Super_Star_Trek/csharp/Systems/LongRangeSensors.cs class LongRangeSensors (line 8) | internal class LongRangeSensors : Subsystem method LongRangeSensors (line 13) | internal LongRangeSensors(Galaxy galaxy, IReadWrite io) method CanExecuteCommand (line 20) | protected override bool CanExecuteCommand() => IsOperational("{name} a... method ExecuteCommandCore (line 22) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) FILE: 84_Super_Star_Trek/csharp/Systems/PhaserControl.cs class PhaserControl (line 11) | internal class PhaserControl : Subsystem method PhaserControl (line 17) | internal PhaserControl(Enterprise enterprise, IReadWrite io, IRandom r... method CanExecuteCommand (line 25) | protected override bool CanExecuteCommand() => IsOperational("Phasers ... method ExecuteCommandCore (line 27) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method GetPhaserStrength (line 57) | private float GetPhaserStrength() method GetPerTargetPhaserStrength (line 68) | private float GetPerTargetPhaserStrength(float phaserStrength, int tar... method ResolveHitOn (line 78) | private void ResolveHitOn(Klingon klingon, float perEnemyStrength, Qua... FILE: 84_Super_Star_Trek/csharp/Systems/PhotonTubes.cs class PhotonTubes (line 8) | internal class PhotonTubes : Subsystem method PhotonTubes (line 14) | internal PhotonTubes(int tubeCount, Enterprise enterprise, IReadWrite io) method CanExecuteCommand (line 24) | protected override bool CanExecuteCommand() => HasTorpedoes() && IsOpe... method HasTorpedoes (line 26) | private bool HasTorpedoes() method ExecuteCommandCore (line 34) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method ReplenishTorpedoes (line 63) | internal void ReplenishTorpedoes() => TorpedoCount = _tubeCount; FILE: 84_Super_Star_Trek/csharp/Systems/ShieldControl.cs class ShieldControl (line 9) | internal class ShieldControl : Subsystem method ShieldControl (line 14) | internal ShieldControl(Enterprise enterprise, IReadWrite io) method CanExecuteCommand (line 23) | protected override bool CanExecuteCommand() => IsOperational("{name} i... method ExecuteCommandCore (line 25) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method Validate (line 43) | private bool Validate(float requested) method AbsorbHit (line 54) | internal void AbsorbHit(int hitStrength) => ShieldEnergy -= hitStrength; method DropShields (line 56) | internal void DropShields() => ShieldEnergy = 0; FILE: 84_Super_Star_Trek/csharp/Systems/ShortRangeSensors.cs class ShortRangeSensors (line 13) | internal class ShortRangeSensors : Subsystem method ShortRangeSensors (line 20) | internal ShortRangeSensors(Enterprise enterprise, Galaxy galaxy, Game ... method ExecuteCommandCore (line 29) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method GetStatusLines (line 51) | internal IEnumerable GetStatusLines() FILE: 84_Super_Star_Trek/csharp/Systems/Subsystem.cs class Subsystem (line 7) | internal abstract class Subsystem method Subsystem (line 11) | protected Subsystem(string name, Command command, IReadWrite io) method CanExecuteCommand (line 27) | protected virtual bool CanExecuteCommand() => true; method IsOperational (line 29) | protected bool IsOperational(string notOperationalMessage) method ExecuteCommand (line 40) | internal CommandResult ExecuteCommand(Quadrant quadrant) method ExecuteCommandCore (line 43) | protected abstract CommandResult ExecuteCommandCore(Quadrant quadrant); method Repair (line 45) | internal virtual void Repair() method Repair (line 53) | internal virtual bool Repair(float repairWorkDone) method TakeDamage (line 67) | internal void TakeDamage(float damage) => Condition -= damage; FILE: 84_Super_Star_Trek/csharp/Systems/WarpEngines.cs class WarpEngines (line 10) | internal class WarpEngines : Subsystem method WarpEngines (line 15) | internal WarpEngines(Enterprise enterprise, IReadWrite io) method ExecuteCommandCore (line 22) | protected override CommandResult ExecuteCommandCore(Quadrant quadrant) method TryGetWarpFactor (line 50) | private bool TryGetWarpFactor(out float warpFactor) method TryGetDistanceToMove (line 66) | private bool TryGetDistanceToMove(float warpFactor, out int distanceTo... FILE: 84_Super_Star_Trek/csharp/Utils/DirectionAndDistance.cs class DirectionAndDistance (line 6) | internal class DirectionAndDistance method DirectionAndDistance (line 11) | private DirectionAndDistance(float fromX, float fromY) method From (line 17) | internal static DirectionAndDistance From(Coordinates coordinates) => ... method From (line 19) | internal static DirectionAndDistance From(float x, float y) => new Dir... method To (line 21) | internal (float Direction, float Distance) To(Coordinates coordinates)... method To (line 23) | internal (float Direction, float Distance) To(float x, float y) method GetDirection (line 48) | private static float GetDirection(float deltaX, float deltaY) method GetDistance (line 62) | private static float GetDistance(float deltaX, float deltaY) => FILE: 84_Super_Star_Trek/java/Enterprise.java class Enterprise (line 6) | public class Enterprise { method Enterprise (line 39) | public Enterprise() { method getShields (line 65) | public int getShields() { method sufferHitPoints (line 73) | public void sufferHitPoints(int hits) { method getEnergy (line 77) | public int getEnergy() { method replenishSupplies (line 81) | public void replenishSupplies() { method decreaseEnergy (line 86) | public void decreaseEnergy(final double amount) { method decreaseTorpedoes (line 90) | public void decreaseTorpedoes(final int amount) { method dropShields (line 94) | public void dropShields() { method getTotalEnergy (line 98) | public int getTotalEnergy() { method getInitialEnergy (line 102) | public int getInitialEnergy() { method getTorpedoes (line 106) | public int getTorpedoes() { method getDeviceStatus (line 110) | public double[] getDeviceStatus() { method getCardinalDirections (line 114) | public int[][] getCardinalDirections() { method setDeviceStatus (line 118) | public void setDeviceStatus(final int device, final double status) { method isDocked (line 122) | public boolean isDocked() { method setDocked (line 126) | public void setDocked(boolean docked) { method getQuadrant (line 130) | public int[] getQuadrant() { method setQuadrant (line 134) | public void setQuadrant(final int[] quadrant) { method getSector (line 139) | public int[] getSector() { method setSector (line 143) | public void setSector(final int[] sector) { method moveShip (line 148) | public int[] moveShip(final float course, final int n, final String qu... method randomRepairCost (line 227) | void randomRepairCost() { method repairDamagedDevices (line 231) | public void repairDamagedDevices(final float warp) { method maneuverEnergySR (line 247) | public void maneuverEnergySR(final int N) { method shieldControl (line 256) | void shieldControl() { method damageControl (line 278) | void damageControl(GameCallback callback) { method printDeviceName (line 308) | public static String printDeviceName(final int deviceNumber) { // 8790 FILE: 84_Super_Star_Trek/java/GalaxyMap.java class GalaxyMap (line 7) | public class GalaxyMap { method getEnterprise (line 38) | public Enterprise getEnterprise() { method getBasesInGalaxy (line 42) | public int getBasesInGalaxy() { method getRemainingKlingons (line 46) | public int getRemainingKlingons() { method getKlingonsInGalaxy (line 50) | public int getKlingonsInGalaxy() { method fnd (line 54) | double fnd(int i) { method GalaxyMap (line 58) | public GalaxyMap() { method newQuadrant (line 97) | void newQuadrant(final double stardate, final double initialStardate) ... method klingonsMoveAndFire (line 157) | public void klingonsMoveAndFire(GameCallback callback) { method klingonsShoot (line 169) | void klingonsShoot(GameCallback callback) { method moveEnterprise (line 191) | public void moveEnterprise(final float course, final float warp, final... method shortRangeSensorScan (line 204) | void shortRangeSensorScan(final double stardate) { method longRangeSensorScan (line 275) | void longRangeSensorScan() { method firePhasers (line 308) | void firePhasers(GameCallback callback) { method firePhotonTorpedo (line 357) | void firePhotonTorpedo(final double stardate, final double initialStar... method cumulativeGalacticRecord (line 430) | public void cumulativeGalacticRecord(final boolean cumulativeReport) { method photonTorpedoData (line 471) | public void photonTorpedoData() { method directionDistanceCalculator (line 486) | void directionDistanceCalculator() { method printDirection (line 499) | void printDirection(int from_x, int from_y, int to_x, int to_y) { method starbaseNavData (line 535) | void starbaseNavData() { method printNoEnemyShipsMessage (line 547) | void printNoEnemyShipsMessage() { method getRegionName (line 552) | String getRegionName(final boolean regionNameOnly, final int y) { method getQuadrantName (line 568) | String getQuadrantName(final boolean regionNameOnly, final int x, fina... method insertMarker (line 611) | void insertMarker(final String marker, final int x, final int y) { method findEmptyPlaceInQuadrant (line 632) | int[] findEmptyPlaceInQuadrant(final String quadrantString) { method compareMarker (line 641) | boolean compareMarker(final String quadrantString, final String marker... FILE: 84_Super_Star_Trek/java/GameCallback.java type GameCallback (line 4) | public interface GameCallback { method enterNewQuadrant (line 5) | void enterNewQuadrant(); method incrementStardate (line 6) | void incrementStardate(double increment); method endGameSuccess (line 7) | void endGameSuccess(); method endGameFail (line 8) | void endGameFail(boolean enterpriseDestroyed); FILE: 84_Super_Star_Trek/java/SuperStarTrekGame.java class SuperStarTrekGame (line 17) | public class SuperStarTrekGame implements GameCallback { method main (line 50) | public static void main(String[] args) { method printBanner (line 61) | static void printBanner() { method orders (line 79) | void orders() { method enterNewQuadrant (line 87) | public void enterNewQuadrant() { method commandLoop (line 92) | void commandLoop() { method checkShipEnergy (line 147) | void checkShipEnergy() { method printCommandOptions (line 160) | void printCommandOptions() { method navigation (line 173) | void navigation() { method repairDamagedDevices (line 208) | void repairDamagedDevices(final float course, final float warp, final ... method longRangeSensorScan (line 224) | void longRangeSensorScan() { method firePhasers (line 229) | void firePhasers() { method firePhotonTorpedo (line 233) | void firePhotonTorpedo() { method shieldControl (line 237) | void shieldControl() { method shortRangeSensorScan (line 241) | void shortRangeSensorScan() { method libraryComputer (line 246) | void libraryComputer() { method statusReport (line 292) | void statusReport() { method incrementStardate (line 305) | public void incrementStardate(double increment) { method endGameFail (line 309) | public void endGameFail(final boolean enterpriseDestroyed) { // 6220 method endGameSuccess (line 320) | public void endGameSuccess() { method repeatGame (line 327) | void repeatGame() { FILE: 84_Super_Star_Trek/java/SuperStarTrekInstructions.java class SuperStarTrekInstructions (line 15) | public class SuperStarTrekInstructions { method main (line 17) | public static void main(String[] args) { method printBanner (line 25) | static void printBanner() { method printInstructions (line 35) | static void printInstructions() { method print (line 143) | static void print(final String s) { method tab (line 147) | static String tab(final int n) { method inputStr (line 151) | static String inputStr(final String message) { FILE: 84_Super_Star_Trek/java/Util.java class Util (line 13) | public class Util { method random (line 17) | public static float random() { method fnr (line 21) | public static int fnr() { // 475 method toInt (line 26) | public static int toInt(final double num) { method println (line 32) | public static void println(final String s) { method print (line 36) | public static void print(final String s) { method tab (line 40) | public static String tab(final int n) { method strlen (line 44) | public static int strlen(final String s) { method inputStr (line 48) | public static String inputStr(final String message) { method inputCoords (line 59) | public static int[] inputCoords(final String message) { method inputFloat (line 75) | public static float inputFloat(final String message) { method leftStr (line 90) | public static String leftStr(final String input, final int len) { method midStr (line 95) | public static String midStr(final String input, final int start, final... method rightStr (line 100) | public static String rightStr(final String input, final int len) { method round (line 105) | public static double round(double value, int places) { FILE: 84_Super_Star_Trek/javascript/superstartrek.mjs function gameMain (line 35) | async function gameMain() { constant SYSTEM_WARP_ENGINES (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_SHORT_RANGE_SENSORS (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_LONG_RANGE_SENSORS (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_PHASER_CONTROL (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_PHOTON_TUBES (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_DAMAGE_CONTROL (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_SHIELD_CONTROL (line 112) | let SYSTEM_WARP_ENGINES, constant SYSTEM_LIBRARY_COMPUTER (line 112) | let SYSTEM_WARP_ENGINES, function gameIntro (line 121) | async function gameIntro() { function gameReset (line 152) | async function gameReset() { function newQuadrantEntered (line 265) | async function newQuadrantEntered() { function gameLoop (line 394) | async function gameLoop() { function acceptCommand (line 406) | async function acceptCommand() { constant COMMANDS (line 428) | const COMMANDS = { function commandHelp (line 447) | async function commandHelp() { function shortRangeSensorScanAndStartup (line 461) | async function shortRangeSensorScanAndStartup() { function checkIfDocked (line 524) | function checkIfDocked() { function commandCourseControl (line 544) | async function commandCourseControl() { function checkIfTimeExpired (line 821) | function checkIfTimeExpired() { function consumeEnergyForWarp (line 831) | function consumeEnergyForWarp(sectorsToWarp) { function commandLongRangeScan (line 847) | async function commandLongRangeScan() { function commandPhaserControl (line 901) | async function commandPhaserControl() { function commandPhotonTorpedo (line 1023) | async function commandPhotonTorpedo() { function enemiesShoot (line 1188) | async function enemiesShoot() { function commandShieldControl (line 1256) | async function commandShieldControl() { function commandDamageControl (line 1290) | async function commandDamageControl() { function commandLibraryComputer (line 1345) | async function commandLibraryComputer() { constant COMMANDS_COMPUTER (line 1361) | const COMMANDS_COMPUTER = [ function computerHelp (line 1370) | async function computerHelp() { function computerPhotonData (line 1381) | async function computerPhotonData() { function computerStarbaseData (line 1411) | async function computerStarbaseData() { function computerDirectionData (line 1430) | async function computerDirectionData() { function computerDirectionCommon (line 1441) | async function computerDirectionCommon({ fromX, fromY, toX, toY }) { function computerStatusReport (line 1455) | async function computerStatusReport() { function computerGalaxyMap (line 1489) | async function computerGalaxyMap() { function computerCumulativeRecord (line 1494) | async function computerCumulativeRecord() { function computerCommonMap (line 1503) | async function computerCommonMap(showMapCells = true) { function endOfGame (line 1548) | async function endOfGame() { constant COURSE_TO_XY (line 1592) | const COURSE_TO_XY = [ function courseToDeltaXY (line 1604) | function courseToDeltaXY(course) { function findSpaceInSectorMap (line 1619) | function findSpaceInSectorMap() { function findInsectorMap (line 1635) | function findInsectorMap(str, y, x) { function insertInSectorMap (line 1641) | function insertInSectorMap(str, y, x) { function buildQuadrantName (line 1653) | function buildQuadrantName(y, x, regionNameOnly = false) { FILE: 84_Super_Star_Trek/python/superstartrek.py function get_user_float (line 24) | def get_user_float(prompt: str) -> float: class Entity (line 34) | class Entity(Enum): class Point (line 44) | class Point: method __str__ (line 48) | def __str__(self) -> str: class Position (line 53) | class Position: class QuadrantData (line 67) | class QuadrantData: method num (line 72) | def num(self) -> int: class KlingonShip (line 77) | class KlingonShip: class Ship (line 82) | class Ship: method __init__ (line 86) | def __init__(self) -> None: method refill (line 104) | def refill(self) -> None: method maneuver_energy (line 108) | def maneuver_energy(self, n: int) -> None: method shield_control (line 118) | def shield_control(self) -> None: class Quadrant (line 150) | class Quadrant: method __init__ (line 151) | def __init__( method quadrant_name (line 177) | def quadrant_name(cls, row: int, col: int, region_only: bool = False) ... method set_value (line 208) | def set_value(self, x: float, y: float, entity: Entity) -> None: method get_value (line 211) | def get_value(self, x: float, y: float) -> Entity: method find_empty_place (line 214) | def find_empty_place(self) -> Tuple[int, int]: method populate_quadrant (line 221) | def populate_quadrant(self, ship_position: Position) -> None: method __str__ (line 240) | def __str__(self) -> str: class World (line 248) | class World: method __init__ (line 249) | def __init__( method remaining_time (line 311) | def remaining_time(self) -> float: method has_mission_ended (line 314) | def has_mission_ended(self) -> bool: class Game (line 318) | class Game: method __init__ (line 321) | def __init__(self) -> None: method startup (line 325) | def startup(self) -> None: method new_quadrant (line 350) | def new_quadrant(self) -> None: method fnd (line 376) | def fnd(self, i: int) -> float: method klingons_fire (line 382) | def klingons_fire(self) -> None: method phaser_control (line 411) | def phaser_control(self) -> None: method photon_torpedoes (line 484) | def photon_torpedoes(self) -> None: method short_range_scan (line 579) | def short_range_scan(self) -> None: method long_range_scan (line 646) | def long_range_scan(self) -> None: method navigation (line 659) | def navigation(self) -> None: method move_ship (line 748) | def move_ship(self, warp_rounds: int, cd: float) -> None: method damage_control (line 852) | def damage_control(self) -> None: method computer (line 887) | def computer(self) -> None: method end_game (line 1031) | def end_game( function fnr (line 1080) | def fnr() -> int: function print_scan_results (line 1085) | def print_scan_results( function print_direction (line 1111) | def print_direction(source: Point, to: Point) -> None: function main (line 1139) | def main() -> None: FILE: 84_Super_Star_Trek/python/superstartrekins.py function get_yes_no (line 11) | def get_yes_no(prompt: str) -> bool: function print_header (line 16) | def print_header() -> None: function print_instructions (line 31) | def print_instructions() -> None: function main (line 142) | def main() -> None: FILE: 84_Super_Star_Trek/rust/src/commands.rs function perform_short_range_scan (line 5) | pub fn perform_short_range_scan(galaxy: &Galaxy) { function get_amount_and_set_shields (line 14) | pub fn get_amount_and_set_shields(galaxy: &mut Galaxy, provided: Vec (f32, f32) { function klingons_move (line 249) | fn klingons_move(galaxy: &mut Galaxy) { function klingons_fire (line 264) | fn klingons_fire(galaxy: &mut Galaxy) { function run_damage_control (line 276) | pub fn run_damage_control(galaxy: &Galaxy) { function try_starbase_ship_repair (line 285) | pub fn try_starbase_ship_repair(galaxy: &mut Galaxy) { function perform_long_range_scan (line 305) | pub fn perform_long_range_scan(galaxy: &mut Galaxy) { function access_computer (line 317) | pub fn access_computer(galaxy: &Galaxy, provided: Vec) { function show_klingon_direction_data (line 348) | fn show_klingon_direction_data(galaxy: &Galaxy) { function show_starbase_direction_data (line 363) | fn show_starbase_direction_data(galaxy: &Galaxy) { function direction_dist_calculator (line 379) | fn direction_dist_calculator(galaxy: &Galaxy) { function get_power_and_fire_phasers (line 397) | pub fn get_power_and_fire_phasers(galaxy: &mut Galaxy, provided: Vec Vec { FILE: 84_Super_Star_Trek/rust/src/input.rs function prompt (line 3) | pub fn prompt(prompt_text: &str) -> Vec { function prompt_yes_no (line 17) | pub fn prompt_yes_no(prompt_text: &str) -> bool { function prompt_value (line 33) | pub fn prompt_value(prompt_text: &str, min: T, ... function param_or_prompt_value (line 44) | pub fn param_or_prompt_value(params: &Vec(prompt_text: &str, min... FILE: 84_Super_Star_Trek/rust/src/main.rs function main (line 11) | fn main() { FILE: 84_Super_Star_Trek/rust/src/model.rs type Galaxy (line 7) | pub struct Galaxy { method remaining_klingons (line 236) | pub fn remaining_klingons(&self) -> u8 { method remaining_starbases (line 241) | pub fn remaining_starbases(&self) -> u8 { method generate_new (line 246) | pub fn generate_new() -> Self { method new_captain (line 266) | pub fn new_captain(quadrants: &Vec) -> Enterprise { method generate_quadrants (line 280) | fn generate_quadrants() -> Vec { type Quadrant (line 15) | pub struct Quadrant { method sector_status (line 313) | pub fn sector_status(&self, sector: Pos) -> SectorStatus { method is_starbase (line 325) | fn is_starbase(&self, sector: Pos) -> bool { method has_klingon (line 332) | fn has_klingon(&self, sector: Pos) -> bool { method get_klingon (line 337) | pub fn get_klingon(&mut self, sector: Pos) -> Option<&mut Klingon> { method find_empty_sector (line 342) | pub fn find_empty_sector(&self) -> Pos { method docked_at_starbase (line 352) | pub fn docked_at_starbase(&self, enterprise_sector: Pos) -> bool { type StarBase (line 21) | pub struct StarBase { type Klingon (line 26) | pub struct Klingon { method fire_on (line 32) | pub fn fire_on(&mut self, enterprise: &mut Enterprise) { type Enterprise (line 44) | pub struct Enterprise { method take_hit (line 54) | fn take_hit(&mut self, sector: Pos, hit_strength: u16) { method take_damage (line 76) | fn take_damage(&mut self, hit_strength: u16) { method damage_system (line 89) | pub fn damage_system(&mut self, system: &str, damage: f32) { method repair_system (line 93) | pub fn repair_system(&mut self, system: &str, amount: f32) -> bool { method is_stranded (line 104) | pub fn is_stranded(&self) -> bool { constant SHORT_RANGE_SCAN (line 115) | pub const SHORT_RANGE_SCAN: &str = "SRS"; constant WARP_ENGINES (line 116) | pub const WARP_ENGINES: &str = "NAV"; constant SHIELD_CONTROL (line 117) | pub const SHIELD_CONTROL: &str = "SHE"; constant DAMAGE_CONTROL (line 118) | pub const DAMAGE_CONTROL: &str = "DAM"; constant LONG_RANGE_SCAN (line 119) | pub const LONG_RANGE_SCAN: &str = "LRS"; constant COMPUTER (line 120) | pub const COMPUTER: &str = "COM"; constant PHASERS (line 121) | pub const PHASERS: &str = "PHA"; constant TORPEDOES (line 122) | pub const TORPEDOES: &str = "TOR"; constant RESIGN (line 124) | pub const RESIGN: &str = "XXX"; constant KEYS (line 126) | pub const KEYS: [&str; 8] = [ function name_for (line 130) | pub fn name_for(key: &str) -> String { type Pos (line 146) | pub struct Pos(pub u8, pub u8); method as_index (line 149) | pub fn as_index(&self) -> usize { method abs_diff (line 153) | pub fn abs_diff(&self, other: Pos) -> u8 { method dist (line 157) | pub fn dist(&self, other: Pos) -> u8 { method direction (line 163) | pub fn direction(&self, other: Pos) -> f32 { method as_galactic_sector (line 184) | pub fn as_galactic_sector(&self, containing_quadrant: Pos) -> Self { method to_local_quadrant_sector (line 188) | pub fn to_local_quadrant_sector(&self) -> (Self, Self) { type Output (line 194) | type Output = Self; method mul (line 196) | fn mul(self, rhs: u8) -> Self::Output { type Output (line 202) | type Output = Self; method add (line 204) | fn add(self, rhs: Pos) -> Self::Output { method fmt (line 210) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { constant COURSES (line 215) | pub const COURSES : [(f32, f32); 9] = [ type SectorStatus (line 228) | pub enum SectorStatus { constant MAX_PHOTON_TORPEDOES (line 232) | pub const MAX_PHOTON_TORPEDOES: u8 = 28; constant MAX_ENERGY (line 233) | pub const MAX_ENERGY: u16 = 3000; FILE: 84_Super_Star_Trek/rust/src/view.rs constant INSTRUCTIONS (line 4) | pub const INSTRUCTIONS: &str = "Do you need instructions"; constant COURSE (line 5) | pub const COURSE: &str = "Course (1-9)?"; constant TORPEDO_COURSE (line 6) | pub const TORPEDO_COURSE: &str = "Photon torpedo course (1-9)?"; constant SHIELDS (line 7) | pub const SHIELDS: &str = "Number of units to shields"; constant REPAIR (line 8) | pub const REPAIR: &str = "Will you authorize the repair order"; constant COMPUTER (line 9) | pub const COMPUTER: &str = "Computer active and waiting command?"; constant PHASERS (line 10) | pub const PHASERS: &str = "Number of units to fire"; constant WHEN_READY (line 11) | pub const WHEN_READY: &str = "Press Enter when ready to accept command"; constant COMMAND (line 12) | pub const COMMAND: &str = "Command?"; constant INITIAL_COORDS (line 13) | pub const INITIAL_COORDS: &str = " Initial coordinates (X/Y)"; constant TARGET_COORDS (line 14) | pub const TARGET_COORDS: &str = " Final coordinates (X/Y)"; function warp_factor (line 16) | pub fn warp_factor(max_warp: f32) -> String { function title (line 21) | pub fn title() { function full_instructions (line 53) | pub fn full_instructions() { function enterprise (line 164) | pub fn enterprise() { function intro (line 192) | pub fn intro(model: &Galaxy) { constant REGION_NAMES (line 206) | const REGION_NAMES: [&str; 16] = [ constant SUB_REGION_NAMES (line 225) | const SUB_REGION_NAMES: [&str; 4] = ["I", "II", "III", "IV"]; function quadrant_name (line 227) | fn quadrant_name(quadrant: Pos) -> String { function starting_quadrant (line 233) | pub fn starting_quadrant(quadrant: Pos) { function enter_quadrant (line 239) | pub fn enter_quadrant(quadrant: Pos) { function short_range_scan (line 243) | pub fn short_range_scan(model: &Galaxy) { function print_command_help (line 286) | pub fn print_command_help() { function end_game_failure (line 301) | pub fn end_game_failure(galaxy: &Galaxy) { function enterprise_destroyed (line 309) | pub fn enterprise_destroyed() { function bad_course_data (line 313) | pub fn bad_course_data() { function bad_nav (line 317) | pub fn bad_nav(current_sector: Pos) { function bad_torpedo_course (line 321) | pub fn bad_torpedo_course() { function enterprise_hit (line 325) | pub fn enterprise_hit(hit_strength: &u16, from_sector: Pos) { function hit_edge (line 329) | pub fn hit_edge(quadrant: Pos, sector: Pos) { function condition_red (line 338) | pub fn condition_red() { function danger_shields (line 342) | pub fn danger_shields() { function insuffient_warp_energy (line 346) | pub fn insuffient_warp_energy(warp_speed: f32) { function divert_energy_from_shields (line 352) | pub fn divert_energy_from_shields() { function energy_available (line 356) | pub fn energy_available(total_energy: u16) { function shields_unchanged (line 360) | pub fn shields_unchanged() { function ridiculous (line 364) | pub fn ridiculous() { function shields_set (line 368) | pub fn shields_set(value: u16) { function shields_hit (line 374) | pub fn shields_hit(shields: u16) { function inoperable (line 378) | pub fn inoperable(arg: &str) { function scanners_out (line 382) | pub fn scanners_out() { function damaged_engines (line 386) | pub fn damaged_engines(max_warp: f32, warp_factor: f32) { function damage_control_report (line 392) | pub fn damage_control_report() { function random_repair_report_for (line 396) | pub fn random_repair_report_for(name: &str, damaged: bool) { function system_repair_completed (line 404) | pub fn system_repair_completed(name: String) { function damage_control (line 408) | pub fn damage_control(enterprise: &Enterprise) { function long_range_scan (line 417) | pub fn long_range_scan(galaxy: &Galaxy) -> Vec { function stranded (line 451) | pub fn stranded() { function computer_options (line 458) | pub fn computer_options() { function galaxy_region_map (line 468) | pub fn galaxy_region_map() { function galaxy_scanned_map (line 480) | pub fn galaxy_scanned_map(galaxy: &Galaxy) { function no_local_enemies (line 501) | pub fn no_local_enemies() { function computer_accuracy_issue (line 507) | pub fn computer_accuracy_issue() { function phasers_locked (line 511) | pub fn phasers_locked(available_energy: u16) { function starbase_shields (line 515) | pub fn starbase_shields() { function repair_estimate (line 519) | pub fn repair_estimate(repair_time: f32) { function no_damage (line 525) | pub fn no_damage(sector: Pos) { function hit_on_klingon (line 529) | pub fn hit_on_klingon(hit_strength: f32, sector: Pos) { function klingon_remaining_energy (line 533) | pub fn klingon_remaining_energy(energy: f32) { function klingon_destroyed (line 537) | pub fn klingon_destroyed() { function congratulations (line 541) | pub fn congratulations(efficiency: f32) { function replay (line 550) | pub fn replay() { function no_torpedoes_remaining (line 557) | pub fn no_torpedoes_remaining() { function torpedo_track (line 561) | pub fn torpedo_track() { function torpedo_path (line 565) | pub fn torpedo_path(sector: Pos) { function torpedo_missed (line 569) | pub fn torpedo_missed() { function star_absorbed_torpedo (line 573) | pub fn star_absorbed_torpedo(sector: Pos) { function destroyed_starbase (line 577) | pub fn destroyed_starbase(not_the_last_starbase: bool) { function no_local_starbase (line 590) | pub fn no_local_starbase() { function starbase_report (line 594) | pub fn starbase_report() { function direction_distance (line 598) | pub fn direction_distance(dir: f32, dist: u8) { function status_report (line 605) | pub fn status_report(galaxy: &Galaxy) { function direction_dist_intro (line 621) | pub fn direction_dist_intro(enterprise: &Enterprise) { function klingon_report (line 629) | pub fn klingon_report(more_than_one: bool) { FILE: 85_Synonym/csharp/Synonym.cs class Synonym (line 5) | class Synonym method DisplayIntro (line 27) | private void DisplayIntro() method DisplayOutro (line 41) | private void DisplayOutro() method RandomizeTheList (line 46) | private void RandomizeTheList() method GetAnAffirmation (line 57) | private string GetAnAffirmation() method CheckTheResponse (line 62) | private bool CheckTheResponse(string WordName, int WordIndex, string L... method PromptForSynonym (line 96) | private string PromptForSynonym(string WordName) method AskForSynonyms (line 104) | private void AskForSynonyms() method PlayTheGame (line 129) | public void PlayTheGame() class Program (line 140) | class Program method Main (line 142) | static void Main(string[] args) FILE: 85_Synonym/java/src/Synonym.java class Synonym (line 14) | public class Synonym { type GAME_STATE (line 24) | private enum GAME_STATE { method Synonym (line 35) | public Synonym() { method play (line 46) | public void play() { method intro (line 101) | private void intro() { method displayTextAndGetInput (line 121) | private String displayTextAndGetInput(String text) { method simulateTabs (line 132) | private String simulateTabs(int spaces) { FILE: 85_Synonym/java/src/SynonymGame.java class SynonymGame (line 1) | public class SynonymGame { method main (line 2) | public static void main(String[] args) { FILE: 85_Synonym/java/src/SynonymList.java class SynonymList (line 7) | public class SynonymList { method SynonymList (line 13) | public SynonymList(String word, String[] synonyms) { method exists (line 25) | public boolean exists(String word) { method getWord (line 29) | public String getWord() { method size (line 33) | public int size() { method getSynonyms (line 42) | public String[] getSynonyms() { FILE: 85_Synonym/javascript/synonym.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 62) | async function main() FILE: 85_Synonym/python/synonym.py function print_centered (line 14) | def print_centered(msg: str) -> None: function print_header (line 19) | def print_header(title: str) -> None: function print_instructions (line 27) | def print_instructions() -> None: function print_right (line 52) | def print_right() -> None: function ask_question (line 56) | def ask_question(question_number: int) -> None: function finish (line 79) | def finish() -> None: function main (line 84) | def main() -> None: FILE: 85_Synonym/rust/src/main.rs function print_centered (line 6) | fn print_centered(text: &str, width: usize) { function print_instructions (line 15) | fn print_instructions() { function ask_question (line 23) | fn ask_question(mut this_question: Vec<&str>) { function main (line 51) | fn main() { FILE: 86_Target/csharp/Angle.cs class Angle (line 3) | internal class Angle method Angle (line 11) | private Angle(float radians) => _radians = radians; method InDegrees (line 13) | public static Angle InDegrees(float degrees) => new (degrees / Degrees... method InRotations (line 14) | public static Angle InRotations(float rotations) => new (2 * PI * rota... FILE: 86_Target/csharp/Explosion.cs class Explosion (line 3) | internal class Explosion method Explosion (line 7) | public Explosion(Point position, Offset targetOffset) method GetBearing (line 17) | public string GetBearing() => _position.GetBearing(); FILE: 86_Target/csharp/FiringRange.cs class FiringRange (line 5) | internal class FiringRange method FiringRange (line 10) | public FiringRange(IRandom random) method NextTarget (line 15) | public Point NextTarget() => _targetPosition = _random.NextPosition(); method Fire (line 17) | public Explosion Fire(Angle angleFromX, Angle angleFromZ, float distance) FILE: 86_Target/csharp/Game.cs class Game (line 6) | internal class Game method Game (line 12) | public Game(IReadWrite io, FiringRange firingRange) method Play (line 18) | public void Play() method Shoot (line 50) | private Explosion Shoot() method ReportHit (line 60) | private void ReportHit(float distance) method ReportMiss (line 70) | private void ReportMiss(Explosion explosion) method ReportMiss (line 80) | private void ReportMiss(Offset targetOffset) method ReportMiss (line 87) | private void ReportMiss(float delta, string positiveText, string negat... method GetOffsetText (line 90) | private static string GetOffsetText(string text, float distance) => $"... FILE: 86_Target/csharp/Offset.cs class Offset (line 5) | internal class Offset method Offset (line 7) | public Offset(float deltaX, float deltaY, float deltaZ) FILE: 86_Target/csharp/Point.cs class Point (line 5) | internal class Point method Point (line 16) | public Point(Angle angleFromX, Angle angleFromZ, float distance) method EstimateDistance (line 29) | public float EstimateDistance() => method EstimateDistance (line 39) | public float EstimateDistance(int precision) => (float)Math.Floor(Dist... method GetBearing (line 41) | public string GetBearing() => $"Radians from X axis = {_angleFromX} ... method ToString (line 43) | public override string ToString() => $"X= {_x} Y = {_y} Z= {_z}"; FILE: 86_Target/csharp/Program.cs class Program (line 8) | class Program method Main (line 10) | static void Main() method Play (line 18) | public static void Play(Game game, TextIO io, Func playAgain) method DisplayTitleAndInstructions (line 36) | private static void DisplayTitleAndInstructions(TextIO io) FILE: 86_Target/csharp/RandomExtensions.cs class RandomExtensions (line 5) | internal static class RandomExtensions method NextPosition (line 7) | public static Point NextPosition(this IRandom rnd) => new ( FILE: 86_Target/java/Target.java class Target (line 8) | public class Target { method main (line 12) | public static void main(String[] args) { method readInput (line 99) | private static TargetAttempt readInput(Scanner scan) { method printIntro (line 119) | private static void printIntro() { class TargetAttempt (line 138) | private static class TargetAttempt { FILE: 86_Target/javascript/target.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 86_Target/python/target.py function print_centered (line 16) | def print_centered(msg: str) -> None: function print_header (line 21) | def print_header(title: str) -> None: function print_instructions (line 29) | def print_instructions() -> None: function prompt (line 45) | def prompt() -> List[float]: function next_target (line 58) | def next_target() -> None: function describe_miss (line 65) | def describe_miss(x, y, z, x1, y1, z1, d) -> None: function do_shot_loop (line 92) | def do_shot_loop(p1, x, y, z) -> None: function show_radians (line 141) | def show_radians(a, b) -> None: function play_game (line 145) | def play_game() -> None: function main (line 164) | def main() -> None: FILE: 87_3-D_Plot/csharp/Function.cs class Function (line 6) | internal static class Function method GetRows (line 8) | internal static IEnumerable> GetRows() method GetValues (line 16) | private static IEnumerable GetValues(float x) method GetValue (line 33) | private static int GetValue(float x, float y) FILE: 87_3-D_Plot/csharp/Program.cs class Program (line 5) | class Program method Main (line 7) | static void Main(string[] args) method PrintTitle (line 21) | private static void PrintTitle() method Plot (line 31) | private static void Plot(int z) FILE: 87_3-D_Plot/java/Plot3D.java class Plot3D (line 16) | public class Plot3D { method play (line 19) | public void play() { method showIntro (line 27) | private void showIntro() { method startGame (line 36) | private void startGame() { method func (line 83) | public double func(double inputVal) { method main (line 90) | public static void main(String[] args) { FILE: 87_3-D_Plot/javascript/3dplot.js function print (line 5) | function print(str) function tab (line 10) | function tab(space) function equation (line 18) | function equation(input) FILE: 87_3-D_Plot/python/3dplot.py function equation (line 10) | def equation(x: float) -> float: function main (line 14) | def main() -> None: FILE: 87_3-D_Plot/ruby/3dplot.rb function intro (line 1) | def intro function fna (line 6) | def fna(z) = 30 * Math.exp(-z * z / 100) function render (line 8) | def render function main (line 23) | def main FILE: 87_3-D_Plot/rust/src/main.rs function main (line 9) | fn main() { FILE: 88_3-D_Tic-Tac-Toe/csharp/Program.cs class Program (line 3) | class Program method Main (line 5) | static void Main() FILE: 88_3-D_Tic-Tac-Toe/csharp/Qubic.cs class Qubic (line 10) | internal class Qubic method Qubic (line 50) | public Qubic() { } method Run (line 57) | public void Run() method Title (line 74) | private static void Title() method Instructions (line 88) | private static void Instructions() method PlayerMovePreference (line 120) | private static bool PlayerMovePreference() method Loop (line 131) | private void Loop() method RetryPrompt (line 198) | private static bool RetryPrompt() method ReadYesNo (line 209) | private static bool ReadYesNo() type PlayerAction (line 241) | private enum PlayerAction method PlayerMove (line 259) | private PlayerAction PlayerMove() method ReadMove (line 302) | private static int ReadMove() method ReadInteger (line 317) | private static int ReadInteger() method ShowBoard (line 341) | private void ShowBoard() method CheckPlayerWin (line 384) | private bool CheckPlayerWin() method CheckMachineWin (line 411) | private bool CheckMachineWin() method DisplayRow (line 441) | private void DisplayRow(int row) type MachineAction (line 455) | private enum MachineAction method MachineMove (line 496) | private MachineAction MachineMove() method BlockPlayer (line 538) | private MachineAction BlockPlayer() method MakePlayerTrap (line 586) | private MachineAction MakePlayerTrap() method BlockMachineTrap (line 661) | private MachineAction BlockMachineTrap() method MakeOrBlockTrap (line 727) | private MachineAction MakeOrBlockTrap(int row) method MoveByPlane (line 778) | private MachineAction MoveByPlane() method MovePlaneEdge (line 855) | private MachineAction MovePlaneEdge(int row, double spaceValue) method MoveCornerOrCenter (line 931) | private MachineAction MoveCornerOrCenter() method MoveAnyOpenSpace (line 955) | private MachineAction MoveAnyOpenSpace() method DrawGame (line 975) | private MachineAction DrawGame() method TryCoordToIndex (line 1016) | private static bool TryCoordToIndex(int coord, out int index) method IndexToCoord (line 1053) | private static int IndexToCoord(int index) method RefreshRowSums (line 1078) | private void RefreshRowSums() method RefreshRowSum (line 1091) | private double RefreshRowSum(int row) method PlaneSum (line 1109) | private double PlaneSum(int plane) method CheckDraw (line 1136) | private bool CheckDraw() method ClearPotentialMoves (line 1166) | private void ClearPotentialMoves() method ClearBoard (line 1182) | private void ClearBoard() FILE: 88_3-D_Tic-Tac-Toe/csharp/QubicData.cs class QubicData (line 31) | internal static class QubicData FILE: 88_3-D_Tic-Tac-Toe/javascript/qubit.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_board (line 127) | function show_board() function process_board (line 155) | function process_board() function check_for_lines (line 163) | function check_for_lines() function show_square (line 174) | function show_square(m) function select_move (line 184) | function select_move() { function main (line 204) | async function main() FILE: 88_3-D_Tic-Tac-Toe/python/qubit.py class Move (line 11) | class Move(Enum): class Player (line 26) | class Player(Enum): class TicTacToe3D (line 32) | class TicTacToe3D: method __init__ (line 35) | def __init__(self) -> None: method get (line 123) | def get(self, x, y, z) -> Player: method move_3d (line 132) | def move_3d(self, x, y, z, player) -> bool: method move (line 136) | def move(self, m, player) -> bool: method get_3d_position (line 143) | def get_3d_position(self, m) -> Tuple[int, int, int]: method evaluate_lines (line 149) | def evaluate_lines(self) -> None: method strategy_mark_line (line 155) | def strategy_mark_line(self, i) -> None: method clear_strategy_marks (line 161) | def clear_strategy_marks(self) -> None: method mark_and_move (line 166) | def mark_and_move(self, vlow, vhigh, vmove) -> Optional[Tuple[Move, in... method machine_move (line 186) | def machine_move(self) -> Union[None, Tuple[Move, int], Tuple[Move, in... method human_win (line 233) | def human_win(self, i) -> Tuple[Move, int, int]: method machine_win (line 236) | def machine_win(self, i) -> Optional[Tuple[Move, int, int]]: method block_human_win (line 243) | def block_human_win(self, i) -> Optional[Tuple[Move, int]]: method move_triple (line 250) | def move_triple(self, i) -> Tuple[Move, int]: method move_diagonals (line 259) | def move_diagonals(self, i, s) -> Optional[Tuple[Move, int]]: class Qubit (line 268) | class Qubit: method move_code (line 269) | def move_code(self, board, m) -> str: method show_win (line 273) | def show_win(self, board, i) -> None: method show_board (line 277) | def show_board(self, board) -> None: method human_move (line 288) | def human_move(self, board) -> bool: method play (line 311) | def play(self) -> None: FILE: 89_Tic-Tac-Toe/java/src/Board.java class Board (line 4) | public class Board { method Board (line 7) | public Board() { method setArr (line 20) | public void setArr(int position, char player) { method printBoard (line 28) | public void printBoard() { method getBoardValue (line 39) | public char getBoardValue(int x) { method checkWin (line 49) | public boolean checkWin(char player) { method checkDraw (line 78) | public boolean checkDraw() { method clear (line 90) | public void clear() { FILE: 89_Tic-Tac-Toe/java/src/TicTacToe2.java class TicTacToe2 (line 7) | public class TicTacToe2 { method main (line 8) | public static void main(String[] args) { FILE: 89_Tic-Tac-Toe/javascript/tictactoe1.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function mf (line 45) | function mf(x) function computer_moves (line 50) | function computer_moves() function main (line 58) | async function main() FILE: 89_Tic-Tac-Toe/javascript/tictactoe2.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function who_win (line 47) | function who_win(piece) function show_board (line 56) | function show_board() function main (line 110) | async function main() FILE: 89_Tic-Tac-Toe/python/TicTacToe_Hard.py class TicTacToe (line 4) | class TicTacToe: method __init__ (line 5) | def __init__(self, pick, sz=3) -> None: method clear_board (line 10) | def clear_board(self) -> List[List[str]]: method move_record (line 13) | def move_record(self, r, c) -> Union[str, bool]: method check_win (line 21) | def check_win(self) -> int: # 1 you won, 0 computer won, -1 tie method next_move (line 89) | def next_move(self) -> Union[Tuple[int, int], Tuple[List[int], List[in... function display (line 163) | def display(game: TicTacToe) -> None: function main (line 178) | def main() -> None: FILE: 89_Tic-Tac-Toe/python/tictactoe2.py class OccupiedBy (line 5) | class OccupiedBy(Enum): class Winner (line 11) | class Winner(Enum): class Space (line 18) | class Space(Enum): function line_170 (line 30) | def line_170(board, g, h, j, k): function line_150 (line 53) | def line_150(board, g, h, j, k): function line_120 (line 73) | def line_120(board, g, h, j, k): function line_118 (line 77) | def line_118(board, g, h): function think (line 83) | def think(board, g, h, moves): function render_board (line 115) | def render_board(board, space_mapping): function determine_winner (line 128) | def determine_winner(board, g): function computer_think (line 165) | def computer_think(board): function prompt_player (line 173) | def prompt_player(board): function main (line 187) | def main() -> None: FILE: 89_Tic-Tac-Toe/rust/src/main.rs constant WIN (line 4) | const WIN: [(usize, usize, usize); 8] = [ type Board (line 15) | type Board = [Sign; 9]; function main (line 17) | fn main() { type Sign (line 41) | enum Sign { method fmt (line 49) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { function check_board (line 60) | fn check_board(board: Board) -> (bool, Sign) { function clear (line 72) | fn clear() { function input (line 76) | fn input(message: &str) -> usize { function render (line 94) | fn render(spots: &Board, sign: &Sign) { FILE: 90_Tower/csharp/Game.cs class Game (line 8) | internal class Game method Game (line 15) | public Game(int diskCount) method Play (line 22) | public bool Play() method CheckProgress (line 53) | private bool? CheckProgress() FILE: 90_Tower/csharp/Models/Needle.cs class Needle (line 7) | internal class Needle : IEnumerable method TryPut (line 15) | public bool TryPut(int disk) method TryGetTopDisk (line 26) | public bool TryGetTopDisk(out int disk) => _disks.TryPop(out disk); method GetEnumerator (line 28) | public IEnumerator GetEnumerator() => method GetEnumerator (line 31) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); FILE: 90_Tower/csharp/Models/Towers.cs class Towers (line 9) | internal class Towers : IEnumerable<(int, int, int)> method Towers (line 16) | public Towers(int diskCount) method TryFindDisk (line 29) | public bool TryFindDisk(int disk, out int needle, out string message) method TryMoveDisk (line 49) | public bool TryMoveDisk(int from, int to) method GetEnumerator (line 62) | public IEnumerator<(int, int, int)> GetEnumerator() => new TowersEnume... method GetEnumerator (line 64) | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); class TowersEnumerator (line 66) | private class TowersEnumerator : IEnumerator<(int, int, int)> method TowersEnumerator (line 70) | public TowersEnumerator(Needle[] needles) method Dispose (line 80) | public void Dispose() => _enumerators.ForEach(e => e.Dispose()); method MoveNext (line 82) | public bool MoveNext() => _enumerators.All(e => e.MoveNext()); method Reset (line 84) | public void Reset() => _enumerators.ForEach(e => e.Reset()); FILE: 90_Tower/csharp/Program.cs class Program (line 7) | class Program method Main (line 9) | static void Main(string[] args) FILE: 90_Tower/csharp/Resources/Strings.cs class Strings (line 7) | internal static class Strings method GetResource (line 31) | private static string GetResource([CallerMemberName] string name = "") FILE: 90_Tower/csharp/UI/Input.cs class Input (line 7) | internal static class Input method Prompt (line 9) | private static void Prompt(string text = "") => Console.Write($"{text}... method ReadYesNo (line 11) | internal static bool ReadYesNo(string prompt, string retryPrompt) method TryReadNumber (line 23) | internal static bool TryReadNumber(Prompt prompt, out int number) method ReadNumber (line 42) | private static float ReadNumber(string prompt) method ReadString (line 62) | private static string ReadString(string prompt) method ReadStrings (line 74) | private static string[] ReadStrings() => Console.ReadLine().Split(',',... method TryParseNumber (line 76) | private static bool TryParseNumber(string text, out float number) FILE: 90_Tower/csharp/UI/Prompt.cs class Prompt (line 7) | internal class Prompt method Prompt (line 19) | private Prompt(string prompt, string retryMessage, string quitMessage,... method TryValidateResponse (line 35) | public bool TryValidateResponse(float number, out int integer) FILE: 90_Tower/csharp/UI/TowerDisplay.cs class TowerDisplay (line 7) | internal class TowerDisplay method TowerDisplay (line 11) | public TowerDisplay(Towers towers) method ToString (line 16) | public override string ToString() FILE: 90_Tower/java/Tower.java class Tower (line 16) | public class Tower { type Step (line 31) | private enum Step { method Tower (line 36) | public Tower() { class Position (line 46) | public class Position { method Position (line 51) | public Position(int row, int column) { method play (line 60) | public void play() { method showIntro (line 68) | private void showIntro() { method startGame (line 77) | private void startGame() { method isPuzzleSolved (line 384) | private boolean isPuzzleSolved() { method getDiskPosition (line 403) | private Position getDiskPosition(int disk) { method isDiskMovable (line 434) | private boolean isDiskMovable(int disk, int row, int column) { method isNeedleSafe (line 458) | private boolean isNeedleSafe(int needle, int disk, int row) { method printPositions (line 477) | private void printPositions() { method main (line 520) | public static void main(String[] args) { FILE: 90_Tower/javascript/tower.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function show_towers (line 48) | function show_towers() function main (line 73) | async function main() FILE: 90_Tower/python/tower.py class Disk (line 5) | class Disk: method __init__ (line 6) | def __init__(self, size: int) -> None: method size (line 9) | def size(self) -> int: method print (line 12) | def print(self) -> None: class Tower (line 16) | class Tower: method __init__ (line 17) | def __init__(self) -> None: method empty (line 20) | def empty(self) -> bool: method top (line 23) | def top(self) -> Optional[Disk]: method add (line 26) | def add(self, disk: Disk) -> None: method pop (line 36) | def pop(self) -> Disk: method print (line 41) | def print(self) -> None: class Game (line 46) | class Game: method __init__ (line 47) | def __init__(self) -> None: method winner (line 62) | def winner(self) -> bool: method print (line 65) | def print(self) -> None: method moves (line 69) | def moves(self) -> int: method which_disk (line 72) | def which_disk(self) -> int: method pick_disk (line 78) | def pick_disk(self) -> Optional[Tower]: method which_tower (line 95) | def which_tower(self) -> Optional[Tower]: method take_turn (line 107) | def take_turn(self) -> None: function main (line 129) | def main() -> None: FILE: 90_Tower/rust/src/disk.rs type Disk (line 1) | pub struct Disk { method new (line 6) | pub fn new(size: u8) -> Self { method draw (line 10) | pub fn draw(&self) { FILE: 90_Tower/rust/src/game.rs type Game (line 7) | pub struct Game { method new (line 14) | pub fn new() -> Self { method update (line 45) | pub fn update(&mut self) -> bool { method draw (line 79) | pub fn draw(&self) { method get_disk_to_move (line 90) | fn get_disk_to_move(&self) -> (usize, usize) { method ask_which_needle (line 117) | fn ask_which_needle(&self) -> usize { method move_disk (line 129) | fn move_disk(&mut self, disk: usize, from: usize, to: usize) { FILE: 90_Tower/rust/src/main.rs function main (line 9) | fn main() { FILE: 90_Tower/rust/src/needle.rs type Needle (line 3) | pub struct Needle { method draw (line 9) | pub fn draw(&self, row: u8) { method add (line 23) | pub fn add(&mut self, size: u8) { FILE: 90_Tower/rust/src/util.rs type PromptResult (line 3) | pub enum PromptResult { function prompt (line 8) | pub fn prompt(numeric: bool, msg: &str) -> PromptResult { function get_disk_count (line 37) | pub fn get_disk_count() -> u8 { FILE: 91_Train/csharp/Train/TrainGame.cs class TrainGame (line 6) | public class TrainGame method Main (line 11) | static void Main() method GameLoop (line 17) | public void GameLoop() method PlayGame (line 27) | private void PlayGame() method IsWithinAllowedDifference (line 52) | public static bool IsWithinAllowedDifference(int percentageDifference,... method CalculatePercentageDifference (line 57) | private static int CalculatePercentageDifference(double userInputCarJo... method CalculateCarJourneyDuration (line 62) | public static double CalculateCarJourneyDuration(double carSpeed, doub... method GenerateRandomNumber (line 67) | public double GenerateRandomNumber(int baseSpeed, int multiplier) method TryAgain (line 72) | private bool TryAgain() method IsInputYes (line 78) | public static bool IsInputYes(string consoleInput) method DisplayIntroText (line 84) | private void DisplayIntroText() FILE: 91_Train/csharp/TrainTests/TrainGameTests.cs class TrainGameTests (line 6) | public class TrainGameTests method MiniumRandomNumber (line 8) | [Fact] method MaximumRandomNumber (line 15) | [Fact] method IsInputYesWhenY (line 22) | [Fact] method IsInputYesWhenNotY (line 28) | [Fact] method CarDurationTest (line 34) | [Fact] method IsWithinAllowedDifference (line 40) | [Fact] method IsNotWithinAllowedDifference (line 47) | [Fact] FILE: 91_Train/java/src/Train.java class Train (line 13) | public class Train { method Train (line 17) | public Train() { method process (line 21) | public void process() { method intro (line 56) | private void intro() { method displayTextAndGetInput (line 70) | private String displayTextAndGetInput(String text) { method yesEntered (line 81) | private boolean yesEntered(String text) { method stringIsAnyValue (line 94) | private boolean stringIsAnyValue(String text, String... values) { method main (line 105) | public static void main(String[] args) { FILE: 91_Train/javascript/train.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 91_Train/python/train.py function play_game (line 9) | def play_game() -> None: function main (line 31) | def main() -> None: FILE: 91_Train/ruby/train.rb function intro (line 1) | def intro function get_user_guess (line 12) | def get_user_guess function main (line 26) | def main FILE: 91_Train/rust/src/lib.rs type Config (line 12) | pub struct Config { method new (line 16) | pub fn new() -> Result> { function run (line 27) | pub fn run(_config: &Config) -> Result<(), Box> { function get_string_from_user_input (line 86) | fn get_string_from_user_input(prompt: &str) -> Result(prompt: &str,... FILE: 91_Train/rust/src/main.rs function main (line 12) | fn main() { function welcome (line 33) | fn welcome() { FILE: 92_Trap/csharp/Program.cs class Program (line 5) | class Program method Main (line 9) | static void Main(string[] args) method PrintInstructions (line 62) | static void PrintInstructions() method Print (line 81) | static void Print(string stringToPrint) method Print (line 85) | static void Print() method GetGuesses (line 89) | static void GetGuesses(int nGuess, ref int lowGuess, ref int highGuess) method GetIntFromConsole (line 105) | static int GetIntFromConsole(string prompt) FILE: 92_Trap/java/src/Trap.java class Trap (line 13) | public class Trap { type GAME_STATE (line 18) | private enum GAME_STATE { method Trap (line 38) | public Trap() { method play (line 49) | public void play() { method showGuessResult (line 109) | private String showGuessResult(int start, int end) { method instructions (line 123) | private void instructions() { method intro (line 136) | private void intro() { method getDelimitedValue (line 151) | private int getDelimitedValue(String text, int pos) { method yesEntered (line 162) | private boolean yesEntered(String text) { method stringIsAnyValue (line 175) | private boolean stringIsAnyValue(String text, String... values) { method displayTextAndGetInput (line 186) | private String displayTextAndGetInput(String text) { method randomNumber (line 197) | private int randomNumber() { FILE: 92_Trap/java/src/TrapGame.java class TrapGame (line 1) | public class TrapGame { method main (line 3) | public static void main(String[] args) { FILE: 92_Trap/javascript/trap.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 92_Trap/python/trap.py function play_game (line 13) | def play_game() -> None: function main (line 51) | def main() -> None: FILE: 92_Trap/ruby/trap.rb function main (line 14) | def main function yes? (line 23) | def yes?(prompt) function print_banner_and_instructions (line 29) | def print_banner_and_instructions function play_a_game (line 52) | def play_a_game function choose_number (line 74) | def choose_number function get_guesses (line 78) | def get_guesses(prompt) FILE: 92_Trap/rust/src/main.rs function main (line 5) | fn main() { function prompt_instructions (line 43) | fn prompt_instructions() { function prompt_numbers (line 66) | fn prompt_numbers(guess: u8) -> (u8, u8) { FILE: 93_23_Matches/csharp/23Matches.cs class Program (line 5) | class Program method Main (line 12) | static void Main(string[] args) method PlayerTurn (line 78) | static void PlayerTurn() method ComputerTurn (line 100) | static void ComputerTurn() method ReadPlayerInput (line 146) | static int ReadPlayerInput() FILE: 93_23_Matches/java/CoinSide.java type CoinSide (line 1) | public enum CoinSide { FILE: 93_23_Matches/java/Messages.java class Messages (line 1) | public class Messages { method Messages (line 5) | private Messages() { FILE: 93_23_Matches/java/TwentyThreeMatches.java class TwentyThreeMatches (line 4) | public class TwentyThreeMatches { method startGame (line 10) | public void startGame() { method flipCoin (line 63) | private CoinSide flipCoin() { method turnOfPlayer (line 67) | private int turnOfPlayer() { FILE: 93_23_Matches/java/TwentyThreeMatchesGame.java class TwentyThreeMatchesGame (line 12) | public class TwentyThreeMatchesGame { method main (line 14) | public static void main(String[] args) { method showIntro (line 20) | private static void showIntro() { FILE: 93_23_Matches/javascript/23matches.js function print (line 6) | function print(str) function input (line 11) | function input() function tab (line 37) | function tab(space) function main (line 46) | async function main() FILE: 93_23_Matches/python/23matches.py function play_game (line 9) | def play_game() -> None: function main (line 63) | def main() -> None: FILE: 93_23_Matches/ruby/23_matches.rb class Matches (line 1) | class Matches method initialize (line 2) | def initialize method play_game (line 20) | def play_game FILE: 93_23_Matches/rust/src/main.rs function main (line 4) | fn main() -> io::Result<()> { function intro (line 51) | fn intro() { function read_matches (line 70) | fn read_matches(mut input: R, buf: &mut String) -> io::Resul... function read_int (line 84) | fn read_int(mut input: R, buf: &mut String) -> io::Result { function ai_pick (line 102) | fn ai_pick(matches: u8, human_picked: u8) -> u8 { FILE: 94_War/csharp/War/Cards.cs type Suit (line 9) | public enum Suit type Rank (line 17) | public enum Rank class Card (line 36) | public class Card method Card (line 69) | public Card(Suit suit, Rank rank) method ToString (line 118) | public override string ToString() class Deck (line 126) | public class Deck method Deck (line 132) | public Deck() method GetCard (line 149) | public Card GetCard(int i) => theDeck[i]; method Shuffle (line 154) | public void Shuffle() FILE: 94_War/csharp/War/Program.cs class Program (line 3) | class Program method Main (line 5) | static void Main(string[] args) FILE: 94_War/csharp/War/UserInterface.cs class UserInterface (line 9) | public class UserInterface method WriteIntro (line 11) | public void WriteIntro() method WriteAResult (line 31) | public void WriteAResult(Card yourCard, Card computersCard, ref int co... method AskAQuestion (line 50) | public bool AskAQuestion(string question) method WriteClosingRemarks (line 73) | public void WriteClosingRemarks(bool usedAllCards, int yourScore, int ... FILE: 94_War/csharp/WarTester/Tests.cs class CardTest (line 9) | [TestClass] method LessThanIsValid (line 19) | [TestMethod] method GreaterThanIsValid (line 34) | [TestMethod] method LessThanEqualsIsValid (line 49) | [TestMethod] method GreaterThanEqualsIsValid (line 64) | [TestMethod] method ToStringIsValid (line 79) | [TestMethod] class DeckTest (line 94) | [TestClass] method ConcatenateTheDeck (line 100) | private string ConcatenateTheDeck(Deck d) method InitialDeckContainsCardsInOrder (line 112) | [TestMethod] method ShufflingChangesDeck (line 121) | [TestMethod] FILE: 94_War/java/War.java class War (line 11) | public class War { method main (line 27) | public static void main(String[] args) { method introMessage (line 33) | private static void introMessage() { method showDirectionsBasedOnInput (line 40) | private static void showDirectionsBasedOnInput() { method playGame (line 61) | private static void playGame() { method getWinner (line 97) | private static void getWinner(String playerCard, String computerCard) { method checkCourtCards (line 121) | private static int checkCourtCards(String cardScore) { method endedEarly (line 139) | private static boolean endedEarly() { method endGameOutput (line 159) | private static void endGameOutput(boolean endedEarly) { method playerWonRound (line 174) | private static int playerWonRound() { method getPlayerScore (line 181) | private static int getPlayerScore() { method computerWonRound (line 188) | private static int computerWonRound() { method getComputerScore (line 195) | private static int getComputerScore() { FILE: 94_War/javascript/war.js function print (line 6) | function print(str) { function tab (line 10) | function tab(space) { function input (line 18) | function input() { function askYesOrNo (line 39) | async function askYesOrNo(question) { function askAboutInstructions (line 55) | async function askAboutInstructions() { function createGameDeck (line 66) | function createGameDeck(cards, gameSize) { function computeCardValue (line 81) | function computeCardValue(cardIndex) { function printGameOver (line 85) | function printGameOver(playerScore, computerScore) { function printTitle (line 92) | function printTitle() { function printCards (line 102) | function printCards(playerCard, computerCard) { function main (line 124) | async function main() { FILE: 94_War/python/war.py function card_value (line 15) | def card_value(input: str) -> int: function play_game (line 21) | def play_game() -> None: function main (line 65) | def main() -> None: FILE: 94_War/ruby/war.rb class War (line 3) | class War class Card (line 4) | class Card class CardError (line 5) | class CardError < StandardError; end method initialize (line 14) | def initialize(suit, pip) method <=> (line 23) | def <=>(other) method > (line 27) | def >(other) method < (line 31) | def <(other) method to_s (line 35) | def to_s method shuffle (line 39) | def self.shuffle method initialize (line 44) | def initialize method play (line 51) | def play method round (line 68) | def round(your_card, computer_card) method yesno (line 81) | def yesno method intro (line 91) | def intro method directions (line 100) | def directions method outro (line 107) | def outro method empty? (line 113) | def empty? FILE: 94_War/rust/src/main.rs type CARD (line 5) | struct CARD { method new (line 13) | fn new(suit:u8,value:u8) -> CARD { method to_string (line 21) | fn to_string(&self) -> String { type GAME (line 43) | struct GAME { method new (line 52) | fn new() -> GAME{ method play_game (line 70) | fn play_game(&mut self) { function main (line 105) | fn main() { function welcome (line 121) | fn welcome() { function get_yes_no_from_user_input (line 141) | fn get_yes_no_from_user_input(prompt: &str) -> bool { FILE: 95_Weekday/csharp/Program.cs class Weekday (line 5) | class Weekday method DisplayIntro (line 7) | private void DisplayIntro() method ValidateDate (line 18) | private bool ValidateDate(string InputDate, out DateTime ReturnDate) method PromptForADate (line 27) | private DateTime PromptForADate(string Prompt) method CalculateDateDiff (line 51) | private void CalculateDateDiff(DateTime TodaysDate, DateTime BirthDate... method WriteColumnOutput (line 79) | private void WriteColumnOutput(string Message, int Years, int Months, ... method DisplayOutput (line 86) | private void DisplayOutput(DateTime TodaysDate, DateTime BirthDate) method PlayTheGame (line 180) | public void PlayTheGame() class Program (line 194) | class Program method Main (line 196) | static void Main(string[] args) FILE: 95_Weekday/java/Weekday.java class Weekday (line 9) | public class Weekday { method main (line 15) | public static void main(String[] args) { method printStatisticRow (line 121) | private static void printStatisticRow(float F, int A8, DateStruct scra... method printHeadersAndAge (line 145) | private static void printHeadersAndAge(int I5, int I6, int I7) { method calculateAndPrintDayOfWeek (line 151) | private static void calculateAndPrintDayOfWeek(int i1, int a, DateStru... method printDayOfWeek (line 176) | private static void printDayOfWeek(DateStruct dateStruct, DateStruct d... method a (line 222) | private static int a(int a) { method b (line 226) | private static int b(int a) { method printIntro (line 231) | private static void printIntro() { method readDate (line 243) | private static DateStruct readDate(Scanner scanner) { class DateStruct (line 268) | private static class DateStruct { method DateStruct (line 273) | public DateStruct(int month, int day, int year) { FILE: 95_Weekday/javascript/weekday.js function print (line 10) | function print(str) { function input (line 18) | function input() { function tab (line 44) | function tab(spaceCount) { constant MONTHS_PER_YEAR (line 51) | const MONTHS_PER_YEAR = 12; constant DAYS_PER_COMMON_YEAR (line 52) | const DAYS_PER_COMMON_YEAR = 365; constant DAYS_PER_IDEALISED_MONTH (line 53) | const DAYS_PER_IDEALISED_MONTH = 30; constant MAXIMUM_DAYS_PER_MONTH (line 54) | const MAXIMUM_DAYS_PER_MONTH = 31; constant COMMON_YEAR_MONTH_OFFSET (line 56) | const COMMON_YEAR_MONTH_OFFSET = [0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5]; class DateStruct (line 61) | class DateStruct { method constructor (line 72) | constructor(year, month, day) { method year (line 78) | get year() { method month (line 82) | get month() { method day (line 86) | get day() { method isGregorianDate (line 96) | isGregorianDate() { method getNormalisedDay (line 116) | getNormalisedDay() { method getDayOfWeek (line 125) | getDayOfWeek() { method isLeapYear (line 153) | isLeapYear() { method toString (line 168) | toString() { class Duration (line 177) | class Duration { method constructor (line 188) | constructor(years, months, days) { method years (line 195) | get years() { method months (line 199) | get months() { method days (line 203) | get days() { method clone (line 207) | clone() { method remove (line 216) | remove(timeToRemove) { method #fixRanges (line 226) | #fixRanges() { method getApproximateDays (line 243) | getApproximateDays() { method toString (line 256) | toString() { method between (line 267) | static between(date1, date2) { method fromDays (line 281) | static fromDays(dayCount, factor) { function main (line 292) | async function main() { FILE: 95_Weekday/python/weekday.py function get_date_from_user (line 20) | def get_date_from_user(prompt: str) -> Tuple[int, int, int]: function get_date_from_system (line 31) | def get_date_from_system() -> Tuple[int, int, int]: function get_day_of_week (line 36) | def get_day_of_week(weekday_index, day) -> str: function previous_day (line 52) | def previous_day(b) -> int: function is_leap_year (line 58) | def is_leap_year(year: int) -> bool: function adjust_day_for_leap_year (line 64) | def adjust_day_for_leap_year(b, year): function adjust_weekday (line 70) | def adjust_weekday(b, month, year): function calc_day_value (line 78) | def calc_day_value(year, month, day): function deduct_time (line 82) | def deduct_time(frac, days, years_remain, months_remain, days_remain): function time_report (line 103) | def time_report(msg, years, months, days): function make_occupation_label (line 108) | def make_occupation_label(years): function calculate_day_of_week (line 117) | def calculate_day_of_week(year, month, day): function end (line 133) | def end() -> None: function main (line 138) | def main() -> None: FILE: 95_Weekday/rust/src/main.rs type DATE (line 3) | struct DATE { method new (line 13) | fn new(month:u32,day:u32,year:u32,day_of_week:u32) -> DATE { method new_from_input (line 19) | fn new_from_input(prompt:&str) -> DATE { method new_from_days (line 52) | fn new_from_days(days:u32) -> DATE{ method update_day_of_week (line 79) | fn update_day_of_week(&mut self) { method day_of_week_as_string (line 102) | fn day_of_week_as_string(&self) -> String { method _is_leap_year (line 121) | fn _is_leap_year(&self) -> bool{ method calc_days (line 136) | fn calc_days(&self) -> u32 { method time_since (line 143) | fn time_since(&self, other: &DATE) -> Option { method format_ymd (line 157) | fn format_ymd(&self, spacer:&str) -> String { method to_string (line 167) | fn to_string(&self) -> String { function main (line 172) | fn main() { function welcome (line 276) | fn welcome() { function get_str_from_user (line 291) | fn get_str_from_user(prompt:&str) -> String { FILE: 96_Word/csharp/Program.cs class Word (line 7) | class Word method intro (line 17) | private void intro() method get_guess (line 31) | private string get_guess() method check_guess (line 59) | private int check_guess(string guess, string target, StringBuilder pro... method play_game (line 94) | private void play_game() method play (line 141) | public void play() class Program (line 156) | class Program method Main (line 158) | static void Main(string[] args) FILE: 96_Word/java/Word.java class Word (line 16) | public class Word { type Step (line 27) | private enum Step { method Word (line 31) | public Word() { method play (line 37) | public void play() { method showIntro (line 44) | private void showIntro() { method startGame (line 56) | private void startGame() { method main (line 216) | public static void main(String[] args) { FILE: 96_Word/javascript/word.mjs constant WORDS (line 9) | const WORDS = ["DINKY", "SMOKE", "WATER", "GLASS", "TRAIN", constant WORD_COUNT (line 12) | const WORD_COUNT = WORDS.length; function main (line 15) | async function main() FILE: 96_Word/python/word.py function play_game (line 27) | def play_game() -> None: function main (line 74) | def main() -> None: FILE: 96_Word/ruby/word.rb function game_loop (line 10) | def game_loop FILE: 96_Word/rust/src/main.rs function main (line 6) | fn main() { function play_again (line 28) | fn play_again() -> bool { FILE: 96_Word/rust/src/progress.rs type Progress (line 1) | pub struct Progress { method new (line 6) | pub fn new() -> Self { method set_char_at (line 10) | pub fn set_char_at(&mut self, c: char, i: usize) { method print (line 14) | pub fn print(&self) { method done (line 20) | pub fn done(&self) -> bool { FILE: 96_Word/rust/src/word_game.rs type WordGame (line 5) | pub struct WordGame<'a> { function new (line 13) | pub fn new() -> Self { function tick (line 33) | pub fn tick(&mut self) -> bool { function read_guess (line 47) | fn read_guess(&mut self) -> bool { function process_guess (line 79) | fn process_guess<'a>(&mut self) -> bool {