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
/* | |
this turns a number into a roman numeral | |
and a roman numeral into a number | |
*/ | |
var NUMBERZ = { | |
1: 'I', | |
5: 'V', | |
10: 'X', | |
50: 'L', |
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