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
struct Scanner { | |
input: String, | |
output: Vec<Token> | |
} | |
#[derive(Debug)] | |
enum Token { | |
Integer(i64), | |
Addition, | |
Subtraction, |
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
import org.junit.jupiter.api.Assertions.* | |
import org.junit.jupiter.api.Test | |
internal class BowlingKtTest { | |
@Test | |
fun `score is 0 when the player did not knock down any pins`() { | |
assertEquals(0, Array(20, { 0 }).toList().score()) | |
} | |
@Test |
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
import 'dart:async'; | |
main() { | |
final router = new Router(); | |
router.listen(print); | |
router.route(const Route('/', query: const {'referredId': '1234'})); | |
router.route(const Route('/contact')); | |
} | |
/// A simple example of a 'Router' that is just a stream of [Route]. |