trackler 2.2.1.151 → 2.2.1.152
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/hamming/description.md +4 -3
- data/problem-specifications/exercises/isbn-verifier/canonical-data.json +9 -1
- data/tracks/clojure/exercises/bob/README.md +2 -0
- data/tracks/clojure/exercises/bob/src/example.clj +4 -0
- data/tracks/clojure/exercises/bob/test/bob_test.clj +1 -1
- data/tracks/clojure/exercises/say/README.md +2 -1
- data/tracks/csharp/exercises/acronym/AcronymTest.cs +3 -9
- data/tracks/csharp/exercises/all-your-base/AllYourBaseTest.cs +43 -43
- data/tracks/csharp/exercises/allergies/AllergiesTest.cs +1 -1
- data/tracks/csharp/exercises/alphametics/AlphameticsTest.cs +21 -1
- data/tracks/csharp/exercises/anagram/AnagramTest.cs +1 -35
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +1 -1
- data/tracks/csharp/exercises/beer-song/BeerSong.cs +1 -6
- data/tracks/csharp/exercises/beer-song/BeerSongTest.cs +20 -28
- data/tracks/csharp/exercises/beer-song/Example.cs +6 -6
- data/tracks/csharp/exercises/binary-search/BinarySearchTest.cs +1 -1
- data/tracks/csharp/exercises/bob/BobTest.cs +1 -1
- data/tracks/csharp/exercises/book-store/BookStoreTest.cs +1 -1
- data/tracks/csharp/exercises/bowling/BowlingTest.cs +47 -29
- data/tracks/csharp/exercises/bracket-push/BracketPushTest.cs +36 -29
- data/tracks/csharp/exercises/change/Change.cs +1 -1
- data/tracks/csharp/exercises/change/ChangeTest.cs +48 -21
- data/tracks/csharp/exercises/change/Example.cs +31 -18
- data/tracks/csharp/exercises/circular-buffer/CircularBuffer.cs +2 -2
- data/tracks/csharp/exercises/circular-buffer/CircularBufferTest.cs +88 -111
- data/tracks/csharp/exercises/circular-buffer/Example.cs +7 -7
- data/tracks/csharp/exercises/clock/ClockTest.cs +37 -37
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +1 -1
- data/tracks/csharp/exercises/complex-numbers/ComplexNumbersTest.cs +19 -10
- data/tracks/csharp/exercises/connect/ConnectTest.cs +1 -1
- data/tracks/csharp/exercises/crypto-square/CryptoSquareTest.cs +1 -1
- data/tracks/csharp/exercises/custom-set/.meta/hints.md +3 -3
- data/tracks/csharp/exercises/custom-set/CustomSet.cs +10 -49
- data/tracks/csharp/exercises/custom-set/CustomSetTest.cs +153 -157
- data/tracks/csharp/exercises/custom-set/Example.cs +26 -54
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquaresTest.cs +1 -1
- data/tracks/csharp/exercises/dominoes/DominoesTest.cs +25 -25
- data/tracks/csharp/exercises/etl/Etl.cs +1 -1
- data/tracks/csharp/exercises/etl/EtlTest.cs +4 -4
- data/tracks/csharp/exercises/etl/Example.cs +1 -1
- data/tracks/csharp/exercises/flatten-array/FlattenArrayTest.cs +13 -13
- data/tracks/csharp/exercises/food-chain/Example.cs +5 -0
- data/tracks/csharp/exercises/food-chain/FoodChain.cs +5 -0
- data/tracks/csharp/exercises/food-chain/FoodChainTest.cs +9 -9
- data/tracks/csharp/exercises/forth/Example.cs +28 -33
- data/tracks/csharp/exercises/forth/Forth.cs +1 -19
- data/tracks/csharp/exercises/forth/ForthTest.cs +215 -52
- data/tracks/csharp/exercises/gigasecond/GigasecondTest.cs +1 -1
- data/tracks/csharp/exercises/grains/GrainsTest.cs +1 -1
- data/tracks/csharp/exercises/grep/Example.cs +1 -1
- data/tracks/csharp/exercises/grep/Grep.cs +1 -1
- data/tracks/csharp/exercises/grep/GrepTest.cs +268 -237
- data/tracks/csharp/exercises/hamming/HammingTest.cs +1 -1
- data/tracks/csharp/exercises/hello-world/HelloWorldTest.cs +1 -1
- data/tracks/csharp/exercises/house/Example.cs +7 -2
- data/tracks/csharp/exercises/house/House.cs +5 -0
- data/tracks/csharp/exercises/house/HouseTest.cs +40 -223
- data/tracks/csharp/exercises/isbn-verifier/IsbnVerifierTest.cs +14 -2
- data/tracks/csharp/exercises/isogram/IsogramTest.cs +1 -1
- data/tracks/csharp/exercises/kindergarten-garden/KindergartenGardenTest.cs +1 -1
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProductTest.cs +1 -1
- data/tracks/csharp/exercises/leap/LeapTest.cs +1 -1
- data/tracks/csharp/exercises/luhn/LuhnTest.cs +1 -1
- data/tracks/csharp/exercises/markdown/MarkdownTest.cs +34 -27
- data/tracks/csharp/exercises/minesweeper/MinesweeperTest.cs +29 -34
- data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +1 -1
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCountTest.cs +1 -1
- data/tracks/csharp/exercises/ocr-numbers/OcrNumbersTest.cs +35 -35
- data/tracks/csharp/exercises/pangram/PangramTest.cs +1 -1
- data/tracks/csharp/exercises/pascals-triangle/PascalsTriangleTest.cs +1 -1
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +1 -1
- data/tracks/csharp/exercises/phone-number/PhoneNumberTest.cs +17 -3
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +1 -1
- data/tracks/csharp/exercises/poker/PokerTest.cs +1 -1
- data/tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs +1 -1
- data/tracks/csharp/exercises/protein-translation/Example.cs +4 -4
- data/tracks/csharp/exercises/protein-translation/ProteinTranslation.cs +1 -1
- data/tracks/csharp/exercises/protein-translation/ProteinTranslationTest.cs +104 -45
- data/tracks/csharp/exercises/proverb/ProverbTest.cs +38 -6
- data/tracks/csharp/exercises/queen-attack/QueenAttackTest.cs +1 -1
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs +1 -1
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +1 -1
- data/tracks/csharp/exercises/rectangles/RectanglesTest.cs +63 -21
- data/tracks/csharp/exercises/reverse-string/ReverseStringTest.cs +1 -1
- data/tracks/csharp/exercises/rna-transcription/RnaTranscriptionTest.cs +1 -1
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +7 -1
- data/tracks/csharp/exercises/rotational-cipher/RotationalCipherTest.cs +1 -1
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs +1 -1
- data/tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs +11 -11
- data/tracks/csharp/exercises/say/SayTest.cs +1 -1
- data/tracks/csharp/exercises/scale-generator/Example.cs +5 -0
- data/tracks/csharp/exercises/scale-generator/ScaleGenerator.cs +5 -0
- data/tracks/csharp/exercises/scale-generator/ScaleGeneratorTest.cs +56 -47
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +1 -1
- data/tracks/csharp/exercises/secret-handshake/SecretHandshakeTest.cs +1 -1
- data/tracks/csharp/exercises/sieve/SieveTest.cs +1 -1
- data/tracks/csharp/exercises/space-age/SpaceAgeTest.cs +1 -1
- data/tracks/csharp/exercises/spiral-matrix/SpiralMatrixTest.cs +28 -34
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +1 -1
- data/tracks/csharp/exercises/tournament/Example.cs +15 -7
- data/tracks/csharp/exercises/tournament/TournamentTest.cs +97 -99
- data/tracks/csharp/exercises/transpose/TransposeTest.cs +50 -96
- data/tracks/csharp/exercises/triangle/TriangleTest.cs +1 -1
- data/tracks/csharp/exercises/twelve-days/TwelveDays.cs +1 -1
- data/tracks/csharp/exercises/two-bucket/TwoBucketTest.cs +1 -1
- data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +1 -1
- data/tracks/csharp/exercises/variable-length-quantity/Example.cs +3 -3
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantity.cs +2 -2
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantityTest.cs +165 -40
- data/tracks/csharp/exercises/word-count/Example.cs +1 -1
- data/tracks/csharp/exercises/word-count/WordCount.cs +1 -1
- data/tracks/csharp/exercises/word-count/WordCountTest.cs +12 -12
- data/tracks/csharp/exercises/wordy/WordyTest.cs +1 -1
- data/tracks/csharp/exercises/yacht/Example.cs +2 -5
- data/tracks/csharp/exercises/yacht/YachtTest.cs +7 -1
- data/tracks/csharp/exercises/zebra-puzzle/Example.cs +4 -4
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzle.cs +2 -2
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzleTest.cs +7 -5
- data/tracks/csharp/generators/Exercises/AllYourBase.cs +1 -0
- data/tracks/csharp/generators/Exercises/Alphametics.cs +5 -2
- data/tracks/csharp/generators/Exercises/BeerSong.cs +3 -0
- data/tracks/csharp/generators/Exercises/BinarySearch.cs +1 -0
- data/tracks/csharp/generators/Exercises/BookStore.cs +2 -0
- data/tracks/csharp/generators/Exercises/Bowling.cs +20 -15
- data/tracks/csharp/generators/Exercises/BracketPush.cs +1 -1
- data/tracks/csharp/generators/Exercises/Change.cs +20 -0
- data/tracks/csharp/generators/Exercises/CircularBuffer.cs +74 -0
- data/tracks/csharp/generators/Exercises/Clock.cs +7 -8
- data/tracks/csharp/generators/Exercises/ComplexNumbers.cs +9 -16
- data/tracks/csharp/generators/Exercises/Connect.cs +6 -6
- data/tracks/csharp/generators/Exercises/CustomSet.cs +56 -0
- data/tracks/csharp/generators/Exercises/Dominoes.cs +2 -2
- data/tracks/csharp/generators/Exercises/Etl.cs +7 -35
- data/tracks/csharp/generators/Exercises/FlattenArray.cs +9 -13
- data/tracks/csharp/generators/Exercises/FoodChain.cs +5 -0
- data/tracks/csharp/generators/Exercises/Forth.cs +25 -0
- data/tracks/csharp/generators/Exercises/Gigasecond.cs +4 -4
- data/tracks/csharp/generators/Exercises/Grains.cs +1 -1
- data/tracks/csharp/generators/Exercises/Grep.cs +106 -0
- data/tracks/csharp/generators/Exercises/Hamming.cs +1 -1
- data/tracks/csharp/generators/Exercises/House.cs +5 -0
- data/tracks/csharp/generators/Exercises/KindergartenGarden.cs +3 -3
- data/tracks/csharp/generators/Exercises/Markdown.cs +25 -0
- data/tracks/csharp/generators/Exercises/Meetup.cs +6 -6
- data/tracks/csharp/generators/Exercises/Minesweeper.cs +14 -4
- data/tracks/csharp/generators/Exercises/OcrNumbers.cs +12 -3
- data/tracks/csharp/generators/Exercises/PascalsTriangle.cs +0 -7
- data/tracks/csharp/generators/Exercises/ProteinTranslation.cs +8 -0
- data/tracks/csharp/generators/Exercises/Proverb.cs +7 -5
- data/tracks/csharp/generators/Exercises/QueenAttack.cs +3 -3
- data/tracks/csharp/generators/Exercises/Rectangles.cs +17 -0
- data/tracks/csharp/generators/Exercises/RobotSimulator.cs +6 -6
- data/tracks/csharp/generators/Exercises/SaddlePoints.cs +2 -2
- data/tracks/csharp/generators/Exercises/Say.cs +1 -1
- data/tracks/csharp/generators/Exercises/ScaleGenerator.cs +15 -0
- data/tracks/csharp/generators/Exercises/SpiralMatrix.cs +45 -0
- data/tracks/csharp/generators/Exercises/Sublist.cs +4 -5
- data/tracks/csharp/generators/Exercises/SumOfMultiples.cs +10 -1
- data/tracks/csharp/generators/Exercises/Tournament.cs +11 -19
- data/tracks/csharp/generators/Exercises/Transpose.cs +2 -2
- data/tracks/csharp/generators/Exercises/Triangle.cs +1 -3
- data/tracks/csharp/generators/Exercises/TwelveDays.cs +3 -4
- data/tracks/csharp/generators/Exercises/TwoBucket.cs +5 -5
- data/tracks/csharp/generators/Exercises/TwoFer.cs +11 -2
- data/tracks/csharp/generators/Exercises/VariableLengthQuantity.cs +44 -0
- data/tracks/csharp/generators/Exercises/Yacht.cs +11 -10
- data/tracks/csharp/generators/Exercises/ZebraPuzzle.cs +19 -0
- data/tracks/csharp/generators/GeneratorExercise.cs +6 -6
- data/tracks/csharp/generators/Input/CanonicalData.cs +6 -9
- data/tracks/csharp/generators/Input/CanonicalDataCase.cs +13 -46
- data/tracks/csharp/generators/Input/CanonicalDataCaseParser.cs +170 -0
- data/tracks/csharp/generators/Input/CanonicalDataFile.cs +1 -2
- data/tracks/csharp/generators/Input/CanonicalDataParser.cs +16 -12
- data/tracks/csharp/generators/Input/ConfigFile.cs +0 -5
- data/tracks/csharp/generators/Input/ConvertHelper.cs +20 -0
- data/tracks/csharp/generators/Output/Templates/_TestClassDisposable.liquid +14 -0
- data/tracks/csharp/generators/Output/TestMethodBodyData.cs +11 -14
- data/tracks/csharp/generators/Output/ValueFormatter.cs +20 -7
- data/tracks/delphi/config.json +22 -0
- data/tracks/delphi/exercises/grade-school/GradeSchool.dpr +60 -0
- data/tracks/delphi/exercises/grade-school/README.md +62 -0
- data/tracks/delphi/exercises/grade-school/uGradeSchoolExample.pas +134 -0
- data/tracks/delphi/exercises/grade-school/uGradeSchoolTest.pas +150 -0
- data/tracks/delphi/exercises/hamming/README.md +4 -3
- data/tracks/delphi/exercises/proverb/Proverb.dpr +60 -0
- data/tracks/delphi/exercises/proverb/README.md +44 -0
- data/tracks/delphi/exercises/proverb/uProverbExample.pas +60 -0
- data/tracks/delphi/exercises/proverb/uProverbTests.pas +124 -0
- data/tracks/go/exercises/bracket-push/README.md +3 -2
- data/tracks/go/exercises/bracket-push/cases_test.go +7 -2
- data/tracks/go/exercises/isbn-verifier/cases_test.go +4 -3
- data/tracks/go/exercises/yacht/cases_test.go +8 -2
- data/tracks/java/exercises/armstrong-numbers/README.md +1 -1
- data/tracks/java/exercises/binary-search-tree/src/test/java/BinarySearchTreeTest.java +22 -22
- data/tracks/java/exercises/bracket-push/README.md +3 -2
- data/tracks/java/exercises/crypto-square/README.md +23 -19
- data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +1 -1
- data/tracks/java/exercises/poker/.meta/{version.txt → version} +0 -0
- data/tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java +7 -7
- data/tracks/java/exercises/rail-fence-cipher/.meta/version +1 -0
- data/tracks/java/exercises/robot-simulator/src/test/java/RobotTest.java +45 -45
- data/tracks/nim/config.json +24 -0
- data/tracks/nim/exercises/armstrong-numbers/README.md +18 -0
- data/tracks/nim/exercises/armstrong-numbers/armstrong_number_test.nim +29 -0
- data/tracks/nim/exercises/armstrong-numbers/example.nim +11 -0
- data/tracks/nim/exercises/leap/leap_test.nim +12 -10
- data/tracks/nim/exercises/two-fer/README.md +19 -0
- data/tracks/nim/exercises/two-fer/example.nim +3 -0
- data/tracks/nim/exercises/two-fer/two_fer_test.nim +16 -0
- data/tracks/python/.travis.yml +0 -1
- data/tracks/python/README.md +1 -1
- data/tracks/python/config/exercise_readme.go.tmpl +1 -1
- data/tracks/python/docs/INSTALLATION.md +1 -1
- data/tracks/python/exercises/accumulate/README.md +1 -1
- data/tracks/python/exercises/acronym/README.md +1 -1
- data/tracks/python/exercises/all-your-base/README.md +1 -1
- data/tracks/python/exercises/allergies/README.md +1 -1
- data/tracks/python/exercises/alphametics/README.md +1 -1
- data/tracks/python/exercises/anagram/README.md +1 -1
- data/tracks/python/exercises/armstrong-numbers/README.md +2 -2
- data/tracks/python/exercises/atbash-cipher/README.md +1 -1
- data/tracks/python/exercises/bank-account/README.md +1 -1
- data/tracks/python/exercises/beer-song/README.md +1 -1
- data/tracks/python/exercises/binary-search-tree/README.md +1 -1
- data/tracks/python/exercises/binary-search/README.md +1 -1
- data/tracks/python/exercises/binary/README.md +1 -1
- data/tracks/python/exercises/bob/README.md +1 -1
- data/tracks/python/exercises/book-store/README.md +1 -1
- data/tracks/python/exercises/bowling/README.md +1 -1
- data/tracks/python/exercises/bracket-push/README.md +4 -3
- data/tracks/python/exercises/change/README.md +1 -1
- data/tracks/python/exercises/circular-buffer/README.md +1 -1
- data/tracks/python/exercises/clock/README.md +1 -1
- data/tracks/python/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/python/exercises/complex-numbers/README.md +1 -1
- data/tracks/python/exercises/connect/README.md +1 -1
- data/tracks/python/exercises/crypto-square/README.md +1 -1
- data/tracks/python/exercises/custom-set/README.md +1 -1
- data/tracks/python/exercises/diamond/README.md +1 -1
- data/tracks/python/exercises/difference-of-squares/README.md +1 -1
- data/tracks/python/exercises/diffie-hellman/README.md +1 -1
- data/tracks/python/exercises/dominoes/README.md +1 -1
- data/tracks/python/exercises/dot-dsl/README.md +1 -1
- data/tracks/python/exercises/error-handling/README.md +1 -1
- data/tracks/python/exercises/etl/README.md +1 -1
- data/tracks/python/exercises/flatten-array/README.md +1 -1
- data/tracks/python/exercises/food-chain/README.md +1 -1
- data/tracks/python/exercises/forth/README.md +1 -1
- data/tracks/python/exercises/gigasecond/README.md +1 -1
- data/tracks/python/exercises/go-counting/README.md +1 -1
- data/tracks/python/exercises/grade-school/README.md +1 -1
- data/tracks/python/exercises/grains/README.md +1 -1
- data/tracks/python/exercises/grep/README.md +1 -1
- data/tracks/python/exercises/hamming/README.md +1 -1
- data/tracks/python/exercises/hello-world/README.md +1 -1
- data/tracks/python/exercises/hexadecimal/README.md +1 -1
- data/tracks/python/exercises/house/README.md +1 -1
- data/tracks/python/exercises/isbn-verifier/README.md +1 -1
- data/tracks/python/exercises/isogram/README.md +1 -1
- data/tracks/python/exercises/kindergarten-garden/README.md +1 -1
- data/tracks/python/exercises/largest-series-product/README.md +1 -1
- data/tracks/python/exercises/leap/README.md +1 -1
- data/tracks/python/exercises/linked-list/README.md +1 -1
- data/tracks/python/exercises/list-ops/README.md +1 -1
- data/tracks/python/exercises/luhn/README.md +1 -1
- data/tracks/python/exercises/markdown/README.md +1 -1
- data/tracks/python/exercises/matrix/README.md +1 -1
- data/tracks/python/exercises/meetup/README.md +1 -1
- data/tracks/python/exercises/minesweeper/README.md +1 -1
- data/tracks/python/exercises/nth-prime/README.md +1 -1
- data/tracks/python/exercises/nucleotide-count/README.md +1 -1
- data/tracks/python/exercises/ocr-numbers/README.md +1 -1
- data/tracks/python/exercises/octal/README.md +1 -1
- data/tracks/python/exercises/palindrome-products/README.md +1 -1
- data/tracks/python/exercises/pangram/README.md +1 -1
- data/tracks/python/exercises/parallel-letter-frequency/README.md +1 -1
- data/tracks/python/exercises/pascals-triangle/README.md +1 -1
- data/tracks/python/exercises/perfect-numbers/README.md +1 -1
- data/tracks/python/exercises/phone-number/README.md +1 -1
- data/tracks/python/exercises/pig-latin/README.md +1 -1
- data/tracks/python/exercises/point-mutations/README.md +1 -1
- data/tracks/python/exercises/poker/README.md +1 -1
- data/tracks/python/exercises/pov/README.md +1 -1
- data/tracks/python/exercises/prime-factors/README.md +1 -1
- data/tracks/python/exercises/protein-translation/README.md +1 -1
- data/tracks/python/exercises/proverb/README.md +1 -1
- data/tracks/python/exercises/pythagorean-triplet/README.md +1 -1
- data/tracks/python/exercises/queen-attack/README.md +1 -1
- data/tracks/python/exercises/rail-fence-cipher/README.md +1 -1
- data/tracks/python/exercises/raindrops/README.md +1 -1
- data/tracks/python/exercises/rational-numbers/README.md +1 -1
- data/tracks/python/exercises/react/README.md +1 -1
- data/tracks/python/exercises/rectangles/README.md +1 -1
- data/tracks/python/exercises/reverse-string/README.md +1 -1
- data/tracks/python/exercises/rna-transcription/README.md +1 -1
- data/tracks/python/exercises/robot-name/README.md +1 -1
- data/tracks/python/exercises/robot-simulator/README.md +1 -1
- data/tracks/python/exercises/roman-numerals/README.md +1 -1
- data/tracks/python/exercises/rotational-cipher/README.md +1 -1
- data/tracks/python/exercises/run-length-encoding/README.md +1 -1
- data/tracks/python/exercises/saddle-points/README.md +1 -1
- data/tracks/python/exercises/say/README.md +1 -1
- data/tracks/python/exercises/scale-generator/README.md +1 -1
- data/tracks/python/exercises/scrabble-score/README.md +1 -1
- data/tracks/python/exercises/secret-handshake/README.md +1 -1
- data/tracks/python/exercises/series/README.md +1 -1
- data/tracks/python/exercises/sgf-parsing/README.md +1 -1
- data/tracks/python/exercises/sieve/README.md +1 -1
- data/tracks/python/exercises/simple-cipher/README.md +1 -1
- data/tracks/python/exercises/simple-linked-list/README.md +1 -1
- data/tracks/python/exercises/space-age/README.md +1 -1
- data/tracks/python/exercises/spiral-matrix/README.md +1 -1
- data/tracks/python/exercises/strain/README.md +1 -1
- data/tracks/python/exercises/sublist/README.md +1 -1
- data/tracks/python/exercises/sum-of-multiples/README.md +1 -1
- data/tracks/python/exercises/tournament/README.md +1 -1
- data/tracks/python/exercises/transpose/README.md +1 -1
- data/tracks/python/exercises/tree-building/README.md +1 -1
- data/tracks/python/exercises/triangle/README.md +1 -1
- data/tracks/python/exercises/trinary/README.md +1 -1
- data/tracks/python/exercises/twelve-days/README.md +1 -1
- data/tracks/python/exercises/two-bucket/README.md +1 -1
- data/tracks/python/exercises/two-fer/README.md +1 -1
- data/tracks/python/exercises/variable-length-quantity/README.md +1 -1
- data/tracks/python/exercises/word-count/README.md +1 -1
- data/tracks/python/exercises/word-search/README.md +1 -1
- data/tracks/python/exercises/wordy/README.md +1 -1
- data/tracks/python/exercises/yacht/README.md +1 -1
- data/tracks/python/exercises/zebra-puzzle/README.md +1 -1
- data/tracks/python/exercises/zipper/README.md +1 -1
- data/tracks/python/requirements-travis.txt +1 -1
- data/tracks/swift/exercises/scale-generator/Tests/ScaleGeneratorTests/ScaleGeneratorTests.swift +1 -1
- metadata +32 -8
- data/tracks/csharp/generators/Input/CanonicalDataCaseJson.cs +0 -73
- data/tracks/csharp/generators/Input/CanonicalDataCaseJsonConverter.cs +0 -49
- data/tracks/csharp/generators/Input/CanonicalDataCasesJson.cs +0 -58
- data/tracks/csharp/generators/Input/CanonicalDataCasesJsonConverter.cs +0 -17
- data/tracks/java/exercises/go-counting/src/main/java/.keep +0 -0
@@ -1,7 +1,8 @@
|
|
1
1
|
# Bracket Push
|
2
2
|
|
3
|
-
Given a string containing brackets `[]`, braces `{}
|
4
|
-
verify that all
|
3
|
+
Given a string containing brackets `[]`, braces `{}`, parentheses `()`,
|
4
|
+
or any combination thereof, verify that any and all pairs are matched
|
5
|
+
and nested correctly.
|
5
6
|
|
6
7
|
## Running the tests
|
7
8
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package brackets
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 1.
|
4
|
+
// Commit: 9027186 bracket-push: Add test case "partially paired brackets" (#1219)
|
5
|
+
// Problem Specifications Version: 1.3.0
|
6
6
|
|
7
7
|
type bracketTest struct {
|
8
8
|
input string
|
@@ -40,6 +40,11 @@ var testCases = []bracketTest{
|
|
40
40
|
"{ }",
|
41
41
|
true,
|
42
42
|
},
|
43
|
+
{
|
44
|
+
// partially paired brackets
|
45
|
+
"{[])",
|
46
|
+
false,
|
47
|
+
},
|
43
48
|
{
|
44
49
|
// simple nested brackets
|
45
50
|
"{[]}",
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package isbn
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 2.
|
4
|
+
// Commit: adb99f7 isbn-verifier: Add test case with only 9 digits (#1221)
|
5
|
+
// Problem Specifications Version: 2.4.0
|
6
6
|
|
7
7
|
var testCases = []struct {
|
8
8
|
isbn string
|
@@ -13,7 +13,7 @@ var testCases = []struct {
|
|
13
13
|
{"3-598-21508-9", false, "invalid isbn check digit"},
|
14
14
|
{"3-598-21507-X", true, "valid isbn number with a check digit of 10"},
|
15
15
|
{"3-598-21507-A", false, "check digit is a character other than X"},
|
16
|
-
{"3-598-
|
16
|
+
{"3-598-P1581-X", false, "invalid character in isbn"},
|
17
17
|
{"3-598-2X507-9", false, "X is only valid as a check digit"},
|
18
18
|
{"3598215088", true, "valid isbn without separating dashes"},
|
19
19
|
{"359821507X", true, "isbn without separating dashes and X as check digit"},
|
@@ -23,4 +23,5 @@ var testCases = []struct {
|
|
23
23
|
{"3-598-21507-XX", false, "too long isbn"},
|
24
24
|
{"3-598-21515-X", false, "check digit of X should not be used for 0"},
|
25
25
|
{"", false, "empty isbn"},
|
26
|
+
{"134456729", false, "input is 9 characters"},
|
26
27
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package yacht
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 1.
|
4
|
+
// Commit: 6eb19d2 yacht: Add "Four of a kind is not a full house" test case (#1232)
|
5
|
+
// Problem Specifications Version: 1.1.0
|
6
6
|
|
7
7
|
var testCases = []struct {
|
8
8
|
description string
|
@@ -88,6 +88,12 @@ var testCases = []struct {
|
|
88
88
|
category: "full house",
|
89
89
|
expected: 0,
|
90
90
|
},
|
91
|
+
{
|
92
|
+
description: "Four of a kind is not a full house",
|
93
|
+
dice: []int{1, 4, 4, 4, 4},
|
94
|
+
category: "full house",
|
95
|
+
expected: 0,
|
96
|
+
},
|
91
97
|
{
|
92
98
|
description: "Yacht is not a full house",
|
93
99
|
dice: []int{2, 2, 2, 2, 2},
|
@@ -5,7 +5,7 @@ An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a nu
|
|
5
5
|
For example:
|
6
6
|
|
7
7
|
- 9 is an Armstrong number, because `9 = 9^1 = 9`
|
8
|
-
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 =
|
8
|
+
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1`
|
9
9
|
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
|
10
10
|
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
|
11
11
|
|
@@ -13,13 +13,13 @@ public class BinarySearchTreeTest {
|
|
13
13
|
public void dataIsRetained() {
|
14
14
|
BinarySearchTree<Integer> binarySearchTree = new BinarySearchTree<>();
|
15
15
|
|
16
|
-
|
16
|
+
int expected = 4;
|
17
17
|
binarySearchTree.insert(expected);
|
18
18
|
|
19
|
-
|
19
|
+
BinarySearchTree.Node<Integer> root = binarySearchTree.getRoot();
|
20
20
|
assertNotNull(root);
|
21
21
|
|
22
|
-
|
22
|
+
int actual = root.getData();
|
23
23
|
assertEquals(expected, actual);
|
24
24
|
}
|
25
25
|
|
@@ -27,19 +27,19 @@ public class BinarySearchTreeTest {
|
|
27
27
|
@Test
|
28
28
|
public void insertsLess() {
|
29
29
|
BinarySearchTree<Character> binarySearchTree = new BinarySearchTree<>();
|
30
|
-
|
31
|
-
|
30
|
+
char expectedRoot = '4';
|
31
|
+
char expectedLeft = '2';
|
32
32
|
|
33
33
|
binarySearchTree.insert(expectedRoot);
|
34
34
|
binarySearchTree.insert(expectedLeft);
|
35
35
|
|
36
|
-
|
36
|
+
BinarySearchTree.Node<Character> root = binarySearchTree.getRoot();
|
37
37
|
assertNotNull(root);
|
38
|
-
|
38
|
+
BinarySearchTree.Node<Character> left = root.getLeft();
|
39
39
|
assertNotNull(left);
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
char actualRoot = root.getData();
|
42
|
+
char actualLeft = left.getData();
|
43
43
|
assertEquals(expectedLeft, actualLeft);
|
44
44
|
assertEquals(expectedRoot, actualRoot);
|
45
45
|
}
|
@@ -48,19 +48,19 @@ public class BinarySearchTreeTest {
|
|
48
48
|
@Test
|
49
49
|
public void insertsSame() {
|
50
50
|
BinarySearchTree<String> binarySearchTree = new BinarySearchTree<>();
|
51
|
-
|
52
|
-
|
51
|
+
String expectedRoot = "4";
|
52
|
+
String expectedLeft = "4";
|
53
53
|
|
54
54
|
binarySearchTree.insert(expectedRoot);
|
55
55
|
binarySearchTree.insert(expectedLeft);
|
56
56
|
|
57
|
-
|
57
|
+
BinarySearchTree.Node<String> root = binarySearchTree.getRoot();
|
58
58
|
assertNotNull(root);
|
59
|
-
|
59
|
+
BinarySearchTree.Node<String> left = root.getLeft();
|
60
60
|
assertNotNull(left);
|
61
61
|
|
62
|
-
|
63
|
-
|
62
|
+
String actualRoot = root.getData();
|
63
|
+
String actualLeft = left.getData();
|
64
64
|
assertEquals(expectedLeft, actualLeft);
|
65
65
|
assertEquals(expectedRoot, actualRoot);
|
66
66
|
}
|
@@ -69,19 +69,19 @@ public class BinarySearchTreeTest {
|
|
69
69
|
@Test
|
70
70
|
public void insertsRight() {
|
71
71
|
BinarySearchTree<Integer> binarySearchTree = new BinarySearchTree<>();
|
72
|
-
|
73
|
-
|
72
|
+
int expectedRoot = 4;
|
73
|
+
int expectedRight = 5;
|
74
74
|
|
75
75
|
binarySearchTree.insert(expectedRoot);
|
76
76
|
binarySearchTree.insert(expectedRight);
|
77
77
|
|
78
|
-
|
78
|
+
BinarySearchTree.Node<Integer> root = binarySearchTree.getRoot();
|
79
79
|
assertNotNull(root);
|
80
|
-
|
80
|
+
BinarySearchTree.Node<Integer> right = root.getRight();
|
81
81
|
assertNotNull(right);
|
82
82
|
|
83
|
-
|
84
|
-
|
83
|
+
int actualRoot = root.getData();
|
84
|
+
int actualRight = right.getData();
|
85
85
|
assertEquals(expectedRight, actualRight);
|
86
86
|
assertEquals(expectedRoot, actualRoot);
|
87
87
|
}
|
@@ -131,7 +131,7 @@ public class BinarySearchTreeTest {
|
|
131
131
|
List<Integer> actual = binarySearchTree.getAsSortedList();
|
132
132
|
assertEquals(expected, actual);
|
133
133
|
}
|
134
|
-
|
134
|
+
|
135
135
|
@Ignore("Remove to run test")
|
136
136
|
@Test
|
137
137
|
public void sortsCollectionOfTwoIfSecondNumberisSameAsFirst() {
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# Bracket Push
|
2
2
|
|
3
|
-
Given a string containing brackets `[]`, braces `{}
|
4
|
-
verify that all
|
3
|
+
Given a string containing brackets `[]`, braces `{}`, parentheses `()`,
|
4
|
+
or any combination thereof, verify that any and all pairs are matched
|
5
|
+
and nested correctly.
|
5
6
|
|
6
7
|
# Java Tips
|
7
8
|
|
@@ -12,11 +12,15 @@ regarded as forming a rectangle when printed with intervening newlines.
|
|
12
12
|
|
13
13
|
For example, the sentence
|
14
14
|
|
15
|
-
|
15
|
+
```text
|
16
|
+
"If man was meant to stay on the ground, god would have given us roots."
|
17
|
+
```
|
16
18
|
|
17
19
|
is normalized to:
|
18
20
|
|
19
|
-
|
21
|
+
```text
|
22
|
+
"ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots"
|
23
|
+
```
|
20
24
|
|
21
25
|
The plaintext should be organized in to a rectangle. The size of the
|
22
26
|
rectangle (`r x c`) should be decided by the length of the message,
|
@@ -27,13 +31,13 @@ Our normalized text is 54 characters long, dictating a rectangle with
|
|
27
31
|
`c = 8` and `r = 7`:
|
28
32
|
|
29
33
|
```text
|
30
|
-
ifmanwas
|
31
|
-
meanttos
|
32
|
-
tayonthe
|
33
|
-
groundgo
|
34
|
-
dwouldha
|
35
|
-
vegivenu
|
36
|
-
sroots
|
34
|
+
"ifmanwas"
|
35
|
+
"meanttos"
|
36
|
+
"tayonthe"
|
37
|
+
"groundgo"
|
38
|
+
"dwouldha"
|
39
|
+
"vegivenu"
|
40
|
+
"sroots "
|
37
41
|
```
|
38
42
|
|
39
43
|
The coded message is obtained by reading down the columns going left to
|
@@ -42,7 +46,7 @@ right.
|
|
42
46
|
The message above is coded as:
|
43
47
|
|
44
48
|
```text
|
45
|
-
imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
|
49
|
+
"imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau"
|
46
50
|
```
|
47
51
|
|
48
52
|
Output the encoded text in chunks that fill perfect rectangles `(r X c)`,
|
@@ -51,21 +55,21 @@ with `c` chunks of `r` length, separated by spaces. For phrases that are
|
|
51
55
|
chunks with a single trailing space.
|
52
56
|
|
53
57
|
```text
|
54
|
-
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
|
58
|
+
"imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "
|
55
59
|
```
|
56
60
|
|
57
61
|
Notice that were we to stack these, we could visually decode the
|
58
62
|
cyphertext back in to the original message:
|
59
63
|
|
60
64
|
```text
|
61
|
-
imtgdvs
|
62
|
-
fearwer
|
63
|
-
mayoogo
|
64
|
-
anouuio
|
65
|
-
ntnnlvt
|
66
|
-
wttddes
|
67
|
-
aohghn
|
68
|
-
sseoau
|
65
|
+
"imtgdvs"
|
66
|
+
"fearwer"
|
67
|
+
"mayoogo"
|
68
|
+
"anouuio"
|
69
|
+
"ntnnlvt"
|
70
|
+
"wttddes"
|
71
|
+
"aohghn "
|
72
|
+
"sseoau "
|
69
73
|
```
|
70
74
|
|
71
75
|
# Running the tests
|
File without changes
|
@@ -55,7 +55,7 @@ public class QueenAttackCalculatorTest {
|
|
55
55
|
@Ignore("Remove to run test")
|
56
56
|
@Test
|
57
57
|
public void testQueensCannotAttack() {
|
58
|
-
|
58
|
+
QueenAttackCalculator calculator
|
59
59
|
= new QueenAttackCalculator(new Queen(2, 4), new Queen(6, 6));
|
60
60
|
|
61
61
|
assertFalse(calculator.canQueensAttackOneAnother());
|
@@ -64,7 +64,7 @@ public class QueenAttackCalculatorTest {
|
|
64
64
|
@Ignore("Remove to run test")
|
65
65
|
@Test
|
66
66
|
public void testQueensCanAttackOnTheSameRow() {
|
67
|
-
|
67
|
+
QueenAttackCalculator calculator
|
68
68
|
= new QueenAttackCalculator(new Queen(2, 4), new Queen(2, 6));
|
69
69
|
|
70
70
|
assertTrue(calculator.canQueensAttackOneAnother());
|
@@ -73,7 +73,7 @@ public class QueenAttackCalculatorTest {
|
|
73
73
|
@Ignore("Remove to run test")
|
74
74
|
@Test
|
75
75
|
public void testQueensCanAttackOnTheSameColumn() {
|
76
|
-
|
76
|
+
QueenAttackCalculator calculator
|
77
77
|
= new QueenAttackCalculator(new Queen(4, 5), new Queen(2, 5));
|
78
78
|
|
79
79
|
assertTrue(calculator.canQueensAttackOneAnother());
|
@@ -82,7 +82,7 @@ public class QueenAttackCalculatorTest {
|
|
82
82
|
@Ignore("Remove to run test")
|
83
83
|
@Test
|
84
84
|
public void testQueensCanAttackOnFirstDiagonal() {
|
85
|
-
|
85
|
+
QueenAttackCalculator calculator
|
86
86
|
= new QueenAttackCalculator(new Queen(2, 2), new Queen(0, 4));
|
87
87
|
|
88
88
|
assertTrue(calculator.canQueensAttackOneAnother());
|
@@ -91,7 +91,7 @@ public class QueenAttackCalculatorTest {
|
|
91
91
|
@Ignore("Remove to run test")
|
92
92
|
@Test
|
93
93
|
public void testQueensCanAttackOnSecondDiagonal() {
|
94
|
-
|
94
|
+
QueenAttackCalculator calculator
|
95
95
|
= new QueenAttackCalculator(new Queen(2, 2), new Queen(3, 1));
|
96
96
|
|
97
97
|
assertTrue(calculator.canQueensAttackOneAnother());
|
@@ -100,7 +100,7 @@ public class QueenAttackCalculatorTest {
|
|
100
100
|
@Ignore("Remove to run test")
|
101
101
|
@Test
|
102
102
|
public void testQueensCanAttackOnThirdDiagonal() {
|
103
|
-
|
103
|
+
QueenAttackCalculator calculator
|
104
104
|
= new QueenAttackCalculator(new Queen(2, 2), new Queen(1, 1));
|
105
105
|
|
106
106
|
assertTrue(calculator.canQueensAttackOneAnother());
|
@@ -109,7 +109,7 @@ public class QueenAttackCalculatorTest {
|
|
109
109
|
@Ignore("Remove to run test")
|
110
110
|
@Test
|
111
111
|
public void testQueensCanAttackOnFourthDiagonal() {
|
112
|
-
|
112
|
+
QueenAttackCalculator calculator
|
113
113
|
= new QueenAttackCalculator(new Queen(2, 2), new Queen(5, 5));
|
114
114
|
|
115
115
|
assertTrue(calculator.canQueensAttackOneAnother());
|
@@ -0,0 +1 @@
|
|
1
|
+
1.1.0
|
@@ -7,9 +7,9 @@ public class RobotTest {
|
|
7
7
|
|
8
8
|
@Test
|
9
9
|
public void robotIsCreatedWithInitialPositionAndOrientation() {
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
Orientation initialOrientation = Orientation.NORTH;
|
11
|
+
GridPosition initialGridPosition = new GridPosition(0, 0);
|
12
|
+
Robot robot = new Robot(initialGridPosition, initialOrientation);
|
13
13
|
|
14
14
|
assertEquals(robot.getOrientation(), initialOrientation);
|
15
15
|
assertEquals(robot.getGridPosition(), initialGridPosition);
|
@@ -18,9 +18,9 @@ public class RobotTest {
|
|
18
18
|
@Ignore("Remove to run test")
|
19
19
|
@Test
|
20
20
|
public void testNegativePositionsAreAllowed() {
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
GridPosition initialGridPosition = new GridPosition(-1, -1);
|
22
|
+
Orientation initialOrientation = Orientation.SOUTH;
|
23
|
+
Robot robot = new Robot(initialGridPosition, initialOrientation);
|
24
24
|
|
25
25
|
assertEquals(robot.getOrientation(), initialOrientation);
|
26
26
|
assertEquals(robot.getGridPosition(), initialGridPosition);
|
@@ -29,8 +29,8 @@ public class RobotTest {
|
|
29
29
|
@Ignore("Remove to run test")
|
30
30
|
@Test
|
31
31
|
public void testTurningRightDoesNotChangePosition() {
|
32
|
-
|
33
|
-
|
32
|
+
GridPosition initialGridPosition = new GridPosition(0, 0);
|
33
|
+
Robot robot = new Robot(initialGridPosition, Orientation.NORTH);
|
34
34
|
|
35
35
|
robot.turnRight();
|
36
36
|
|
@@ -40,11 +40,11 @@ public class RobotTest {
|
|
40
40
|
@Ignore("Remove to run test")
|
41
41
|
@Test
|
42
42
|
public void testTurningRightCorrectlyChangesOrientationFromNorthToEast() {
|
43
|
-
|
43
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.NORTH);
|
44
44
|
|
45
45
|
robot.turnRight();
|
46
46
|
|
47
|
-
|
47
|
+
Orientation expectedOrientation = Orientation.EAST;
|
48
48
|
|
49
49
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
50
50
|
}
|
@@ -52,11 +52,11 @@ public class RobotTest {
|
|
52
52
|
@Ignore("Remove to run test")
|
53
53
|
@Test
|
54
54
|
public void testTurningRightCorrectlyChangesOrientationFromEastToSouth() {
|
55
|
-
|
55
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.EAST);
|
56
56
|
|
57
57
|
robot.turnRight();
|
58
58
|
|
59
|
-
|
59
|
+
Orientation expectedOrientation = Orientation.SOUTH;
|
60
60
|
|
61
61
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
62
62
|
}
|
@@ -64,11 +64,11 @@ public class RobotTest {
|
|
64
64
|
@Ignore("Remove to run test")
|
65
65
|
@Test
|
66
66
|
public void testTurningRightCorrectlyChangesOrientationFromSouthToWest() {
|
67
|
-
|
67
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.SOUTH);
|
68
68
|
|
69
69
|
robot.turnRight();
|
70
70
|
|
71
|
-
|
71
|
+
Orientation expectedOrientation = Orientation.WEST;
|
72
72
|
|
73
73
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
74
74
|
}
|
@@ -76,11 +76,11 @@ public class RobotTest {
|
|
76
76
|
@Ignore("Remove to run test")
|
77
77
|
@Test
|
78
78
|
public void testTurningRightCorrectlyChangesOrientationFromWestToNorth() {
|
79
|
-
|
79
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.WEST);
|
80
80
|
|
81
81
|
robot.turnRight();
|
82
82
|
|
83
|
-
|
83
|
+
Orientation expectedOrientation = Orientation.NORTH;
|
84
84
|
|
85
85
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
86
86
|
}
|
@@ -88,8 +88,8 @@ public class RobotTest {
|
|
88
88
|
@Ignore("Remove to run test")
|
89
89
|
@Test
|
90
90
|
public void testTurningLeftDoesNotChangePosition() {
|
91
|
-
|
92
|
-
|
91
|
+
GridPosition initialGridPosition = new GridPosition(0, 0);
|
92
|
+
Robot robot = new Robot(initialGridPosition, Orientation.NORTH);
|
93
93
|
|
94
94
|
robot.turnLeft();
|
95
95
|
|
@@ -99,11 +99,11 @@ public class RobotTest {
|
|
99
99
|
@Ignore("Remove to run test")
|
100
100
|
@Test
|
101
101
|
public void testTurningLeftCorrectlyChangesOrientationFromNorthToWest() {
|
102
|
-
|
102
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.NORTH);
|
103
103
|
|
104
104
|
robot.turnLeft();
|
105
105
|
|
106
|
-
|
106
|
+
Orientation expectedOrientation = Orientation.WEST;
|
107
107
|
|
108
108
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
109
109
|
}
|
@@ -111,11 +111,11 @@ public class RobotTest {
|
|
111
111
|
@Ignore("Remove to run test")
|
112
112
|
@Test
|
113
113
|
public void testTurningLeftCorrectlyChangesOrientationFromWestToSouth() {
|
114
|
-
|
114
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.WEST);
|
115
115
|
|
116
116
|
robot.turnLeft();
|
117
117
|
|
118
|
-
|
118
|
+
Orientation expectedOrientation = Orientation.SOUTH;
|
119
119
|
|
120
120
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
121
121
|
}
|
@@ -123,11 +123,11 @@ public class RobotTest {
|
|
123
123
|
@Ignore("Remove to run test")
|
124
124
|
@Test
|
125
125
|
public void testTurningLeftCorrectlyChangesOrientationFromSouthToEast() {
|
126
|
-
|
126
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.SOUTH);
|
127
127
|
|
128
128
|
robot.turnLeft();
|
129
129
|
|
130
|
-
|
130
|
+
Orientation expectedOrientation = Orientation.EAST;
|
131
131
|
|
132
132
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
133
133
|
}
|
@@ -135,11 +135,11 @@ public class RobotTest {
|
|
135
135
|
@Ignore("Remove to run test")
|
136
136
|
@Test
|
137
137
|
public void testTurningLeftCorrectlyChangesOrientationFromEastToNorth() {
|
138
|
-
|
138
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.EAST);
|
139
139
|
|
140
140
|
robot.turnLeft();
|
141
141
|
|
142
|
-
|
142
|
+
Orientation expectedOrientation = Orientation.NORTH;
|
143
143
|
|
144
144
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
145
145
|
}
|
@@ -147,8 +147,8 @@ public class RobotTest {
|
|
147
147
|
@Ignore("Remove to run test")
|
148
148
|
@Test
|
149
149
|
public void testAdvancingDoesNotChangeOrientation() {
|
150
|
-
|
151
|
-
|
150
|
+
Orientation initialOrientation = Orientation.NORTH;
|
151
|
+
Robot robot = new Robot(new GridPosition(0, 0), initialOrientation);
|
152
152
|
|
153
153
|
robot.advance();
|
154
154
|
|
@@ -158,11 +158,11 @@ public class RobotTest {
|
|
158
158
|
@Ignore("Remove to run test")
|
159
159
|
@Test
|
160
160
|
public void testAdvancingWhenFacingNorthIncreasesYCoordinateByOne() {
|
161
|
-
|
161
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.NORTH);
|
162
162
|
|
163
163
|
robot.advance();
|
164
164
|
|
165
|
-
|
165
|
+
GridPosition expectedGridPosition = new GridPosition(0, 1);
|
166
166
|
|
167
167
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
168
168
|
}
|
@@ -170,11 +170,11 @@ public class RobotTest {
|
|
170
170
|
@Ignore("Remove to run test")
|
171
171
|
@Test
|
172
172
|
public void testAdvancingWhenFacingSouthDecreasesYCoordinateByOne() {
|
173
|
-
|
173
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.SOUTH);
|
174
174
|
|
175
175
|
robot.advance();
|
176
176
|
|
177
|
-
|
177
|
+
GridPosition expectedGridPosition = new GridPosition(0, -1);
|
178
178
|
|
179
179
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
180
180
|
}
|
@@ -182,11 +182,11 @@ public class RobotTest {
|
|
182
182
|
@Ignore("Remove to run test")
|
183
183
|
@Test
|
184
184
|
public void testAdvancingWhenFacingEastIncreasesXCoordinateByOne() {
|
185
|
-
|
185
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.EAST);
|
186
186
|
|
187
187
|
robot.advance();
|
188
188
|
|
189
|
-
|
189
|
+
GridPosition expectedGridPosition = new GridPosition(1, 0);
|
190
190
|
|
191
191
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
192
192
|
}
|
@@ -194,11 +194,11 @@ public class RobotTest {
|
|
194
194
|
@Ignore("Remove to run test")
|
195
195
|
@Test
|
196
196
|
public void testAdvancingWhenFacingWestDecreasesXCoordinateByOne() {
|
197
|
-
|
197
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.WEST);
|
198
198
|
|
199
199
|
robot.advance();
|
200
200
|
|
201
|
-
|
201
|
+
GridPosition expectedGridPosition = new GridPosition(-1, 0);
|
202
202
|
|
203
203
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
204
204
|
}
|
@@ -206,12 +206,12 @@ public class RobotTest {
|
|
206
206
|
@Ignore("Remove to run test")
|
207
207
|
@Test
|
208
208
|
public void testInstructionsToMoveWestAndNorth() {
|
209
|
-
|
209
|
+
Robot robot = new Robot(new GridPosition(0, 0), Orientation.NORTH);
|
210
210
|
|
211
211
|
robot.simulate("LAAARALA");
|
212
212
|
|
213
|
-
|
214
|
-
|
213
|
+
GridPosition expectedGridPosition = new GridPosition(-4, 1);
|
214
|
+
Orientation expectedOrientation = Orientation.WEST;
|
215
215
|
|
216
216
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
217
217
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
@@ -220,12 +220,12 @@ public class RobotTest {
|
|
220
220
|
@Ignore("Remove to run test")
|
221
221
|
@Test
|
222
222
|
public void testInstructionsToMoveWestAndSouth() {
|
223
|
-
|
223
|
+
Robot robot = new Robot(new GridPosition(2, -7), Orientation.EAST);
|
224
224
|
|
225
225
|
robot.simulate("RRAAAAALA");
|
226
226
|
|
227
|
-
|
228
|
-
|
227
|
+
GridPosition expectedGridPosition = new GridPosition(-3, -8);
|
228
|
+
Orientation expectedOrientation = Orientation.SOUTH;
|
229
229
|
|
230
230
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
231
231
|
assertEquals(robot.getOrientation(), expectedOrientation);
|
@@ -234,12 +234,12 @@ public class RobotTest {
|
|
234
234
|
@Ignore("Remove to run test")
|
235
235
|
@Test
|
236
236
|
public void testInstructionsToMoveEastAndNorth() {
|
237
|
-
|
237
|
+
Robot robot = new Robot(new GridPosition(8, 4), Orientation.SOUTH);
|
238
238
|
|
239
239
|
robot.simulate("LAAARRRALLLL");
|
240
240
|
|
241
|
-
|
242
|
-
|
241
|
+
GridPosition expectedGridPosition = new GridPosition(11, 5);
|
242
|
+
Orientation expectedOrientation = Orientation.NORTH;
|
243
243
|
|
244
244
|
assertEquals(robot.getGridPosition(), expectedGridPosition);
|
245
245
|
assertEquals(robot.getOrientation(), expectedOrientation);
|