This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN TESTS | |
>============================================================================ | |
fn foo(x,y) { | |
"A" println | |
\a,b{ print(a,b,"; ") }(x@,y@) | |
"B" println | |
} | |
foo([2,3,4,5],[9,8,7,6]) | |
"done" println |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
#[derive(Debug, Clone)] | |
pub struct Symbol { | |
name: String, | |
} | |
#[derive(Clone, Copy, Debug)] | |
pub struct SymbolID(usize); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mind_jewel_solver.cpp | |
// mind_jewel_solver | |
// | |
// Created by James McCartney on 10/14/21. | |
// | |
// A program to solve the Mind Jewel puzzle. | |
#include <vector> | |
#include <stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// fizzbuzz | |
// | |
// Created by James McCartney on 1/15/21. | |
// | |
#include <stdio.h> | |
void fizzbuzz(int n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import system | |
import math | |
type | |
VArray[T] = ref object of RootObj | |
len : int | |
VSeries[T] = ref object of VArray[T] | |
start, step: T |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\[ | |
\i[ | |
4 = bps | |
\ length attacks [attacks 1s length attacks - 0s $ muss] = randRhythm | |
6 rand2 78 + = root | |
7 0 12 nrandz sort 0 cons 12 add = scale | |
scale pr cr | |
bps 0 impulse = t | |
i 0 == i 6 > | = lite | |
[0 0 0 7 12] picks root 48 - + nnhz = bassFreqs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So how many cyclically and transpositionally unique three chord major or minor triad progressions are there? I wrote a program to find out. The answer is 296. If you allow for chord quality changes on the same root, then there are 340. | |
Transpose to all 12 keys: | |
0 C Db D | |
1 C Db D- | |
2 C Db Eb | |
3 C Db Eb- | |
4 C Db E | |
5 C Db E- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a chart of all 7 note pitch sets which have at least one mode which is a viable heptatonic scale. | |
A viable heptatonic scale is one where: | |
there are 7 distinct pitches. | |
the first degree is 0 semitones. | |
the second degree is 1, 2 or 3 semitones. | |
the third degree is 3 or 4 semitones. | |
the fourth degree is 5 or 6 semitones. |