trackler 2.0.8.24 → 2.0.8.26
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/tracks/c/config.json +9 -0
- data/tracks/c/exercises/nucleotide-count/makefile +15 -0
- data/tracks/c/exercises/nucleotide-count/src/example.c +43 -0
- data/tracks/c/exercises/nucleotide-count/src/example.h +6 -0
- data/tracks/c/exercises/nucleotide-count/test/test_nucleotide_count.c +58 -0
- data/tracks/c/exercises/nucleotide-count/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/nucleotide-count/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/nucleotide-count/test/vendor/unity_internals.h +701 -0
- data/tracks/ceylon/README.md +2 -2
- data/tracks/csharp/.gitattributes +11 -0
- data/tracks/csharp/appveyor.yml +1 -4
- data/tracks/csharp/exercises/acronym/AcronymTest.cs +1 -1
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.cs +8 -3
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +76 -0
- data/tracks/csharp/exercises/atbash-cipher/Example.cs +22 -23
- data/tracks/csharp/exercises/isogram/Example.cs +2 -2
- data/tracks/csharp/exercises/isogram/IsogramTest.cs +47 -15
- data/tracks/csharp/exercises/nth-prime/Example.cs +4 -1
- data/tracks/csharp/exercises/nth-prime/NthPrime.cs +1 -1
- data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +29 -15
- data/tracks/csharp/exercises/perfect-numbers/Example.cs +14 -16
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.cs +2 -2
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +78 -26
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +69 -24
- data/tracks/csharp/exercises/raindrops/Example.cs +1 -1
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +93 -31
- data/tracks/csharp/exercises/roman-numerals/HINTS.md +2 -0
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +106 -23
- data/tracks/csharp/exercises/word-search/HINTS.md +6 -0
- data/tracks/csharp/generators/{TestClass.cs → Classes/TestClass.cs} +2 -1
- data/tracks/csharp/generators/{TestClassNameTransformer.cs → Classes/TestClassNameTransformer.cs} +1 -1
- data/tracks/csharp/generators/{TestClassRenderer.cs → Classes/TestClassRenderer.cs} +2 -1
- data/tracks/csharp/generators/Classes/TestedClassNameTransformer.cs +9 -0
- data/tracks/csharp/generators/{CanonicalData.cs → Data/CanonicalData.cs} +1 -1
- data/tracks/csharp/generators/{CanonicalDataCase.cs → Data/CanonicalDataCase.cs} +3 -3
- data/tracks/csharp/generators/{CanonicalDataCaseJsonConverter.cs → Data/CanonicalDataCaseJsonConverter.cs} +1 -1
- data/tracks/csharp/generators/{CanonicalDataCasesJsonConverter.cs → Data/CanonicalDataCasesJsonConverter.cs} +2 -2
- data/tracks/csharp/generators/{CanonicalDataParser.cs → Data/CanonicalDataParser.cs} +5 -5
- data/tracks/csharp/generators/{ExerciseCollection.cs → Data/ExerciseCollection.cs} +3 -3
- data/tracks/csharp/generators/Exercises/AcronymExercise.cs +20 -0
- data/tracks/csharp/generators/Exercises/AtbashCipherExercise.cs +20 -0
- data/tracks/csharp/generators/Exercises/BooleanExercise.cs +14 -0
- data/tracks/csharp/generators/Exercises/EqualityExercise.cs +14 -0
- data/tracks/csharp/generators/Exercises/Exercise.cs +59 -4
- data/tracks/csharp/generators/Exercises/IsogramExercise.cs +9 -0
- data/tracks/csharp/generators/Exercises/LeapExercise.cs +1 -4
- data/tracks/csharp/generators/Exercises/NthPrimeExercise.cs +25 -0
- data/tracks/csharp/generators/Exercises/PerfectNumbersExercise.cs +29 -0
- data/tracks/csharp/generators/Exercises/PigLatinExercise.cs +9 -0
- data/tracks/csharp/generators/Exercises/RaindropsExercise.cs +20 -0
- data/tracks/csharp/generators/Exercises/RomanNumeralsExercise.cs +30 -0
- data/tracks/csharp/generators/Helpers/StringExtensions.cs +8 -0
- data/tracks/csharp/generators/{To.cs → Helpers/To.cs} +4 -1
- data/tracks/csharp/generators/Methods/BooleanTestMethodGenerator.cs +32 -0
- data/tracks/csharp/generators/Methods/EqualityTestMethodGenerator.cs +25 -0
- data/tracks/csharp/generators/Methods/ExceptionTestMethodGenerator.cs +30 -0
- data/tracks/csharp/generators/{TestMethod.cs → Methods/TestMethod.cs} +6 -3
- data/tracks/csharp/generators/Methods/TestMethodData.cs +12 -0
- data/tracks/csharp/generators/Methods/TestMethodGenerator.cs +64 -0
- data/tracks/csharp/generators/Methods/TestMethodNameTransformer.cs +23 -0
- data/tracks/csharp/generators/Methods/TestMethodOptions.cs +13 -0
- data/tracks/csharp/generators/{TestMethodRenderer.cs → Methods/TestMethodRenderer.cs} +1 -1
- data/tracks/csharp/generators/{TestedMethodNameTransformer.cs → Methods/TestedMethodNameTransformer.cs} +1 -1
- data/tracks/csharp/generators/Methods/TestedMethodType.cs +9 -0
- data/tracks/csharp/generators/Program.cs +2 -0
- data/tracks/elixir/config.json +7 -0
- data/tracks/elixir/exercises/diffie-hellman/HINTS.md +10 -0
- data/tracks/elixir/exercises/diffie-hellman/diffie_hellman.exs +61 -0
- data/tracks/elixir/exercises/diffie-hellman/diffie_hellman_test.exs +99 -0
- data/tracks/elixir/exercises/diffie-hellman/example.exs +64 -0
- data/tracks/haskell/exercises/pov/src/POV.hs +2 -2
- data/tracks/haskell/exercises/pythagorean-triplet/src/Triplet.hs +6 -3
- data/tracks/haskell/exercises/queen-attack/src/Queens.hs +1 -1
- data/tracks/haskell/exercises/raindrops/src/Raindrops.hs +2 -1
- data/tracks/haskell/exercises/robot-name/src/Robot.hs +2 -2
- data/tracks/haskell/exercises/robot-simulator/src/Robot.hs +6 -6
- data/tracks/haskell/exercises/roman-numerals/src/Roman.hs +2 -1
- data/tracks/haskell/exercises/run-length-encoding/src/RunLength.hs +2 -2
- data/tracks/haskell/exercises/saddle-points/src/Matrix.hs +2 -1
- data/tracks/haskell/exercises/say/src/Say.hs +2 -1
- data/tracks/haskell/exercises/scrabble-score/src/Scrabble.hs +4 -2
- data/tracks/haskell/exercises/secret-handshake/src/SecretHandshake.hs +1 -1
- data/tracks/haskell/exercises/sgf-parsing/src/Sgf.hs +1 -1
- data/tracks/java/exercises/acronym/src/example/java/Acronym.java +11 -1
- data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +8 -9
- data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +8 -2
- data/tracks/java/exercises/luhn/src/test/java/LuhnValidatorTest.java +20 -13
- data/tracks/java/exercises/robot-name/src/test/java/RobotTest.java +6 -1
- data/tracks/javascript/README.md +1 -1
- data/tracks/javascript/docs/TESTS.md +9 -1
- data/tracks/kotlin/exercises/luhn/src/example/kotlin/Luhn.kt +18 -26
- data/tracks/kotlin/exercises/luhn/src/test/kotlin/LuhnTest.kt +40 -38
- data/tracks/php/README.md +1 -1
- data/tracks/php/config.json +5 -0
- data/tracks/php/exercises/perfect-numbers/example.php +23 -0
- data/tracks/php/exercises/perfect-numbers/perfect-numbers_test.php +99 -0
- data/tracks/purescript/.travis.yml +1 -0
- data/tracks/purescript/bin/test.sh +33 -8
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/meetup/bower.json +17 -0
- data/tracks/purescript/exercises/meetup/examples/src/Meetup.purs +37 -0
- data/tracks/purescript/exercises/meetup/src/Meetup.purs +11 -0
- data/tracks/purescript/exercises/meetup/test/Main.purs +395 -0
- data/tracks/python/README.md +7 -6
- data/tracks/python/docs/TOOLS.md +3 -3
- data/tracks/python/exercises/bracket-push/bracket_push_test.py +32 -15
- data/tracks/python/exercises/hamming/hamming_test.py +2 -0
- data/tracks/python/exercises/luhn/luhn_test.py +2 -0
- data/tracks/python/test/check-exercises.py +7 -1
- metadata +56 -20
- data/tracks/csharp/exercises/atbash-cipher/AtbashTest.cs +0 -17
- data/tracks/csharp/generators/BooleanTestMethod.cs +0 -36
- data/tracks/csharp/generators/TestMethodNameTransformer.cs +0 -11
- data/tracks/csharp/generators/TestedClassNameTransformer.cs +0 -11
- data/tracks/java/exercises/allergies/src/main/java/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faebef83368ee490d149ffbaefd180c65a4a0d3a
|
4
|
+
data.tar.gz: 507b81bff22dd1cabe62e51fd86ea00fd628203f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a37814a2b504762359eafc95f1fb91d7b3ca0015875fa51708fe13c3e1d277a1b781a6d391ae3e1dee4d6d19db457e337a5817a5ba79306fd3c374dacad3c72c
|
7
|
+
data.tar.gz: 02b51347b6e00fd95e17695f9f24fe78e9cde2a28a12d77a511b67c9960299aa2bb1e26f323e9ae22e8be235901f3bb73a4687c6b58c34777f2d169132d56616
|
data/lib/trackler/version.rb
CHANGED
data/tracks/c/config.json
CHANGED
@@ -206,6 +206,15 @@
|
|
206
206
|
"time functions",
|
207
207
|
"preprocessor (x-macros in test)"
|
208
208
|
]
|
209
|
+
}, {
|
210
|
+
"difficulty": 2,
|
211
|
+
"slug": "nucleotide-count",
|
212
|
+
"topics": [
|
213
|
+
"control-flow (loops, switch, if-statements)",
|
214
|
+
"strings",
|
215
|
+
"text formatting",
|
216
|
+
"memory management"
|
217
|
+
]
|
209
218
|
}, {
|
210
219
|
"difficulty": 2,
|
211
220
|
"slug": "robot-simulator",
|
@@ -0,0 +1,15 @@
|
|
1
|
+
CFLAGS = -std=c99
|
2
|
+
CFLAGS += -Wall
|
3
|
+
CFLAGS += -Wextra
|
4
|
+
CFLAGS += -pedantic
|
5
|
+
CFLAGS += -Werror
|
6
|
+
|
7
|
+
test: tests.out
|
8
|
+
@./tests.out
|
9
|
+
|
10
|
+
clean:
|
11
|
+
rm -f *.o *.out
|
12
|
+
|
13
|
+
tests.out: src/nucleotide_count.c src/nucleotide_count.h test/test_nucleotide_count.c
|
14
|
+
@echo Compiling $@
|
15
|
+
@cc $(CFLAGS) src/nucleotide_count.c test/vendor/unity.c test/test_nucleotide_count.c -o tests.out
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#include <stdlib.h>
|
2
|
+
#include <stdio.h>
|
3
|
+
#include <string.h>
|
4
|
+
#include <stdbool.h>
|
5
|
+
#include "nucleotide_count.h"
|
6
|
+
|
7
|
+
char *count(const char *dna_strand)
|
8
|
+
{
|
9
|
+
bool invalid_char = false;
|
10
|
+
size_t index;
|
11
|
+
size_t nucleotide_A_count = 0;
|
12
|
+
size_t nucleotide_C_count = 0;
|
13
|
+
size_t nucleotide_G_count = 0;
|
14
|
+
size_t nucleotide_T_count = 0;
|
15
|
+
char *count_results = calloc(1, 50);
|
16
|
+
|
17
|
+
for (index = 0; (index < strlen(dna_strand)) && (invalid_char == false);
|
18
|
+
index++) {
|
19
|
+
switch (dna_strand[index]) {
|
20
|
+
case 'A':
|
21
|
+
nucleotide_A_count++;
|
22
|
+
break;
|
23
|
+
case 'C':
|
24
|
+
nucleotide_C_count++;
|
25
|
+
break;
|
26
|
+
case 'G':
|
27
|
+
nucleotide_G_count++;
|
28
|
+
break;
|
29
|
+
case 'T':
|
30
|
+
nucleotide_T_count++;
|
31
|
+
break;
|
32
|
+
default:
|
33
|
+
invalid_char = true;
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
if (!invalid_char) {
|
39
|
+
sprintf(count_results, "A:%zd C:%zd G:%zd T:%zd", nucleotide_A_count,
|
40
|
+
nucleotide_C_count, nucleotide_G_count, nucleotide_T_count);
|
41
|
+
}
|
42
|
+
return count_results;
|
43
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#include "vendor/unity.h"
|
2
|
+
#include "../src/nucleotide_count.h"
|
3
|
+
#include <stdlib.h>
|
4
|
+
#include <string.h>
|
5
|
+
|
6
|
+
void test_strand_count(const char *dna_strand, const char *expected)
|
7
|
+
{
|
8
|
+
char *actual_count = count(dna_strand);
|
9
|
+
|
10
|
+
TEST_ASSERT_TRUE(strcmp(actual_count, expected) == 0);
|
11
|
+
free(actual_count);
|
12
|
+
}
|
13
|
+
|
14
|
+
void test_empty_strand(void)
|
15
|
+
{
|
16
|
+
const char *dna_strand = "";
|
17
|
+
const char *expected = "A:0 C:0 G:0 T:0";
|
18
|
+
|
19
|
+
test_strand_count(dna_strand, expected);
|
20
|
+
}
|
21
|
+
|
22
|
+
void test_repeated_nucleotide(void)
|
23
|
+
{
|
24
|
+
const char *dna_strand = "GGGGGGG";
|
25
|
+
const char *expected = "A:0 C:0 G:7 T:0";
|
26
|
+
|
27
|
+
test_strand_count(dna_strand, expected);
|
28
|
+
}
|
29
|
+
|
30
|
+
void test_multiple_nucleotides(void)
|
31
|
+
{
|
32
|
+
const char *dna_strand =
|
33
|
+
"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC";
|
34
|
+
const char *expected = "A:20 C:12 G:17 T:21";
|
35
|
+
|
36
|
+
test_strand_count(dna_strand, expected);
|
37
|
+
}
|
38
|
+
|
39
|
+
void test_invalid_nucleotide(void)
|
40
|
+
{
|
41
|
+
const char *dna_strand = "AGXXACT";
|
42
|
+
const char *expected = "";
|
43
|
+
|
44
|
+
test_strand_count(dna_strand, expected);
|
45
|
+
}
|
46
|
+
|
47
|
+
int main(void)
|
48
|
+
{
|
49
|
+
UnityBegin("test/test_rna_transcription.c");
|
50
|
+
|
51
|
+
RUN_TEST(test_empty_strand);
|
52
|
+
RUN_TEST(test_repeated_nucleotide);
|
53
|
+
RUN_TEST(test_multiple_nucleotides);
|
54
|
+
RUN_TEST(test_invalid_nucleotide);
|
55
|
+
|
56
|
+
UnityEnd();
|
57
|
+
return 0;
|
58
|
+
}
|