-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvironment.htm
More file actions
129 lines (108 loc) · 3.99 KB
/
environment.htm
File metadata and controls
129 lines (108 loc) · 3.99 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<html>
<head>
<link href='https://schickt.de/font/px8x8.css' rel='stylesheet'>
<link rel="stylesheet" type="text/css" href="style/style.css" media="screen" />
<style>
#log {
overflow: scroll;
height: calc(100% - 16px);
}
</style>
<script src='rc-classes.js'></script>
<script src='rc-instruction-set.js'></script>
<script src='ui-common.js'></script>
<script>
var environment = new Environment()
function init() {
window.addEventListener('message', message_handler, false)
}
function message_handler(event) { }
function value_for(x) {
return document.getElementById(x).value
}
function return_to_defaults() {
environment = new Environment()
update_environment();
}
function update_environment() {
environment.core_size = value_for('core_size')
environment.num_rounds = value_for('num_rounds')
environment.max_cycles = value_for('max_cycles')
environment.max_threads = value_for('max_threads')
environment.p_space_size = value_for('p_space_size')
environment.max_instructions = value_for('max_instructions')
const json = btoa(JSON.stringify(environment))
window.parent.postMessage(`all::environment::${json}`, '*')
}
</script>
</head>
<body onload='init()'>
<div class='top light'>
<table class='padded'>
<tr>
<th>Key</th>
<th>Value</th>
<th>'88 Default</th>
</tr>
<tr>
<td>
<label for='max_cycles'>Max. number of cycles</label>
</td>
<td>
<input class='td-right' type='number' id='max_cycles' value='8000' onchange='update_environment()'>
</td>
<td class='td-right'>8000</td>
</tr>
<tr>
<td>
<label for='num_rounds'>Number of rounds</label>
</td>
<td>
<input class='td-right' type='number' id='num_rounds' value='100' onchange='update_environment()'>
</td>
<td class='td-right'>100</td>
</tr>
<tr>
<td>
<label for='core_size'>Core size</label>
</td>
<td>
<input class='td-right' type='number' id='core_size' value='4000' onchange='update_environment()'>
</td>
<td class='td-right'>8000</td>
</tr>
<tr>
<td>
<label for='max_instructions'>Max. code length</label>
</td>
<td>
<input class='td-right' type='number' id='max_instructions' value='100' onchange='update_environment()'>
</td>
<td class='td-right'>100</td>
</tr>
<tr>
<td>
<label for='p_space_size'>P-space size</label>
</td>
<td>
<input class='td-right' type='number' id='p_space_size' value='500' onchange='update_environment()'>
</td>
<td class='td-right'>500</td>
</tr>
<tr>
<td>
<label for='max_threads'>Max. number of threads</label>
</td>
<td>
<input class='td-right' type='number' id='max_threads' value='8000' onchange='update_environment()'>
</td>
<td class='td-right'>8000</td>
</tr>
</table>
</div>
<div class='toolbar'>
<input type='button' value='PUBLISH NEW SETTINGS' onclick='update_environment()'>
<input type='button' value='DEFAULT SETTINGS' onclick='return_to_defaults()'>
</div>
</body>
</html>