This file contains 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
/* test cases | |
assert is just a return a===b function. we all know this. these are strings. everyone relax. | |
assert("Jessica",format("JESSICA")); | |
assert("Jessica Kwok",format("JESSICA KWOK")); | |
assert("Jessica Kwok-Kwok",format("JESSICA KWOK-KWOK")); | |
assert("Jessica Kwok-$wok",format("JESSICA KWOK-$WOK"})); // this fails because i don't care enough | |
assert("Jessica Kwok-$$$$",format("JESSICA KWOK-$$$$")); | |
assert("J'essica",format("J'ESSICA")); // this fails too because am i a mind reader how should i know how you want your name formatted | |
*/ |
This file contains 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
merge xs [] = xs | |
merge [] xs = xs | |
merge (x:xs) (y:ys) | |
| x > y = y:(merge (x:xs) ys) | |
| otherwise = x:(merge xs (y:ys)) | |
mergesort [] = [] | |
mergesort [x] = [x] | |
mergesort xs = merge (mergesort (take n xs)) (mergesort (drop n xs)) | |
where n = (length xs) `div` 2 |
This file contains 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
/* | |
unicode drawings | |
*/ | |
void setup() { | |
size(400, 400); | |
} | |
String[] unicodez = { | |
" ", " ", "▩", "█", "█" |
This file contains 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
{- here's a comment | |
there's a comment | |
everywhere a comment comment | |
-} | |
-- more comment | |
main : Element | |
main = asText (findHypotenuse 3 4) | |
-- practice problem gave me sqrt as a builtin fn |
This file contains 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
plz console.loge with 'hello, world' |
This file contains 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
yo man sup |
This file contains 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 strict"; | |
/* | |
this is for simulating a 3 second request? response? a thing that takes 3 seconds to respond | |
*/ | |
function longRunningFunction1(onComplete) { | |
setTimeout(onComplete, 3000); // it takes a callback function that it will execute after 3 seconds | |
} | |
/* |
NewerOlder