Skip to content

Commit 29b522f

Browse files
committed
first
0 parents  commit 29b522f

27 files changed

Lines changed: 411 additions & 0 deletions

File tree

.gitignore

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

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "javascripting",
3+
"description": "Learn javascript on the command line.",
4+
"version": "1.0.0",
5+
"repository": {
6+
"url": "git://github.com/sethvincent/javascripting.git"
7+
},
8+
"author": "sethvincent"
9+
"bin": {
10+
"example-adventure": "runner.js"
11+
},
12+
"dependencies": {
13+
"adventure": "^2.8.0",
14+
"adventure-verify": "^2.2.0",
15+
"cli-md": "^0.1.0"
16+
}
17+
}

problems/array-methods/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var md = require('cli-md');
2+
var path = require('path');
3+
var fs = require('fs');
4+
5+
exports.problem = md(
6+
fs.readFileSync(path.join(__dirname, 'readme.md'), 'utf8')
7+
);
8+
9+
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+
}
22+
};

problems/array-methods/readme.md

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

problems/arrays/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var md = require('cli-md');
2+
var path = require('path');
3+
var fs = require('fs');
4+
5+
exports.problem = md(
6+
fs.readFileSync(path.join(__dirname, 'readme.md'), 'utf8')
7+
);
8+
9+
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+
}
22+
};

problems/arrays/readme.md

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

problems/functions/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var md = require('cli-md');
2+
var path = require('path');
3+
var fs = require('fs');
4+
5+
exports.problem = md(
6+
fs.readFileSync(path.join(__dirname, 'readme.md'), 'utf8')
7+
);
8+
9+
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+
}
22+
};

problems/functions/readme.md

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

problems/intro/index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var md = require('cli-md');
2+
var path = require('path');
3+
var fs = require('fs');
4+
5+
exports.problem = md(
6+
fs.readFileSync(path.join(__dirname, 'readme.md'), 'utf8')
7+
);
8+
9+
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+
}
22+
};

problems/intro/readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# JAVASCRIPTING
3+
4+
Navigate the menu with the arrow keys. Choose a level with the return key.
5+
6+
To see all `javascripting` commands, choose the `HELP` option from the menu.

0 commit comments

Comments
 (0)