Skip to content

Commit fbe3e3b

Browse files
authored
refactor: revise obsolete solution logic (#853)
Rename obsolete ForemanPig class to MewCipher.
1 parent d1db138 commit fbe3e3b

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

kata/7-kyu/mew-cipher/main/ForemanPig.java renamed to kata/7-kyu/mew-cipher/main/MewCipher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import static java.util.stream.Collectors.joining;
22
import static java.util.stream.IntStream.range;
33

4-
interface ForemanPig {
4+
interface MewCipher {
55
static String decipher(String[] code) {
66
return range(0, code[0].length())
77
.map(i -> range(0, code.length).reduce(0, (s, j) -> s + (code[j].charAt(i) & 31)) / code.length)

kata/7-kyu/mew-cipher/test/ForemanPigTest.java

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import static org.junit.jupiter.api.Assertions.assertEquals;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
class MewCipherTest {
6+
@Test
7+
void sample() {
8+
assertEquals("walk your dog at nine", MewCipher.decipher(new String[]{"u lk zxuq hfk as fouh", "y l zpuv xe at sicd", "welvayfuqbfpeaauaqcrc"}));
9+
assertEquals("hello world", MewCipher.decipher(new String[]{"hello world"}));
10+
assertEquals("", MewCipher.decipher(new String[]{"", "", "", "", ""}));
11+
assertEquals(" ", MewCipher.decipher(new String[]{"a ", " b ", " c", " ", " "}));
12+
assertEquals("foreman pig", MewCipher.decipher(new String[]{"foreman pig", "foreman pig"}));
13+
}
14+
}

0 commit comments

Comments
 (0)