Skip to content

Commit

Permalink
failed attempt to teach use of length
Browse files Browse the repository at this point in the history
  • Loading branch information
lorepozo committed Mar 4, 2017
1 parent 3eb86ff commit cf4288d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
19 changes: 6 additions & 13 deletions curriculum/ec/course_02.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{ "grammar": [],
"tasks": [
{ "problems": [
{ "i":"test", "o":"1" },
{ "i":"tests", "o":"1" },
{ "i":"test two", "o":"2" },
{ "i":"yet another test", "o":"3" },
{ "i":"yet another test", "o":"3" }
], "name":"length"},
{ "problems": [
{ "i":"test", "o":"test" },
{ "i":"tests", "o":"tests" },
{ "i":"test two", "o":"two" },
{ "i":"yet another test", "o":"test" },
{ "i":"yet another test", "o":"test" }
], "name":"last"},
{ "i":"IaN", "o":"Ian" },
{ "i":"MELVIN", "o":"Melvin" },
{ "i":"miKe", "o":"Mike" },
{ "i":"StaNleY", "o":"Stanley" },
{ "i":"mary", "o":"Mary" }
], "name":"IaN -> Ian"},
{ "problems": [
{ "i":"My name is Richard", "o":"Richard" },
{ "i":"My name is John", "o":"John" },
Expand Down
25 changes: 18 additions & 7 deletions curriculum/ec/course_03.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{ "grammar": [],
{ "grammar": [
{"expr": "((S (K nth)) I)"},
{"expr": "((S (K -1)) ((S (K len)) I))"},
{"expr": "((S ((S (K nth)) I)) ((S (K -1)) ((S (K len)) I)))}"}
],
"tasks": [
{ "problems": [
{ "i":"IaN", "o":"Ian" },
{ "i":"MELVIN", "o":"Melvin" },
{ "i":"miKe", "o":"Mike" },
{ "i":"StaNleY", "o":"Stanley" },
{ "i":"mary", "o":"Mary" }
], "name":"IaN -> Ian"},
{ "i":"test", "o":"1" },
{ "i":"tests", "o":"1" },
{ "i":"test two", "o":"2" },
{ "i":"yet another test", "o":"3" },
{ "i":"yet another test", "o":"3" }
], "name":"length"},
{ "problems": [
{ "i":"test", "o":"test" },
{ "i":"tests", "o":"tests" },
{ "i":"test two", "o":"two" },
{ "i":"yet another test", "o":"test" },
{ "i":"yet another test", "o":"test" }
], "name":"last"},
{ "problems": [
{ "i":"test", "o":"Test" },
{ "i":"tests", "o":"Tests" },
Expand Down
3 changes: 2 additions & 1 deletion src/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub const ITER_MAX: u64 = 11;
const EC_GRAMMAR_INCLUDE_PROGS: bool = false;
const EC_ACCESS_FACTOR: f64 = 400f64;
const EC_MAX_IN_ARTIFACT: usize = 20;
static PRIMS_ARR: [&'static str; 26] = ["' '",
static PRIMS_ARR: [&'static str; 27] = ["' '",
"','",
"'.'",
"'<'",
Expand All @@ -39,6 +39,7 @@ static PRIMS_ARR: [&'static str; 26] = ["' '",
"lower",
"nth",
"string-of-char",
"string-of-int",
"substr",
"uncap",
"upper"];
Expand Down

0 comments on commit cf4288d

Please sign in to comment.