Skip to content

Commit 6765ac7

Browse files
committed
introduction actually working now
1 parent 4e51dff commit 6765ac7

97 files changed

Lines changed: 446 additions & 442 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
solutions
21
.DS_Store
32
node_modules

menu.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"VARIABLES",
44
"STRINGS",
55
"STRING LENGTH",
6-
"STRING REPLACING",
6+
"REVISING STRINGS",
77
"NUMBERS",
88
"NUMBER TO STRING",
99
"FOR LOOP",

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"repository": {
66
"url": "git://github.com/sethvincent/javascripting.git"
77
},
8-
"author": "sethvincent"
8+
"author": "sethvincent",
99
"bin": {
10-
"example-adventure": "runner.js"
10+
"javascripting": "runner.js"
1111
},
1212
"dependencies": {
1313
"adventure": "^2.8.0",
1414
"adventure-verify": "^2.2.0",
15-
"cli-md": "^0.1.0"
15+
"cli-md": "^0.1.0",
16+
"example-adventure": "^1.0.1"
1617
}
1718
}

problems/array-filtering/index.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
var md = require('cli-md');
2-
var path = require('path');
31
var fs = require('fs');
2+
var path = require('path');
3+
var md = require('cli-md');
4+
var run = require('../../run-solution');
45

56
exports.problem = md(
6-
fs.readFileSync(path.join(__dirname, 'readme.md'), 'utf8')
7+
fs.readFileSync(path.join(__dirname, 'problem.md'), 'utf8')
8+
);
9+
10+
exports.solution = md(
11+
fs.readFileSync(path.join(__dirname, 'solution.md'), 'utf8')
712
);
813

914
exports.verify = function (args, cb) {
10-
if (/answer/.test(args)) {
11-
console.log('correct\n');
12-
cb(true);
13-
}
14-
else if (/otheranswer/i.test(args)) {
15-
console.log('almost\n');
16-
cb(false);
17-
}
18-
else {
19-
console.log('nope.\n');
20-
cb(false);
21-
}
15+
run(args[0], function (err, result) {
16+
if (/hello/.test(result)) cb(true);
17+
else cb(false);
18+
});
2219
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
#
4+
5+
---

problems/array-filtering/readme.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
---
2-
# TITLE
3-
4-
Some cool, brief instructions.
5-
6-
```
7-
var pizza = 'yummy';
8-
```
9-
---
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
#
4+
5+
---

problems/arrays/index.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
var md = require('cli-md');
2-
var path = require('path');
31
var fs = require('fs');
2+
var path = require('path');
3+
var md = require('cli-md');
4+
var run = require('../../run-solution');
45

56
exports.problem = md(
6-
fs.readFileSync(path.join(__dirname, 'readme.md'), 'utf8')
7+
fs.readFileSync(path.join(__dirname, 'problem.md'), 'utf8')
8+
);
9+
10+
exports.solution = md(
11+
fs.readFileSync(path.join(__dirname, 'solution.md'), 'utf8')
712
);
813

914
exports.verify = function (args, cb) {
10-
if (/answer/.test(args)) {
11-
console.log('correct\n');
12-
cb(true);
13-
}
14-
else if (/otheranswer/i.test(args)) {
15-
console.log('almost\n');
16-
cb(false);
17-
}
18-
else {
19-
console.log('nope.\n');
20-
cb(false);
21-
}
15+
run(args[0], function (err, result) {
16+
if (/hello/.test(result)) cb(true);
17+
else cb(false);
18+
});
2219
};

problems/arrays/problem.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
#
4+
5+
---

problems/arrays/readme.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
---
2-
# TITLE
3-
4-
Some cool, brief instructions.
5-
6-
```
7-
var pizza = 'yummy';
8-
```
9-
---

0 commit comments

Comments
 (0)