trackler 2.2.1.126 → 2.2.1.127

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/nim/docs/INSTALLATION.md +48 -0
  4. data/tracks/nim/docs/RESOURCES.md +11 -0
  5. data/tracks/nim/docs/TESTS.md +8 -0
  6. data/tracks/r/exercises/allergies/test_allergies.R +2 -0
  7. data/tracks/r/exercises/anagram/test_anagram.R +2 -0
  8. data/tracks/r/exercises/beer-song/test_beer-song.R +2 -0
  9. data/tracks/r/exercises/bob/test_bob.R +2 -0
  10. data/tracks/r/exercises/collatz-conjecture/test_collatz-conjecture.R +2 -0
  11. data/tracks/r/exercises/crypto-square/test_crypto-square.R +2 -0
  12. data/tracks/r/exercises/diamond/test_diamond.R +2 -0
  13. data/tracks/r/exercises/difference-of-squares/test_difference-of-squares.R +2 -0
  14. data/tracks/r/exercises/grains/test_grains.R +2 -0
  15. data/tracks/r/exercises/hamming/test_hamming.R +2 -0
  16. data/tracks/r/exercises/hello-world/test_hello-world.R +2 -0
  17. data/tracks/r/exercises/isogram/test_isogram.R +2 -0
  18. data/tracks/r/exercises/largest-series-product/test_largest-series-product.R +2 -0
  19. data/tracks/r/exercises/leap/test_leap.R +2 -0
  20. data/tracks/r/exercises/luhn/test_luhn.R +2 -0
  21. data/tracks/r/exercises/nucleotide-count/test_nucleotide-count.R +2 -0
  22. data/tracks/r/exercises/pangram/test_pangram.R +2 -0
  23. data/tracks/r/exercises/pascals-triangle/test_pascals-triangle.R +2 -0
  24. data/tracks/r/exercises/perfect-numbers/test_perfect-numbers.R +2 -0
  25. data/tracks/r/exercises/phone-number/test_phone-number.R +2 -0
  26. data/tracks/r/exercises/prime-factors/test_prime-factors.R +2 -0
  27. data/tracks/r/exercises/raindrops/test_raindrops.R +2 -0
  28. data/tracks/r/exercises/rna-transcription/test_rna-transcription.R +2 -0
  29. data/tracks/r/exercises/rotational-cipher/test_rotational-cipher.R +2 -0
  30. data/tracks/r/exercises/scrabble-score/test_scrabble-score.R +2 -0
  31. data/tracks/r/exercises/secret-handshake/test_secret-handshake.R +2 -0
  32. data/tracks/r/exercises/sieve/test_sieve.R +2 -0
  33. data/tracks/r/exercises/space-age/test_space-age.R +2 -0
  34. data/tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R +2 -0
  35. data/tracks/r/exercises/tournament/test_tournament.R +2 -0
  36. data/tracks/r/exercises/triangle/test_triangle.R +2 -0
  37. data/tracks/r/exercises/word-count/test_word-count.R +2 -0
  38. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a98f4ad3ecc854d1aa0ee029e00a37de01bd3fe
4
- data.tar.gz: 77e1b5792ebf0eac854dfd8fdcda337953d5b828
3
+ metadata.gz: 1c49ff0f4fc0fdb3d965cd232637f435ca35ab37
4
+ data.tar.gz: 377d99ac24f28b2eccaf38d846a7fccee0c02ff4
5
5
  SHA512:
6
- metadata.gz: f7d1a1af48906fc6224d95bf859375259a427871eff3cb5682fca86cffd1a4abf5528253bf698294ef81b9b6c764e3170cee6d6d88e7beedabbb1d3fce01cd28
7
- data.tar.gz: 606efdfdc113047f900843d09c087bae2071f64d35a644aeb920b66a42acb89f6fdafee296d5f8d02763aea4de9781d9a6d04d37efb1bf4910ee266862040d6f
6
+ metadata.gz: 025522777be27dc58735865b505c19d5db34479d5da0ce0c6a2e46a7ce7bbe1456d7566ee584dd70da28b9d0ac420f0be67de4a0e9c88b0876f67030cec60352
7
+ data.tar.gz: f635a024dab851dfe600a43afbb448df96e964e7ab92073f0af0a9288fb77bb0963891a8a49e5a1b2fb296146e4f106a7ab4e04457f5ca5634dd69f7aff9d953
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.126"
2
+ VERSION = "2.2.1.127"
3
3
  end
