forked from dzaima/ArtAttack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
formic.htm
93 lines (83 loc) · 2.15 KB
/
formic.htm
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="content-security-policy" content="
base-uri 'self';
default-src 'none';
child-src blob:;
frame-src blob:;
connect-src https://api.stackexchange.com;
script-src 'self' 'unsafe-inline' blob:;
worker-src blob:;
style-src 'self';
img-src 'self';
form-action 'none';
">
<!-- these properties are read by the engine to configure the game -->
<title>Formic Functions</title>
<link rel="icon" href="favicons/formic.png">
<meta name="stack-exchange-site" content="codegolf">
<meta name="stack-exchange-qid" content="135102">
<meta name="team-type" content="free_for_all">
<meta name="team-type-args" content='{}'>
<meta name="tournament-type" content="brawl">
<meta name="tournament-type-args" content='{}'>
<meta name="match-type" content="brawl">
<meta name="match-type-args" content='{
"count": 50,
"teamLimit": 16,
"teamShuffle": "random"
}'>
<meta name="game-type" content="formic">
<meta name="game-config" content='{
"width": 2500,
"height": 1000,
"foodRatio": 0.001,
"maxFrame": 30000
}'>
<meta name="play-config" content='{
"delay": 0,
"speed": 50
}'>
<meta name="play-screensaver-config" content='{
"delay": 50,
"speed": 25,
"swapDelay": 5000
}'>
<meta name="display-config" content='{
"scale": 0.5,
"colourscheme": "muted",
"highlightRedrawRegions": false,
"view3D": false,
"queenMarkerType": "ring",
"workerMarkerType": "",
"nextMoverMarkerType": "",
"foodMarkerType": "",
"wireframe": false
}'>
<meta name="default-code" content="/*
* Input:
* view - array of 9 objects, each containing:
* - color: integer [1-8]
* - ant: null or {type: [1-5], food: [0+), friend: true/false}
* - food: 0 or 1
*
* Return: object containing:
* - cell: integer [0-8] denoting the cell to move to, or perform an action on
* - type: type of worker ant to create on cell
* - color: new cell colour to apply
*
* Element order: (but note that direction is randomised each turn)
* 0 1 2
* 3 4 5
* 6 7 8
*/
return {cell: 4};
">
<script src="core/requirejs.js"></script>
<script src="engine/entry.js" async></script>
</head>
<body>
<noscript>This viewer requires Javascript!</noscript>
</body>
</html>