-
Notifications
You must be signed in to change notification settings - Fork 0
/
generation-000.js
38 lines (33 loc) · 838 Bytes
/
generation-000.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* GOAL:
* - Mandelbrot algorithm that outputs animated ascii to the console
* - the ascii has 90 columns and 30 rows (90 * 30 grid)
*/
/**
* CHANGELOG:
* Generation 0: implement base script
*/
import { generations, evolve } from "./base.js"; /* !!! */
import readline from "readline"; /* !!! */
const generation = 0;
console.log(`Generation ${generation} spawned`); /* !!! */
/* RULES:
* - Do not modify the code above these lines
* EXCEPTIONS
* - The CHANGELOG may be adjusted
* */
/* Please extend the function "output" to achieve the GOAL */
async function output() {
// Log the ascii code to the console
console.log(" 0-0 ");
}
await output();
if (generation < generations) {
try {
await evolve(generation); /* !!! */
} catch (error) {
console.error(error);
}
} else {
console.log("GOAL achieved!");
}