@@ -0,0 +1,48 @@
1
+ ## Installing Nim
2
+
3
+ ### Homebrew on Mac OS X
4
+
5
+ ```bash
6
+ brew update
7
+ brew install nim
8
+ ```
9
+
10
+ ### Arch Linux
11
+
12
+ ```bash
13
+ pacman -S nim
14
+ ```
15
+
16
+ ### Void Linux
17
+
18
+ ```bash
19
+ xbps-install -S nim
20
+ ```
21
+
22
+ ### FreeBSD
23
+
24
+ ```bash
25
+ pkg install nim
26
+ ```
27
+
28
+ ## choosenim
29
+ If you are looking for a tool that is similar `rustup` and `pyenv`, [choosenim](https://github.com/dom96/choosenim) can help.
30
+
31
+ choosenim installs the Nim programming language from official downloads and sources, enabling you to easily switch between stable and development compilers.
32
+
33
+ ### Unix
34
+
35
+ ```bash
36
+ curl https://nim-lang.org/choosenim/init.sh -sSf | sh
37
+ ```
38
+
39
+ ### Windows
40
+
41
+ Download the latest Windows version from the [releases](https://github.com/dom96/choosenim/releases) page.
42
+
43
+ Execute the self-extracting archive, or extract the zip archive and run the runme.bat script. Follow any on screen prompts and enjoy your new Nim and choosenim installation.
44
+
45
+ ## Other Platforms
46
+
47
+ Instructions for installing Nim can be found in the [Nim installation](https://nim-lang.org/install.html)
48
+
@@ -0,0 +1,11 @@
1
+ ## Resources for Learning Nim
2
+
3
+ - [The Nim Tutorial](https://nim-lang.org/docs/tut1.html)
4
+ - [Nim by Example](https://nim-by-example.github.io/getting_started/)
5
+ - [Learn X in Y minutes for Nim](https://learnxinyminutes.com/docs/nim/)
6
+ - [Nim: An Overview Video by Andreas Rumpf from OSCON 2015](https://www.youtube.com/watch?v=4rJEBs_Nnaw)
7
+ - [Standard Library Documentation](https://nim-lang.org/docs/lib.html)
8
+ - [Nim in Action](https://www.manning.com/books/nim-in-action)
9
+ - [Nim Community Page](https://nim-lang.org/community.html)
10
+ - [Nim Subreddit](https://www.reddit.com/r/nim/)
11
+
@@ -0,0 +1,8 @@
1
+ ## Running tests
2
+
3
+ To compile and run the tests, just run the following in your exercise directory:
4
+ ```bash
5
+ $ nim c -r exercise-name_test.nim
6
+ ```
7
+
8
+ (Replace `exercise-name` with the name of the exercise directory)
@@ -1,6 +1,8 @@
1
1
  source("./allergies.R")
2
2
  library(testthat)
3
3
 
4
+ context("allergies")
5
+
4
6
  test_that("no allergies means not allergic", {
5
7
  x <- allergy(0)
6
8
  expect_false(allergic_to(x, "peanuts"))
@@ -1,6 +1,8 @@
1
1
  source("./anagram.R")
2
2
  library(testthat)
3
3
 
4
+ context("anagram")
5
+
4
6
  test_that("no matches", {
5
7
  subject <- "diaper"
6
8
  candidates <- c("hello", "world", "zombies", "pants")
@@ -1,6 +1,8 @@
1
1
  source("./beer-song.R")
2
2
  library(testthat)
3
3
 
4
+ context("beer song")
5
+
4
6
  test_that("first generic verse", {
5
7
  expect_equal(
6
8
  verse(99),
@@ -1,6 +1,8 @@
1
1
  source("./bob.R")
2
2
  library(testthat)
3
3
 
4
+ context("bob")
5
+
4
6
  test_that("stating something", {
5
7
  input <- "Tom-ay-to, tom-aaaah-to."
6
8
  expect_equal(bob(input),
@@ -1,6 +1,8 @@
1
1
  source("./collatz-conjecture.R")
2
2
  library(testthat)
3
3
 
4
+ context("collatz conjecture")
5
+
4
6
  test_that("Input of 1 results in 0 steps", {
5
7
  expect_equal(collatz_step_counter(1), 0)
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./crypto-square.R")
2
2
  library(testthat)
3
3
 
4
+ context("crypto square")
5
+
4
6
  test_that("Lowercase", {
5
7
  expect_equal(normalized_plaintext("Hello"), "hello")
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./diamond.R")
2
2
  library(testthat)
3
3
 
4
+ context("diamond")
5
+
4
6
  test_that("Degenerate case with a single 'A' row", {
5
7
  expect_equal(diamond("A"), "A")
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./difference-of-squares.R")
2
2
  library(testthat)
3
3
 
4
+ context("difference of squares")
5
+
4
6
  test_that("difference of squares 0", {
5
7
  input <- 0
6
8
  expect_equal(difference_of_squares(input), 0)
@@ -1,6 +1,8 @@
1
1
  source("./grains.R")
2
2
  library(testthat)
3
3
 
4
+ context("grains")
5
+
4
6
  test_that("Case 1", {
5
7
  expect_equal(square(1), 1)
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./hamming.R")
2
2
  library(testthat)
3
3
 
4
+ context("hamming")
5
+
4
6
  test_that("identical strands", {
5
7
  strand1 <- "A"
6
8
  strand2 <- "A"
@@ -1,6 +1,8 @@
1
1
  source("./hello-world.R")
2
2
  library(testthat)
3
3
 
4
+ context("hello world")
5
+
4
6
  test_that("no name", {
5
7
  expect_equal(hello_world(), "Hello, World!")
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./isogram.R")
2
2
  library(testthat)
3
3
 
4
+ context("isogram")
5
+
4
6
  test_that("empty string", {
5
7
  word <- ""
6
8
  expect_equal(is_isogram(word), TRUE)
@@ -1,6 +1,8 @@
1
1
  source("./largest-series-product.R")
2
2
  library(testthat)
3
3
 
4
+ context("largest series product")
5
+
4
6
  test_that("finds the largest product if span equals length", {
5
7
  digits <- "29"
6
8
  span <- 2
@@ -1,6 +1,8 @@
1
1
  source("./leap.R")
2
2
  library(testthat)
3
3
 
4
+ context("leap")
5
+
4
6
  test_that("year not divisible by 4: common year", {
5
7
  year <- 2015
6
8
  expect_equal(leap(year), FALSE)
@@ -1,6 +1,8 @@
1
1
  source("./luhn.R")
2
2
  library(testthat)
3
3
 
4
+ context("luhn")
5
+
4
6
  test_that("single digit strings can not be valid", {
5
7
  input <- "1"
6
8
  expect_equal(is_valid(input), FALSE)
@@ -1,6 +1,8 @@
1
1
  source("./nucleotide-count.R")
2
2
  library(testthat)
3
3
 
4
+ context("nucleotide count")
5
+
4
6
  # When comparing lists, all.equal expects the objects to be in the same order
5
7
  # This expectation instead checks that a) the set of names are the same and
6
8
  # b) each named object is equal
@@ -1,6 +1,8 @@
1
1
  source("./pangram.R")
2
2
  library(testthat)
3
3
 
4
+ context("pangram")
5
+
4
6
  test_that("sentence empty", {
5
7
  expect_false(is_pangram(""))
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./pascals-triangle.R")
2
2
  library(testthat)
3
3
 
4
+ context("pascals triangle")
5
+
4
6
  test_that("zero rows", {
5
7
  expect_equal(pascals_triangle(0), list())
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./perfect-numbers.R")
2
2
  library(testthat)
3
3
 
4
+ context("perfect numbers")
5
+
4
6
  test_that("Smallest perfect number is classified correctly", {
5
7
  n <- 6
6
8
  expect_equal(number_type(n), "perfect")
@@ -1,6 +1,8 @@
1
1
  source("./phone-number.R")
2
2
  library(testthat)
3
3
 
4
+ context("phone number")
5
+
4
6
  test_that("cleans the number", {
5
7
  expect_equal(parse_phone_number("(223) 456-7890"), "2234567890")
6
8
  })
@@ -3,6 +3,8 @@ suppressPackageStartupMessages({
3
3
  library(testthat)
4
4
  })
5
5
 
6
+ context("prime factors")
7
+
6
8
  test_that("no factors", {
7
9
  number <- 1
8
10
  expect_equal(prime_factors(number),
@@ -1,6 +1,8 @@
1
1
  source("./raindrops.R")
2
2
  library(testthat)
3
3
 
4
+ context("raindrops")
5
+
4
6
  test_that("the sound for 1 is 1", {
5
7
  number <- 1
6
8
  expect_equal(raindrops(number), "1")
@@ -1,6 +1,8 @@
1
1
  source("./rna-transcription.R")
2
2
  library(testthat)
3
3
 
4
+ context("rna transcription")
5
+
4
6
  test_that("RNA complement of cytosine is guanine", {
5
7
  dna <- "C"
6
8
  expect_equal(to_rna(dna), "G")
@@ -1,6 +1,8 @@
1
1
  source("./rotational-cipher.R")
2
2
  library(testthat)
3
3
 
4
+ context("rotational cipher")
5
+
4
6
  test_that("rotate a by 1", {
5
7
  text <- "a"
6
8
  key <- 1
@@ -1,6 +1,8 @@
1
1
  source("./scrabble-score.R")
2
2
  library(testthat)
3
3
 
4
+ context("scrabble score")
5
+
4
6
  test_that("lowercase letter", {
5
7
  input <- "a"
6
8
  expect_equal(scrabble_score(input), 1)
@@ -1,6 +1,8 @@
1
1
  source("./secret-handshake.R")
2
2
  library(testthat)
3
3
 
4
+ context("secret handshake")
5
+
4
6
  test_that("wink for 1", {
5
7
  expect_equal(handshake(1), c("wink"))
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./sieve.R")
2
2
  library(testthat)
3
3
 
4
+ context("sieve")
5
+
4
6
  test_that("no primes under two", {
5
7
  expect_equal(sieve(1), c())
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./space-age.R")
2
2
  library(testthat)
3
3
 
4
+ context("space age")
5
+
4
6
  test_that("Age on Earth", {
5
7
  seconds <- 1000000000
6
8
  expect_equal(space_age(seconds, "earth"), 31.69)
@@ -1,6 +1,8 @@
1
1
  source("./sum-of-multiples.R")
2
2
  library(testthat)
3
3
 
4
+ context("sum of multiples")
5
+
4
6
  test_that("Case 1", {
5
7
  expect_equal(sum_of_multiples(c(3, 5), 1), 0)
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./tournament.R")
2
2
  library(testthat)
3
3
 
4
+ context("tournament")
5
+
4
6
  options(stringsAsFactors = FALSE)
5
7
 
6
8
  test_that("typical input", {
@@ -1,6 +1,8 @@
1
1
  source("./triangle.R")
2
2
  library(testthat)
3
3
 
4
+ context("triangle")
5
+
4
6
  test_that("true if all sides are equal", {
5
7
  expect_is(triangle(2, 2, 2), "equilateral")
6
8
  })
@@ -1,6 +1,8 @@
1
1
  source("./word-count.R")
2
2
  library(testthat)
3
3
 
4
+ context("word count")
5
+
4
6
  # When comparing lists, all.equal expects the objects to be in the same order
5
7
  # This expectation instead checks that a) the set of names are the same and
6
8
  # b) each named object is equal
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1.126
4
+ version: 2.2.1.127
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-01 00:00:00.000000000 Z
11
+ date: 2018-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -9750,7 +9750,10 @@ files:
9750
9750
  - tracks/nim/config.json
9751
9751
  - tracks/nim/config/exercise_readme.go.tmpl
9752
9752
  - tracks/nim/config/maintainers.json
9753
+ - tracks/nim/docs/INSTALLATION.md
9754
+ - tracks/nim/docs/RESOURCES.md
9753
9755
  - tracks/nim/docs/SNIPPET.txt
9756
+ - tracks/nim/docs/TESTS.md
9754
9757
  - tracks/nim/exercises/anagram/README.md
9755
9758
  - tracks/nim/exercises/anagram/anagram_test.nim
9756
9759
  - tracks/nim/exercises/anagram/example.nim