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
#too short to license, so public domain | |
from wavegen import wavegen | |
from sys import stdout | |
import random | |
def tochar(sample): | |
return chr(int(sample * 127 + 127)) | |
a = wavegen(440) | |
ash = wavegen(466.16) | |
b = wavegen(493.88) |
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
stmt = make_unique<ast::Print>(); | |
if (!SYNTAX_OPTIONAL_ADVANCE_KEYWORD(lex::KW_endl)) { | |
MUST_PARSE(parse_expr<CK_Regular>(r, lr, f, it, | |
stmt->as_a<ast::Print>().expr)); | |
} | |
if (SYNTAX_OPTIONAL_ADVANCE_KEYWORD(lex::KW_endl)) { | |
stmt->as_a<ast::Print>().endl = true; | |
} | |
SYNTAX_ADVANCE(lex::TK_Semicolon); | |
break; |
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
func smallOkay(x, z float64) (float64, float64, bool) { | |
for x < 0 { | |
if x > -1e-09 { | |
return x, z, true | |
} | |
z = z / x | |
x = x + 1 | |
} | |
for x < 2 { | |
if x < 1e-09 { |