This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Knight's tour: Find the sequence of moves of a knight on a chessboard such that the knight visits every square exactly once. | |
// A move is an array of 2 numbers indicating how many [rows, columns] a piece travels. | |
type Move: [Integer, 2] | |
// <static type> identifier : (<dependent types>) = <value> | |
let knightMoves: [Move] = [[2, 1], [1, 2], [-1, 2], [-2, 1], [-2, -1], [-1, -2], [1, -2], [2, -1]] | |
// A Position is a 2 element array indicating [row, column] index (in range 0 to 8) on the board. | |
type Position: [Integer 0...8, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arr: [1, 15, 21, 9, 12, 28, 42, 23, 100] | |
# Index array | |
arr[3] | |
# Map | |
days: | |
0: “Monday” | |
1: “Tuesday” | |
2: “Wednesday” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am feni on github. | |
* I am feni (https://keybase.io/feni) on keybase. | |
* I have a public key ASBI-xuT1RqzJbuXfOD3bdWAQs7r99CqEBe-YnmufccwRgo | |
To claim this, I am signing this object: |