This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
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
/** | |
* Immutable move item | |
*/ | |
const move = (arr, from, to) => { | |
const clone = [...arr]; | |
Array.prototype.splice.call(clone, to, 0, | |
Array.prototype.splice.call(clone, from, 1)[0] | |
); | |
return clone; | |
}; |
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
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
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
-- happy avril 14th :))))))))))))))))))))))))))))))))))))))) | |
do | |
let bars = 4 | |
key = "8" | |
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]" | |
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]" | |
d1 $ slow bars | |
$ stack [ | |
n (righthand + key + "<24 36>/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
{ | |
"$schema": "https://zed.dev/schema/themes/v0.1.0.json", | |
"name": "Vesper", | |
"author": "Rauno Freiberg", | |
"themes": [ | |
{ | |
"name": "Vesper", | |
"appearance": "dark", | |
"style": { | |
"border": "#101010", |