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
package com.failedtofunction.examples.numerals | |
class RomanNumeral { | |
private val value: Int | |
private val representation: String | |
private constructor(value: Int, representation: String) { | |
this.value = value | |
this.representation = representation |
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
package com.failedtofunction.examples.numerals | |
fun Char.romanNumeralValue(): Int = | |
when (this) { | |
'I' -> 1 | |
'V' -> 5 | |
'X' -> 10 | |
'L' -> 50 | |
'C' -> 100 | |
'D' -> 500 |
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
from random import randint | |
import re | |
def ask_for_a_number_with(question): | |
number = input(question) | |
while (re.match(r'^[0-9]+$', number) == None): | |
print('That is not a valid number. Try again.') | |
number = input(question) | |
return int(number) |
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
package com.failedtofunction.example.cumcumberdates; | |
import static org.junit.Assert.assertEquals; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
import com.failedtofunction.example.cucumberdates.DateUtilities; | |
import com.failedtofunction.example.cucumberdates.Person; |