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
; Test access to the memory card ($D000 and above). | |
; This is an adaptation of Zellyn's a2audit tests made to be run headlessly: https://github.com/zellyn/a2audit | |
; If the tests succed, $3D contains the number of successful tests | |
; If a test fails, the code lands on a BRK, $3D contains the number of passed tests, | |
; and Y is the index of the comparison that failed (1-5) | |
; | |
; Cedric Beust, cedric@beust.com, 9/17/2020 | |
; | |
D1 := $d17b |
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
~/kotlin/kobalt $ k assemble | |
__ __ __ __ __ | |
/ //_/ ____ / /_ ____ _ / / / /_ | |
/ ,< / __ \ / __ \ / __ `/ / / / __/ | |
/ /| | / /_/ / / /_/ // /_/ / / / / /_ | |
/_/ |_| \____/ /_.___/ \__,_/ /_/ \__/ 1.0.93 | |
Regular compilation time: 2459 ms | |
Parallel build starting | |
╔═════════════════════════╗ |
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
~/kotlin/kobalt $ k assemble | |
__ __ __ __ __ | |
/ //_/ ____ / /_ ____ _ / / / /_ | |
/ ,< / __ \ / __ \ / __ `/ / / / __/ | |
/ /| | / /_/ / / /_/ // /_/ / / / / /_ | |
/_/ |_| \____/ /_.___/ \__,_/ /_/ \__/ 1.0.93 | |
Regular compilation time: 2459 ms | |
Parallel build starting | |
╔═════════════════════════╗ |
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
Root | |
A | |
A1 | |
A2 | |
A3 | |
B | |
B1 | |
B2 | |
B21 |
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
A | |
A1 | |
A2 | |
1 | |
11 | |
12 |
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
class Tree(val payload: Int, val leaves: List<Tree>) |
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
displayGraphGeneric(graph, Node::children, Node::value) | |
displayGraphGeneric(tree, Tree::leaves, Tree::payload) |
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
fun <T, U> displayGraphGeneric(roots: List<T>, | |
children: (T) -> List<T>, | |
value: (T) -> U, | |
indent: String = “”) { | |
roots.forEach { | |
println(indent + value(it)) | |
displayGraphGeneric(children(it), children, value, | |
indent + “ “) | |
} | |
} |
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
val graph = listOf(Node(“A”, listOf( | |
Node(“A1”), | |
Node(“A2”))) | |
) | |
displayGraph(graph) | |
val tree = listOf(Tree(1, listOf( | |
Tree(11), | |
Tree(12))) | |
) |
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
class Node(override val value: String, | |
override val children: List<Node> = emptyList()) : INode<String> | |
class Tree(val payload: Int, val leaves: List<Tree>) : INode<Int> { | |
override val children: List<Tree> = leaves | |
override val value: Int = payload | |
} |