trackler 2.1.0.24 → 2.1.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/CONTRIBUTING.md +5 -8
- data/README.md +7 -7
- data/common/CONTRIBUTING.md +0 -5
- data/common/exercises/accumulate/description.md +4 -1
- data/common/exercises/acronym/description.md +1 -1
- data/common/exercises/bank-account/description.md +2 -1
- data/common/exercises/book-store/description.md +2 -5
- data/common/exercises/bracket-push/description.md +2 -4
- data/common/exercises/change/description.md +2 -5
- data/common/exercises/circular-buffer/description.md +0 -2
- data/common/exercises/clock/description.md +0 -2
- data/common/exercises/collatz-conjecture/canonical-data.json +36 -0
- data/common/exercises/collatz-conjecture/description.md +25 -0
- data/common/exercises/collatz-conjecture/metadata.yml +4 -0
- data/common/exercises/counter/description.md +1 -2
- data/common/exercises/diamond/description.md +0 -4
- data/common/exercises/flatten-array/description.md +1 -1
- data/common/exercises/grade-school/description.md +2 -1
- data/common/exercises/grains/description.md +2 -1
- data/common/exercises/grep/description.md +3 -2
- data/common/exercises/kindergarten-garden/description.md +2 -1
- data/common/exercises/largest-series-product/description.md +2 -1
- data/common/exercises/matrix/description.md +2 -1
- data/common/exercises/nucleotide-codons/description.md +2 -1
- data/common/exercises/ocr-numbers/description.md +2 -1
- data/common/exercises/octal/description.md +3 -1
- data/common/exercises/pangram/description.md +2 -1
- data/common/exercises/perfect-numbers/description.md +2 -1
- data/common/exercises/poker/description.md +0 -2
- data/common/exercises/protein-translation/description.md +3 -2
- data/common/exercises/proverb/description.md +2 -1
- data/common/exercises/pythagorean-triplet/description.md +4 -2
- data/common/exercises/queen-attack/description.md +2 -1
- data/common/exercises/rectangles/description.md +1 -3
- data/common/exercises/rotational-cipher/description.md +0 -4
- data/common/exercises/scale-generator/description.md +0 -2
- data/common/exercises/secret-handshake/description.md +2 -2
- data/common/exercises/series/description.md +2 -1
- data/common/exercises/sieve/description.md +2 -1
- data/common/exercises/space-age/description.md +0 -2
- data/common/exercises/strain/description.md +4 -5
- data/common/exercises/sublist/description.md +3 -6
- data/common/exercises/sum-of-multiples/description.md +2 -1
- data/common/exercises/tournament/description.md +4 -3
- data/common/exercises/transpose/description.md +1 -3
- data/common/exercises/trinary/description.md +2 -1
- data/common/exercises/two-bucket/description.md +1 -3
- data/common/exercises/two-fer/canonical-data.json +24 -0
- data/common/exercises/two-fer/description.md +40 -0
- data/common/exercises/two-fer/metadata.yml +4 -0
- data/common/exercises/word-search/description.md +2 -4
- data/common/exercises/zebra-puzzle/description.md +1 -1
- data/lib/trackler.rb +10 -5
- data/lib/trackler/description.rb +2 -2
- data/lib/trackler/guaranteed_file.rb +15 -15
- data/lib/trackler/implementation.rb +5 -5
- data/lib/trackler/implementations.rb +2 -2
- data/lib/trackler/metadata.rb +2 -2
- data/lib/trackler/problem.rb +2 -96
- data/lib/trackler/problems.rb +3 -48
- data/lib/trackler/specification.rb +101 -0
- data/lib/trackler/specifications.rb +52 -0
- data/lib/trackler/track.rb +6 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/LICENSE +21 -0
- data/tracks/bash/README.md +0 -5
- data/tracks/c/LICENSE +21 -0
- data/tracks/c/README.md +0 -5
- data/tracks/clojure/LICENSE +2 -2
- data/tracks/clojure/README.org +0 -5
- data/tracks/clojure/config.json +5 -0
- data/tracks/clojure/exercises/sublist/project.clj +4 -0
- data/tracks/clojure/exercises/sublist/src/example.clj +19 -0
- data/tracks/clojure/exercises/sublist/sublist.mustache +9 -0
- data/tracks/clojure/exercises/sublist/test/sublist_test.clj +40 -0
- data/tracks/cpp/LICENSE +2 -2
- data/tracks/cpp/README.md +0 -5
- data/tracks/csharp/LICENSE +2 -2
- data/tracks/csharp/README.md +0 -5
- data/tracks/delphi/LICENSE +2 -2
- data/tracks/delphi/README.md +0 -5
- data/tracks/ecmascript/LICENSE +2 -2
- data/tracks/ecmascript/README.md +0 -5
- data/tracks/elisp/.travis.yml +7 -3
- data/tracks/elisp/LICENSE +2 -2
- data/tracks/elisp/README.org +3 -6
- data/tracks/elisp/bin/test-examples +27 -0
- data/tracks/elisp/config.json +10 -0
- data/tracks/elisp/docs/LEARNING.org +0 -3
- data/tracks/elisp/exercises/grains/example.el +18 -0
- data/tracks/elisp/exercises/grains/grains-test.el +38 -0
- data/tracks/elisp/exercises/grains/grains.el +10 -0
- data/tracks/elisp/exercises/phone-number/example.el +34 -0
- data/tracks/elisp/exercises/phone-number/phone-number-test.el +43 -0
- data/tracks/elisp/exercises/phone-number/phone-number.el +9 -0
- data/tracks/elixir/LICENSE +2 -2
- data/tracks/elixir/README.md +0 -5
- data/tracks/elm/LICENSE +2 -2
- data/tracks/elm/README.md +0 -5
- data/tracks/erlang/LICENSE +2 -2
- data/tracks/erlang/README.md +0 -5
- data/tracks/erlang/SETUP.md +7 -0
- data/tracks/erlang/exercises/rotational-cipher/rebar.config +5 -5
- data/tracks/erlang/exercises/rotational-cipher/test/rotational_cipher_tests.erl +18 -18
- data/tracks/factor/LICENSE +2 -2
- data/tracks/fortran/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- data/tracks/fortran/.gitignore +4 -0
- data/tracks/fortran/.travis.yml +17 -0
- data/tracks/fortran/LICENSE +21 -0
- data/tracks/fortran/Makefile +40 -0
- data/tracks/fortran/README.md +72 -0
- data/tracks/fortran/bin/fetch-configlet +32 -0
- data/tracks/fortran/config.json +32 -0
- data/tracks/{kotlin/SETUP.md → fortran/docs/ABOUT.md} +0 -0
- data/tracks/fortran/docs/INSTALLATION.md +0 -0
- data/tracks/fortran/docs/LEARNING.md +0 -0
- data/tracks/fortran/docs/RESOURCES.md +0 -0
- data/tracks/fortran/docs/TESTS.md +0 -0
- data/tracks/fortran/exercises/TRACK_HINTS.md +0 -0
- data/tracks/fortran/exercises/bob/bob.fun +114 -0
- data/tracks/fortran/exercises/bob/example.f90 +61 -0
- data/tracks/fortran/exercises/hello_world/example.f90 +9 -0
- data/tracks/fortran/exercises/hello_world/hello_world.fun +10 -0
- data/tracks/fortran/img/.keep +0 -0
- data/tracks/fsharp/LICENSE +2 -2
- data/tracks/fsharp/README.md +0 -5
- data/tracks/go/LICENSE +2 -2
- data/tracks/go/README.md +0 -5
- data/tracks/haskell/LICENSE +2 -2
- data/tracks/haskell/README.md +0 -5
- data/tracks/idris/LICENSE +2 -2
- data/tracks/idris/README.md +0 -5
- data/tracks/java/LICENSE +2 -2
- data/tracks/java/README.md +0 -7
- data/tracks/java/{SETUP.md → TRACK_HINTS.md} +0 -0
- data/tracks/java/config.json +5 -0
- data/tracks/java/exercises/_template/build.gradle +1 -0
- data/tracks/java/exercises/accumulate/build.gradle +1 -0
- data/tracks/java/exercises/acronym/build.gradle +1 -0
- data/tracks/java/exercises/all-your-base/build.gradle +1 -0
- data/tracks/java/exercises/allergies/build.gradle +1 -0
- data/tracks/java/exercises/anagram/build.gradle +1 -0
- data/tracks/java/exercises/atbash-cipher/build.gradle +1 -0
- data/tracks/java/exercises/beer-song/build.gradle +1 -0
- data/tracks/java/exercises/binary-search/build.gradle +1 -0
- data/tracks/java/exercises/binary/build.gradle +1 -0
- data/tracks/java/exercises/bob/build.gradle +1 -0
- data/tracks/java/exercises/book-store/build.gradle +1 -0
- data/tracks/java/exercises/bracket-push/build.gradle +1 -0
- data/tracks/java/exercises/change/build.gradle +1 -0
- data/tracks/java/exercises/clock/build.gradle +2 -1
- data/tracks/java/exercises/collatz-conjecture/build.gradle +18 -0
- data/tracks/java/exercises/collatz-conjecture/src/example/java/CollatzCalculator.java +19 -0
- data/tracks/java/exercises/collatz-conjecture/src/main/java/CollatzCalculator.java +7 -0
- data/tracks/java/exercises/collatz-conjecture/src/test/java/CollatzCalculatorTest.java +59 -0
- data/tracks/java/exercises/crypto-square/build.gradle +1 -0
- data/tracks/java/exercises/diamond/build.gradle +1 -0
- data/tracks/java/exercises/diamond/src/example/java/DiamondPrinter.java +4 -4
- data/tracks/java/exercises/diamond/src/test/java/DiamondPrinterTest.java +6 -2
- data/tracks/java/exercises/difference-of-squares/build.gradle +1 -0
- data/tracks/java/exercises/difference-of-squares/src/main/java/.keep +0 -0
- data/tracks/java/exercises/etl/build.gradle +1 -0
- data/tracks/java/exercises/flatten-array/build.gradle +1 -0
- data/tracks/java/exercises/gigasecond/build.gradle +1 -0
- data/tracks/java/exercises/grade-school/build.gradle +1 -0
- data/tracks/java/exercises/hamming/build.gradle +1 -0
- data/tracks/java/exercises/hexadecimal/build.gradle +1 -0
- data/tracks/java/exercises/isogram/build.gradle +1 -0
- data/tracks/java/exercises/kindergarten-garden/build.gradle +1 -0
- data/tracks/java/exercises/largest-series-product/build.gradle +1 -0
- data/tracks/java/exercises/linked-list/build.gradle +1 -0
- data/tracks/java/exercises/luhn/build.gradle +1 -0
- data/tracks/java/exercises/matrix/build.gradle +2 -1
- data/tracks/java/exercises/meetup/build.gradle +1 -0
- data/tracks/java/exercises/minesweeper/build.gradle +1 -0
- data/tracks/java/exercises/nth-prime/build.gradle +1 -0
- data/tracks/java/exercises/ocr-numbers/build.gradle +1 -0
- data/tracks/java/exercises/octal/build.gradle +1 -0
- data/tracks/java/exercises/pangram/build.gradle +1 -0
- data/tracks/java/exercises/pascals-triangle/build.gradle +1 -0
- data/tracks/java/exercises/perfect-numbers/build.gradle +1 -0
- data/tracks/java/exercises/phone-number/build.gradle +1 -0
- data/tracks/java/exercises/pig-latin/build.gradle +1 -0
- data/tracks/java/exercises/queen-attack/build.gradle +1 -0
- data/tracks/java/exercises/raindrops/build.gradle +1 -0
- data/tracks/java/exercises/rectangles/build.gradle +1 -0
- data/tracks/java/exercises/rna-transcription/build.gradle +1 -0
- data/tracks/java/exercises/robot-simulator/build.gradle +1 -0
- data/tracks/java/exercises/roman-numerals/build.gradle +1 -0
- data/tracks/java/exercises/run-length-encoding/build.gradle +1 -0
- data/tracks/java/exercises/saddle-points/build.gradle +1 -0
- data/tracks/java/exercises/scrabble-score/build.gradle +1 -0
- data/tracks/java/exercises/secret-handshake/build.gradle +1 -0
- data/tracks/java/exercises/series/build.gradle +1 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/sieve/build.gradle +1 -0
- data/tracks/java/exercises/simple-cipher/build.gradle +1 -0
- data/tracks/java/exercises/simple-linked-list/build.gradle +1 -0
- data/tracks/java/exercises/space-age/build.gradle +1 -0
- data/tracks/java/exercises/strain/build.gradle +1 -0
- data/tracks/java/exercises/sublist/build.gradle +1 -0
- data/tracks/java/exercises/sum-of-multiples/build.gradle +1 -0
- data/tracks/java/exercises/triangle/build.gradle +1 -0
- data/tracks/java/exercises/trinary/build.gradle +1 -0
- data/tracks/java/exercises/twelve-days/build.gradle +2 -1
- data/tracks/java/exercises/word-count/build.gradle +1 -0
- data/tracks/java/exercises/wordy/build.gradle +1 -0
- data/tracks/javascript/LICENSE +2 -2
- data/tracks/javascript/README.md +0 -5
- data/tracks/julia/LICENSE +2 -2
- data/tracks/kotlin/LICENSE +2 -2
- data/tracks/kotlin/README.md +0 -7
- data/tracks/kotlin/TRACK_HINTS.md +1 -0
- data/tracks/kotlin/exercises/phone-number/src/example/kotlin/PhoneNumber.kt +1 -1
- data/tracks/kotlin/exercises/phone-number/src/test/kotlin/PhoneNumberTest.kt +7 -8
- data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +6 -6
- data/tracks/lfe/LICENSE +2 -2
- data/tracks/lfe/README.md +0 -5
- data/tracks/lisp/LICENSE +2 -2
- data/tracks/lisp/README.md +0 -5
- data/tracks/lua/LICENSE +2 -2
- data/tracks/lua/README.md +0 -5
- data/tracks/mips/LICENSE +2 -2
- data/tracks/mips/README.md +0 -5
- data/tracks/objective-c/LICENSE +2 -2
- data/tracks/objective-c/README.md +0 -5
- data/tracks/ocaml/LICENSE +2 -2
- data/tracks/ocaml/README.md +0 -5
- data/tracks/ocaml/config.json +54 -25
- data/tracks/ocaml/exercises/forth/.merlin +5 -0
- data/tracks/ocaml/exercises/forth/Makefile +11 -0
- data/tracks/ocaml/exercises/forth/example.ml +89 -0
- data/tracks/ocaml/exercises/forth/forth.mli +1 -0
- data/tracks/ocaml/exercises/forth/test.ml +147 -0
- data/tracks/ocaml/exercises/react/.merlin +5 -0
- data/tracks/ocaml/exercises/react/HINT.md +3 -0
- data/tracks/ocaml/exercises/react/Makefile +11 -0
- data/tracks/ocaml/exercises/react/example.ml +106 -0
- data/tracks/ocaml/exercises/react/react.mli +26 -0
- data/tracks/ocaml/exercises/react/test.ml +157 -0
- data/tracks/ocaml/tools/test-generator/src/special_cases.ml +5 -2
- data/tracks/ocaml/tools/test-generator/templates/forth/template.ml +114 -0
- data/tracks/perl5/LICENSE +2 -2
- data/tracks/perl6/LICENSE +2 -2
- data/tracks/perl6/README.md +0 -5
- data/tracks/perl6/config.json +5 -0
- data/tracks/perl6/exercises/clock/Example.pm6 +2 -2
- data/tracks/perl6/exercises/flatten-array/Example.pm6 +13 -0
- data/tracks/perl6/exercises/flatten-array/FlattenArray.pm6 +4 -0
- data/tracks/perl6/exercises/flatten-array/example.yaml +6 -0
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +80 -0
- data/tracks/php/LICENSE +2 -2
- data/tracks/php/README.md +0 -5
- data/tracks/powershell/.travis.yml +1 -0
- data/tracks/python/LICENSE +2 -2
- data/tracks/python/README.md +0 -5
- data/tracks/python/config.json +8 -0
- data/tracks/python/exercises/protein-translation/example.py +25 -0
- data/tracks/python/exercises/protein-translation/protein_translation.py +6 -0
- data/tracks/python/exercises/protein-translation/protein_translation_test.py +59 -0
- data/tracks/r/LICENSE +2 -2
- data/tracks/r/README.md +0 -5
- data/tracks/racket/LICENSE +2 -2
- data/tracks/racket/README.md +0 -5
- data/tracks/racket/config.json +5 -0
- data/tracks/racket/exercises/acronym/acronym-test.rkt +40 -0
- data/tracks/racket/exercises/acronym/acronym.rkt +3 -0
- data/tracks/racket/exercises/acronym/example.rkt +25 -0
- data/tracks/racket/exercises/grep/example.rkt +60 -26
- data/tracks/racket/exercises/grep/grep-test.rkt +154 -17
- data/tracks/racket/exercises/grep/grep.rkt +1 -18
- data/tracks/racket/exercises/grep/iliad.txt +9 -0
- data/tracks/racket/exercises/grep/midsummer-night.txt +7 -0
- data/tracks/racket/exercises/grep/paradise-lost.txt +8 -0
- data/tracks/ruby/README.md +4 -1
- data/tracks/ruby/exercises/acronym/.meta/.version +1 -1
- data/tracks/ruby/exercises/acronym/.meta/solutions/acronym.rb +1 -1
- data/tracks/ruby/exercises/acronym/acronym_test.rb +2 -7
- data/tracks/ruby/exercises/anagram/.meta/generator/anagram_case.rb +1 -1
- data/tracks/ruby/exercises/beer-song/.meta/generator/beer_song_case.rb +1 -1
- data/tracks/ruby/exercises/clock/.meta/generator/clock_case.rb +1 -1
- data/tracks/ruby/exercises/connect/.meta/generator/connect_case.rb +0 -3
- data/tracks/ruby/exercises/connect/.meta/generator/test_template.erb +1 -1
- data/tracks/ruby/exercises/difference-of-squares/.meta/.version +1 -1
- data/tracks/ruby/exercises/difference-of-squares/.meta/solutions/difference_of_squares.rb +1 -1
- data/tracks/ruby/exercises/difference-of-squares/difference_of_squares_test.rb +12 -17
- data/tracks/ruby/exercises/triangle/.meta/generator/triangle_case.rb +10 -2
- data/tracks/ruby/exercises/triangle/triangle_test.rb +17 -17
- data/tracks/ruby/exercises/wordy/.meta/generator/wordy_case.rb +1 -1
- data/tracks/ruby/lib/generator/case_values.rb +1 -1
- data/tracks/ruby/lib/generator/exercise_case.rb +16 -2
- data/tracks/ruby/lib/generator/exercise_case/assertion.rb +4 -4
- data/tracks/ruby/test/fixtures/xruby/exercises/alpha/.meta/generator/alpha_case.rb +1 -1
- data/tracks/ruby/test/generator/case_values_test.rb +28 -7
- data/tracks/ruby/test/generator/exercise_case/assertion_test.rb +7 -7
- data/tracks/ruby/test/generator/exercise_case_test.rb +21 -25
- data/tracks/ruby/test/wordy_cases_test.rb +4 -4
- data/tracks/rust/LICENSE +2 -2
- data/tracks/rust/README.md +0 -5
- data/tracks/rust/config.json +1 -0
- data/tracks/rust/exercises/etl/Cargo.toml +1 -1
- data/tracks/rust/exercises/etl/example.rs +2 -2
- data/tracks/rust/exercises/etl/tests/etl.rs +26 -32
- data/tracks/rust/exercises/forth/tests/forth.rs +20 -22
- data/tracks/rust/exercises/minesweeper/Cargo.toml +1 -1
- data/tracks/rust/exercises/minesweeper/example.rs +3 -0
- data/tracks/rust/exercises/minesweeper/tests/minesweeper.rs +44 -46
- data/tracks/rust/exercises/raindrops/Cargo.toml +1 -1
- data/tracks/rust/exercises/raindrops/tests/raindrops.rs +12 -0
- data/tracks/rust/exercises/rna-transcription/Cargo.toml +1 -1
- data/tracks/rust/exercises/rna-transcription/example.rs +13 -9
- data/tracks/rust/exercises/rna-transcription/tests/rna-transcription.rs +23 -5
- data/tracks/scala/LICENSE +2 -2
- data/tracks/scala/README.md +0 -5
- data/tracks/scheme/LICENSE +2 -2
- data/tracks/scheme/README.org +0 -6
- data/tracks/swift/Dangerfile +1 -1
- data/tracks/swift/LICENSE +2 -2
- data/tracks/swift/README.md +0 -6
- data/tracks/vbnet/.travis.yml +1 -0
- data/tracks/vimscript/.travis.yml +4 -0
- data/tracks/vimscript/.vintrc.yaml +5 -0
- data/tracks/vimscript/TRACK_HINTS.md +19 -1
- data/tracks/vimscript/bin/pre-push +18 -0
- data/tracks/vimscript/config.json +8 -1
- data/tracks/vimscript/docs/ABOUT.md +7 -6
- data/tracks/vimscript/docs/TESTS.md +4 -4
- data/tracks/vimscript/exercises/allergies/allergies.vader +68 -0
- data/tracks/vimscript/exercises/allergies/allergies.vim +29 -0
- data/tracks/vimscript/exercises/allergies/example.vim +23 -0
- data/tracks/vimscript/lib/generate.vim +89 -0
- metadata +81 -6
- data/tracks/java/exercises/difference-of-squares/src/main/java/DifferenceOfSquaresCalculator.java +0 -15
- data/tracks/ocaml/.vscode/launch.json +0 -13
data/tracks/factor/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2017 Exercism, Inc
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Thank you for this PR! :tada:
|
2
|
+
|
3
|
+
When we review your submission we will check the following:
|
4
|
+
|
5
|
+
- [ ] TODO: Update this list based on the appropriate checks for this specific track
|
6
|
+
- [ ] No trailing whitespace nor extraneous blank lines
|
7
|
+
- [ ] Proper indentation and consistent code formatting
|
8
|
+
- [ ] Free from spelling and grammatical errors
|
9
|
+
- [ ] Readable code style
|
10
|
+
- [ ] Exemplifies the idioms of {{LANGUAGE}}
|
11
|
+
- [ ] Absence of non-standard libraries
|
12
|
+
- [ ] No extraneous configuration files
|
13
|
+
- [ ] Free of development/debug artifacts such as `puts`, `console.log`, or `debugger` calls
|
14
|
+
|
15
|
+
If you are submitting a new exercise, we will compare your submission to the common guidelines set out for the exercise in [x-common](https://github.com/exercism/x-common/tree/master/exercises).
|
16
|
+
|
17
|
+
Your submission will be run through a series of automated tests and checks. The outcome will be displayed below. In addition to the test suite, the following issues are automatically checked:
|
18
|
+
|
19
|
+
- TODO: Update this list based on the linting available for this specific track
|
20
|
+
- No trailing whitespace nor extraneous blank lines
|
21
|
+
- Proper indentation and consistent code formatting
|
22
|
+
- Spelling and grammatical errors
|
23
|
+
- Compiler and deprecation warnings
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
language: c
|
3
|
+
|
4
|
+
before_install:
|
5
|
+
- sudo apt-get install gfortran
|
6
|
+
- sudo apt-get install ruby-full
|
7
|
+
- sudo apt-get install rubygems
|
8
|
+
|
9
|
+
install:
|
10
|
+
- sudo gem install funit
|
11
|
+
|
12
|
+
script:
|
13
|
+
- make test
|
14
|
+
- bin/fetch-configlet
|
15
|
+
- bin/configlet .
|
16
|
+
|
17
|
+
sudo: required
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 Exercism, Inc
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# assignments
|
2
|
+
ASSIGNMENT ?= ""
|
3
|
+
IGNOREDIRS := "^(\.git|bin|docs|exercises)$$"
|
4
|
+
ASSIGNMENTS = $(shell find ./exercises -maxdepth 1 -mindepth 1 -type d | awk -F/ '{print $$NF}' | sort | grep -Ev $(IGNOREDIRS))
|
5
|
+
|
6
|
+
# output directories
|
7
|
+
TMPDIR ?= "/tmp"
|
8
|
+
OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")
|
9
|
+
|
10
|
+
# language specific config (tweakable per language)
|
11
|
+
FILEEXT := "f90"
|
12
|
+
TESTEXT := "fun"
|
13
|
+
EXAMPLE := "example.$(FILEEXT)"
|
14
|
+
TSTFILE := "$(ASSIGNMENT).$(TESTEXT)"
|
15
|
+
|
16
|
+
# compiler flags
|
17
|
+
export FSFLAG := "-I"
|
18
|
+
export FC := "gfortran"
|
19
|
+
export CXX := "g++"
|
20
|
+
export CC := "gcc"
|
21
|
+
|
22
|
+
default:
|
23
|
+
gem install funit
|
24
|
+
|
25
|
+
help: ## Prints this help
|
26
|
+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
27
|
+
|
28
|
+
install-test: ## install test dependency: funit
|
29
|
+
@gem install funit
|
30
|
+
|
31
|
+
test-assignment: ## run single test using ASSIGNMENTS: test-assignment ASSIGNMENT=wordy
|
32
|
+
@echo "running tests for: $(ASSIGNMENT)"
|
33
|
+
# @cat ./exercises/$(ASSIGNMENT)/$(TSTFILE) | sed '/markTestSkipped()/d' > $(OUTDIR)/$(TSTFILE)
|
34
|
+
@cat ./exercises/$(ASSIGNMENT)/$(TSTFILE) > $(OUTDIR)/$(TSTFILE)
|
35
|
+
@cp ./exercises/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(ASSIGNMENT).$(FILEEXT)
|
36
|
+
@cd $(OUTDIR) && funit
|
37
|
+
|
38
|
+
test: ## run all tests
|
39
|
+
@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s test-assignment || exit 1; done
|
40
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# Exercism Fortran Track
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/exercism/xfortran.svg?branch=master)](https://travis-ci.org/exercism/xfortran)
|
4
|
+
|
5
|
+
Exercism exercises in Fortran.
|
6
|
+
|
7
|
+
## Setup
|
8
|
+
|
9
|
+
The simplest way to install Fortran is ...
|
10
|
+
|
11
|
+
## Contributing
|
12
|
+
|
13
|
+
Thank you so much for contributing! :tada:
|
14
|
+
|
15
|
+
Please read about how to [get involved in a track](https://github.com/exercism/docs/tree/master/contributing-to-language-tracks). Be sure to read the Exercism [Code of Conduct](https://github.com/exercism/exercism.io/blob/master/CODE_OF_CONDUCT.md).
|
16
|
+
|
17
|
+
We welcome pull requests of all kinds. No contribution is too small.
|
18
|
+
|
19
|
+
We encourage contributions that provide fixes and improvements to existing exercises. Please note that this track's exercises must conform to the standards determined in the [exercism/x-common](https://github.com/exercism/x-common) repo. Changes to the tests or documentation of a common exercise will often warrant a PR in that repo before it can be incorporated into this track's exercises. If you're unsure, then go ahead and open a GitHub issue, and we'll discuss the change.
|
20
|
+
|
21
|
+
## Exercise Tests ##
|
22
|
+
|
23
|
+
At the most basic level, Exercism is all about the tests. They drive the user's implementation forward and tell them when the exercise is complete.
|
24
|
+
|
25
|
+
The utmost care and attention should be used when adding or making changes to the tests for an exercise. When implementing an exercise test suite, we want to provide a good user experience for the people writing a solution to the exercise. People should not be confused or overwhelmed.
|
26
|
+
|
27
|
+
We simulate Test-Driven Development (TDD) by implementing the tests in order of increasing complexity. We try to ensure that each test either
|
28
|
+
|
29
|
+
- helps triangulate a solution to be more generic, or
|
30
|
+
- requires new functionality incrementally.
|
31
|
+
|
32
|
+
Test files should use the following format:
|
33
|
+
|
34
|
+
```
|
35
|
+
# include the body of an example test
|
36
|
+
```
|
37
|
+
|
38
|
+
## Submitting a Pull Request ##
|
39
|
+
|
40
|
+
Please keep the following in mind:
|
41
|
+
|
42
|
+
- Pull requests should be focused on a single exercise, issue, or change.
|
43
|
+
|
44
|
+
- We welcome changes to code style, and wording. Please open a separate PR for these changes if possible.
|
45
|
+
|
46
|
+
- Please open an issue before creating a PR that makes significant (breaking) changes to an existing exercise or makes changes across many exercises. It is best to discuss these changes before doing the work. Discussions related to exercises that are not track specific can be found in [exercism/discussions](https://github.com/exercism/discussions/issues).
|
47
|
+
|
48
|
+
- Follow the coding standards for Fortran. (If there is a formatter for the track's language, add instructions for using it here.)
|
49
|
+
|
50
|
+
- Watch out for trailing spaces, extra blank lines, and spaces in blank lines.
|
51
|
+
|
52
|
+
- All the tests for Fortran exercises can be run from the top level of the repo with ... Please run this command before submitting your PR.
|
53
|
+
|
54
|
+
## Contributing a New Exercise ##
|
55
|
+
|
56
|
+
- All Exercism exercises must be defined in [x-common](https://github.com/exercism/x-common/tree/master/exercises) before they are implemented for a specific track. Please submit a PR there if your exercise is new to Exercism.
|
57
|
+
|
58
|
+
- Please make sure the new exercise conforms to specifications in the [exercism/x-common](https://github.com/exercism/x-common) repo.
|
59
|
+
|
60
|
+
- Each exercise must stand on its own. Do not reference files outside the exercise directory. They will not be included when the user fetches the exercise.
|
61
|
+
|
62
|
+
- Exercises should use only the Fortran core libraries.
|
63
|
+
|
64
|
+
- Please do not add a README or README.md file to the exercise directory. The READMEs are constructed using shared metadata, which lives in the
|
65
|
+
[exercism/x-common](https://github.com/exercism/x-common) repository. Further explanation can be found in [fixing-exercise-readmes](https://github.com/exercism/exercism.io/blob/master/docs/fixing-exercise-readmes.md)
|
66
|
+
|
67
|
+
- Each exercise should have a test suite, an example solution, a template file for the real implementation and ... (anything else that needs to go with each exercise for this track). The CI build expects files to be named using the following convention: (describe the Fortran convention for naming the various files that make up an exercise).
|
68
|
+
|
69
|
+
- Please do not commit any configuration files or directories inside the exercise other than ...
|
70
|
+
|
71
|
+
- Be sure to add it to the appropriate place in the `config.json` file. Also, please run `bin/fetch-configlet && bin/configlet` to ensure the exercise is configured correctly.
|
72
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
LATEST=https://github.com/exercism/configlet/releases/latest
|
4
|
+
|
5
|
+
OS=$(
|
6
|
+
case $(uname) in
|
7
|
+
(Darwin*)
|
8
|
+
echo "mac";;
|
9
|
+
(Linux*)
|
10
|
+
echo "linux";;
|
11
|
+
(Windows*)
|
12
|
+
echo "windows";;
|
13
|
+
(*)
|
14
|
+
echo "linux";;
|
15
|
+
esac)
|
16
|
+
|
17
|
+
ARCH=$(
|
18
|
+
case $(uname -m) in
|
19
|
+
(*64*)
|
20
|
+
echo 64bit;;
|
21
|
+
(*686*)
|
22
|
+
echo 32bit;;
|
23
|
+
(*386*)
|
24
|
+
echo 32bit;;
|
25
|
+
(*)
|
26
|
+
echo 64bit;;
|
27
|
+
esac)
|
28
|
+
|
29
|
+
VERSION="$(curl --head --silent $LATEST | awk -v FS=/ '/Location:/{print $NF}' | tr -d '\r')"
|
30
|
+
URL=https://github.com/exercism/configlet/releases/download/$VERSION/configlet-$OS-${ARCH}.tgz
|
31
|
+
|
32
|
+
curl -s --location $URL | tar xz -C bin/
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"slug": "fortran",
|
3
|
+
"language": "Fortran",
|
4
|
+
"repository": "https://github.com/exercism/xfortran",
|
5
|
+
"active": false,
|
6
|
+
"test_pattern": "TODO",
|
7
|
+
"exercises": [
|
8
|
+
{
|
9
|
+
"slug": "hello_world",
|
10
|
+
"difficulty": 1,
|
11
|
+
"topics": [
|
12
|
+
]
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"slug": "bob",
|
16
|
+
"difficulty": 1,
|
17
|
+
"topics": [
|
18
|
+
]
|
19
|
+
}
|
20
|
+
],
|
21
|
+
"deprecated": [
|
22
|
+
|
23
|
+
],
|
24
|
+
"ignored": [
|
25
|
+
"bin",
|
26
|
+
"img",
|
27
|
+
"docs"
|
28
|
+
],
|
29
|
+
"foregone": [
|
30
|
+
|
31
|
+
]
|
32
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,114 @@
|
|
1
|
+
test_suite bob
|
2
|
+
character(100) :: multi_line_string
|
3
|
+
|
4
|
+
setup
|
5
|
+
end setup
|
6
|
+
|
7
|
+
function random_string(length, begin_char, end_char)
|
8
|
+
integer :: length, r, i
|
9
|
+
character(length) :: random_string
|
10
|
+
logical :: uppercase
|
11
|
+
integer :: base, ending
|
12
|
+
character :: begin_char, end_char
|
13
|
+
|
14
|
+
base = ichar(begin_char)
|
15
|
+
ending = ichar(end_char)
|
16
|
+
|
17
|
+
do i = 1,length
|
18
|
+
r = rand(0)*(ending-base)
|
19
|
+
random_string(i:i) = char(base + r)
|
20
|
+
end do
|
21
|
+
end function random_string
|
22
|
+
|
23
|
+
function random_shouting(length)
|
24
|
+
integer :: length
|
25
|
+
character(length) :: random_shouting
|
26
|
+
random_shouting = random_string(length-1, 'A', 'Z')
|
27
|
+
random_shouting(length:length) = '!'
|
28
|
+
end function random_shouting
|
29
|
+
|
30
|
+
function random_question(length)
|
31
|
+
integer :: length
|
32
|
+
character(length) :: random_question
|
33
|
+
random_question = random_string(length-1, 'a', 'z')
|
34
|
+
random_question(length:length) = '?'
|
35
|
+
end function random_question
|
36
|
+
|
37
|
+
test stating_something
|
38
|
+
assert_equal( 'Whatever.' , hey('Tom-ay-to, tomaaaah-to.') )
|
39
|
+
end test
|
40
|
+
|
41
|
+
test shouting
|
42
|
+
assert_equal( 'Whoa chill out!' , hey('WATCH OUT!') )
|
43
|
+
end test
|
44
|
+
|
45
|
+
test shouting_gibberish
|
46
|
+
assert_equal( 'Whoa chill out!' , hey(random_shouting(11)) )
|
47
|
+
end test
|
48
|
+
|
49
|
+
test asking_a_question
|
50
|
+
assert_equal( 'Sure.' , hey('Does this cryogenic chamber make me look fat?') )
|
51
|
+
end test
|
52
|
+
|
53
|
+
test asking_a_numeric_question
|
54
|
+
assert_equal( 'Sure.' , hey('You are, what, like 15?') )
|
55
|
+
end test
|
56
|
+
|
57
|
+
test asking_gibberish
|
58
|
+
assert_equal( 'Sure.' , hey(random_question(11)) )
|
59
|
+
end test
|
60
|
+
|
61
|
+
test talking_forcefully
|
62
|
+
assert_equal( 'Whatever.' , hey('Lets''s go make out behind the gym!') )
|
63
|
+
end test
|
64
|
+
|
65
|
+
test using_acronyms_in_regular_speech
|
66
|
+
assert_equal( 'Whatever.' , hey('It''s OK if you don''t want to go to the DMV.') )
|
67
|
+
end test
|
68
|
+
|
69
|
+
test forceful_questions
|
70
|
+
assert_equal( 'Whoa chill out!' , hey('WHAT THE HELL WHERE YOU THINKING?') )
|
71
|
+
end test
|
72
|
+
|
73
|
+
test shouting_numbers
|
74
|
+
assert_equal( 'Whoa chill out!' , hey('1, 2, 3, GO!') )
|
75
|
+
end test
|
76
|
+
|
77
|
+
test only_numbers
|
78
|
+
assert_equal( 'Whatever.' , hey('1, 2, 3') )
|
79
|
+
end test
|
80
|
+
|
81
|
+
test questions_with_only_numbers
|
82
|
+
assert_equal( 'Sure.' , hey('4?') )
|
83
|
+
end test
|
84
|
+
|
85
|
+
test shouting_with_special_characters
|
86
|
+
assert_equal( 'Whoa chill out!' , hey('ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!') )
|
87
|
+
end test
|
88
|
+
|
89
|
+
test shouting_with_no_exclamation_mark
|
90
|
+
assert_equal( 'Whoa chill out!' , hey('I HATE YOU') )
|
91
|
+
end test
|
92
|
+
|
93
|
+
test statement_containing_exclamation_mark
|
94
|
+
assert_equal( 'Whatever.' , hey('Ending with ? means a question.') )
|
95
|
+
end test
|
96
|
+
|
97
|
+
test prattling_on
|
98
|
+
assert_equal( 'Sure.' , hey('Wait! Hang on. Are you going to ge OK?') )
|
99
|
+
end test
|
100
|
+
|
101
|
+
test silence
|
102
|
+
assert_equal( 'Fine. Be that way!' , hey('') )
|
103
|
+
end test
|
104
|
+
|
105
|
+
test prolonged_silence
|
106
|
+
assert_equal( 'Fine. Be that way!' , hey(' ') )
|
107
|
+
end test
|
108
|
+
|
109
|
+
test on_multiple_line_questions
|
110
|
+
multi_line_string = ''//NEW_LINE('A')//'Does this cryogenic chamber make me look fat?'//NEW_LINE('A')//'no'
|
111
|
+
assert_equal( 'Whatever.' , hey(multi_line_string) )
|
112
|
+
end test
|
113
|
+
|
114
|
+
end test_suite
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module bob
|
2
|
+
contains
|
3
|
+
function is_uppercase(str)
|
4
|
+
logical :: is_uppercase
|
5
|
+
character(*) :: str
|
6
|
+
character :: chr
|
7
|
+
|
8
|
+
is_uppercase = .FALSE.
|
9
|
+
|
10
|
+
do i = 1,len(str)
|
11
|
+
chr = str(i:i)
|
12
|
+
if (chr >= 'a' .AND. chr <= 'z') then
|
13
|
+
is_uppercase = .FALSE.
|
14
|
+
return
|
15
|
+
else if (chr >= 'A' .AND. chr <= 'Z') then
|
16
|
+
is_uppercase = .TRUE.
|
17
|
+
end if
|
18
|
+
|
19
|
+
end do
|
20
|
+
end function is_uppercase
|
21
|
+
|
22
|
+
function is_question(str)
|
23
|
+
logical :: is_question
|
24
|
+
character(*) :: str
|
25
|
+
character :: chr
|
26
|
+
|
27
|
+
chr = str(len(str):len(str))
|
28
|
+
is_question = (chr .EQ. '?')
|
29
|
+
end function is_question
|
30
|
+
|
31
|
+
function is_blank(str)
|
32
|
+
logical :: is_blank
|
33
|
+
character(*) :: str
|
34
|
+
integer :: i
|
35
|
+
is_blank = .TRUE.
|
36
|
+
|
37
|
+
do i = 1,len(str)
|
38
|
+
if ( str(i:i) .NE. ' ' ) then
|
39
|
+
is_blank = .FALSE.
|
40
|
+
return
|
41
|
+
end if
|
42
|
+
end do
|
43
|
+
|
44
|
+
end function is_blank
|
45
|
+
|
46
|
+
function hey(statement)
|
47
|
+
character(100) :: hey
|
48
|
+
character(*) :: statement
|
49
|
+
|
50
|
+
if ( is_uppercase(statement) ) then
|
51
|
+
hey = 'Whoa chill out!'
|
52
|
+
else if ( is_question(statement) ) then
|
53
|
+
hey = 'Sure.'
|
54
|
+
else if ( is_blank(statement) ) then
|
55
|
+
hey = 'Fine. Be that way!'
|
56
|
+
else
|
57
|
+
hey = 'Whatever.'
|
58
|
+
end if
|
59
|
+
|
60
|
+
end function hey
|
61
|
+
end module bob
|