Compare commits

...

2 Commits

Author SHA1 Message Date
gauthiier
ca494f3c0f lover-lette [lfs] 2023-01-15 11:14:11 +01:00
gauthiier
64f16c7f15 2.Ghost 2023-01-15 11:13:49 +01:00
2 changed files with 34 additions and 0 deletions

31
2.Ghost-Writing.md Normal file
View File

@ -0,0 +1,31 @@
# Ghost Writing: Text, Arrays, Randomness
```javascript
// Array + Index!
var NAMES = ["David", "Karin", "Sigrid", "Nanna", "Laura", "Maaike"];
var INDEX = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
}
function keyTyped() {
if(key == 'x') {
print("Hi " + NAMES[0] + "!");
}
}
// Reference: https://p5js.org/reference/
```
```javascript
["David", "Karin", "Sigrid", "Nanna", "Laura", "Maaikke"] <--- Array (var NAMES)
| | | | | |
0 1 2 3 4 5 <--- indices (var INDEX)
```

BIN
img/love-letter.png (Stored with Git LFS) Normal file

Binary file not shown.