Skip to content

Commit a220fb4

Browse files
Curriculum change: track sequence (round 1) (#590)
* Reorder exercises according to Round 1 As part of the ongoing curriculum update, this re-orders the core exercises according to perceived difficulty. Most notably, this moves simple-cipher down -- re-orders the list loosly according to this: hello-world, gigasecond, leap, rna-transcription, bob, pangram, space-age, matrix, linked-list, grade-school, robot-name, pascals-triangle, simple-cipher, wordy, secret-handshake, list-ops Since it's a bit weird to introduce Date thát early, it's placed after leap --- for now. Furthermore this moves all the core exercises to the top and all the side exercises unlocked by these below that, in order. The bonus exercises (always unlocked) are at the bottom. * Demote prime-factors from core to side exercise Prime factors is a mathy exercise and as part of round one, mathy exercises should be demoted to side exercise. * Update simple-cipher difficulty This is an extensive exercise with four parts. Even though it's not a particularly difficult one to understand, it's actually difficult for beginners (< 4) to implement. Making this number higher makes sure it's no longer listed as easy. * Add helper binaries for printing the tree of exercises * Fix the script to include core exercises that don't unlock anything * nit: junction for the last item in the list * Re-assign prime-factors unlocks Assigning them one up, and give two exercises to "secret-handshake" which had none. * Reorder based on mentor-notes, examples and conversation - Moving bob down - Moving list-ops up - Moving space-age up (because of new exercise implementation) * Remove .gitattributes * Tweak difficulties * Update config.json orderering to match track: Core (matches config.json) of this track: - hello-world (1) - leap (1) - gigasecond (1) - rna-transcription (2) - space-age (2) - pangram (2) - matrix (3) - bob (4) - pascals-triangle (4) - linked-list (5) - grade-school (5) - list-ops (6) - robot-name (6) - simple-cipher (6) - wordy (7) - secret-handshake (6) core ---- ├─ hello-world │ └─ two-fer (1) │ ├─ leap │ ├─ reverse-string (2) │ ├─ triangle (3) │ └─ collatz-conjecture (3) │ ├─ gigasecond │ ├─ clock (5) │ └─ meetup (7) │ ├─ rna-transcription │ ├─ hamming (2) │ ├─ etl (2) │ ├─ scrabble-score (5) │ ├─ raindrops (2) │ ├─ allergies (6) │ └─ nucleotide-count (4) │ ├─ space-age │ ├─ word-count (1) │ ├─ grains (5) │ ├─ perfect-numbers (3) │ ├─ luhn (4) │ ├─ pythagorean-triplet (5) │ ├─ difference-of-squares (3) │ ├─ complex-numbers (4) │ ├─ prime-factors (4) │ └─ palindrome-products (7) │ ├─ pangram │ ├─ isogram (2) │ ├─ phone-number (3) │ ├─ anagram (1) │ ├─ acronym (2) │ ├─ series (3) │ ├─ largest-series-product (7) │ ├─ bracket-push (3) │ └─ high-scores (2) │ ├─ matrix │ ├─ forth (8) │ ├─ saddle-points (6) │ ├─ ocr-numbers (5) │ ├─ transpose (1) │ ├─ spiral-matrix (4) │ └─ rectangles (4) │ ├─ bob │ ├─ beer-song (5) │ ├─ food-chain (4) │ ├─ pig-latin (4) │ ├─ proverb (4) │ ├─ house (4) │ ├─ twelve-days (4) │ ├─ say (6) │ └─ isbn-verifier (4) │ ├─ pascals-triangle │ ├─ diamond (5) │ └─ rational-numbers (5) │ ├─ linked-list │ ├─ sublist (4) │ ├─ word-search (8) │ ├─ circular-buffer (8) │ ├─ binary-search (7) │ ├─ binary-search-tree (6) │ ├─ custom-set (6) │ └─ simple-linked-list (8) │ ├─ grade-school │ ├─ two-bucket (6) │ ├─ bowling (8) │ ├─ alphametics (7) │ ├─ connect (7) │ └─ variable-length-quantity (5) │ ├─ list-ops │ ├─ strain (4) │ ├─ accumulate (5) │ └─ flatten-array (5) │ ├─ robot-name │ ├─ sieve (5) │ └─ nth-prime (5) │ ├─ simple-cipher │ ├─ atbash-cipher (7) │ ├─ crypto-square (9) │ ├─ diffie-hellman (3) │ └─ rotational-cipher (2) │ ├─ wordy │ ├─ kindergarten-garden (7) │ └─ robot-simulator (5) │ ├─ secret-handshake │ ├─ sum-of-multiples (5) │ └─ change (8) bonus ---- - zipper (8) - darts (3) - run-length-encoding (2) - roman-numerals (3) - react (8) - queen-attack (8) - all-your-base (5) - minesweeper (7) - protein-translation (1) - armstrong-numbers (2) - trinary (4) - octal (4) - hexadecimal (4) - point-mutations (0) - binary (4)
1 parent 6fe1a0a commit a220fb4

File tree

3 files changed

+733
-661
lines changed

3 files changed

+733
-661
lines changed

bin/generate-config-tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env node
2+
3+
const { exercises } = require('../config.json')
4+
const TAG_CORE = '__core'
5+
const TAG_BONUS = '__bonus'
6+
7+
// node inter-opt exports
8+
exports.TAG_CORE = TAG_CORE
9+
exports.TAG_BONUS = TAG_BONUS
10+
11+
exports.tree = exercises.reduce((result, exercise) => {
12+
const tag = exercise.slug
13+
const item = {
14+
slug: tag,
15+
difficulty: exercise.difficulty,
16+
}
17+
18+
if (exercise.core) {
19+
const current = result[TAG_CORE] || []
20+
21+
if (result[tag]) {
22+
console.warn(`${tag} is not ordered correctly in config.json`)
23+
}
24+
25+
return {
26+
...result,
27+
__core: current.concat([item]),
28+
[tag]: result[tag] || []
29+
}
30+
}
31+
32+
const parent = exercise.unlocked_by || TAG_BONUS
33+
const current = result[parent] || []
34+
return { ...result, [parent]: current.concat([item]) }
35+
}, {})

bin/print-config-tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env node
2+
3+
const actions = require('./generate-config-tree')
4+
5+
const { tree, TAG_BONUS, TAG_CORE } = actions
6+
const { [TAG_BONUS]: __bonus, [TAG_CORE]: __core, ...track } = tree
7+
8+
function printLn(line) {
9+
process.stdout.write(`${line}\n`)
10+
}
11+
12+
function printList(items) {
13+
items.forEach(item => {
14+
printLn(`- ${item.slug} (${item.difficulty})`)
15+
})
16+
}
17+
18+
printLn('Core (matches config.json) of this track:')
19+
printList(__core)
20+
printLn('\n')
21+
printLn('core')
22+
printLn('----')
23+
Object.keys(track).forEach(slug => {
24+
printLn(`├─ ${slug}`)
25+
track[slug].forEach((side, index, self) => {
26+
junction = index === self.length - 1 ? '└─' : '├─'
27+
printLn(`│ ${junction} ${side.slug} (${side.difficulty})`)
28+
})
29+
printLn('│')
30+
})
31+
32+
printLn('bonus')
33+
printLn('----')
34+
printList(__bonus)

0 commit comments

Comments
 (0)