-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
195 lines (158 loc) · 7.9 KB
/
index.html
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>try TTType, the esolang plugin</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body onload="updatePortefeuille();updatePossessionValues();">
<h1 id="title">TTType</h1>
<p>TTType is meant to be an esolang plugin, meaning it is something that works with any programming language when properly implemented.
</p>
<p>TTType simulates a market for every symbol or reserved words used in a programming language.</p>
<p>Here, TTType is used as a plugin on top of
<a href="https://en.wikipedia.org/wiki/Brainfuck">brainf***</a>.</p>
<h2>try TTType here: </h2>
<div class="wrapper">
<div class="div-ide">
<p class="highlight">Code window </p>
<textarea id="ide" oninput="updateTTType();" rows="25" cols="75">>++++++++[<+++++++++>-]<.>++++[<+++++++>-]<+.+++++++..+++.>>++++++[<+++++++>-]<+
+.------------.>++++++[<+++++++++>-]<+.<.+++.------.--------.>>>++++[<++++++++>-
]<+.</textarea>
<button onclick="decideExecution();">interpret this!</button>
</div>
<div class="div-terminal">
<p class="highlight">Terminal</p>
<textarea id="terminal" readonly rows=10 cols=75></textarea>
</div>
<div class="portfolio">
<p class="highlight">Portfolio</p>
<table class="portefeuille">
<tr>
<td class="td-table"></td>
<td class="td-table">Have</td>
<td class="td-table">Use</td>
</tr>
<tr>
<td class="td-table"><</td>
<td class="td-table" id="possession_right_arrow"></td>
<td class="td-table" id="p_right_arrow"> 1</td>
</tr>
<tr>
<td class="td-table">></td>
<td class="td-table" id="poss_left_arrow"></td>
<td class="td-table" id="p_left_arrow">1</td>
</tr>
<tr>
<td class="td-table">+ </td>
<td class="td-table" id="poss_plus"></td>
<td class="td-table" id="p_+">1</td>
</tr>
<tr>
<td class="td-table">- </td>
<td class="td-table" id="poss_moins"></td>
<td class="td-table" id="p_-">1</td>
</tr>
<tr>
<td class="td-table">. </td>
<td class="td-table" id="poss_point"></td>
<td class="td-table" id="p_.">1</td>
</tr>
<tr>
<td class="td-table">, </td>
<td class="td-table" id="poss_comma"></td>
<td class="td-table" id="p_,">1</td>
</tr>
<tr>
<td class="td-table">[ </td>
<td class="td-table" id="poss_lbracket"></td>
<td class="td-table" id="p_[">1</td>
</tr>
<tr>
<td class="td-table">] </td>
<td class="td-table" id="poss_rbracket"></td>
<td class="td-table" id="p_]">1</td>
</tr>
<tr>
<td class="td-table">Money :</td>
<td class="td-table" id="monnaie">1000</td>
</tr>
</table>
</div>
<div class="market">
<p class="highlight">Market</p>
<table class="portefeuille">
<tr>
<td class="td-table"></td>
<td class="td-table">Value</td>
<td class="td-table">Buy</td>
<td class="td-table">Sell</td>
</tr>
<tr>
<td class="td-table"><</td>
<td class="td-table" id="m_right_arrow">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_arrow_r();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_arrow_r();">-</button></td>
</tr>
<tr>
<td class="td-table">></td>
<td class="td-table" id="m_left_arrow">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_arrow_l();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_arrow_l();">-</button></td>
</tr>
<tr>
<td class="td-table">+ </td>
<td class="td-table" id="m_+">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_plus();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_plus();">-</button></td>
</tr>
<tr>
<td class="td-table">-</td>
<td class="td-table" id="m_-">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_moins();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_moins();">-</button></td>
</tr>
<tr>
<td class="td-table">. </td>
<td class="td-table" id="m_.">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_point();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_point();">-</button></td>
</tr>
<tr>
<td class="td-table">, </td>
<td class="td-table" id="m_,">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_comma();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_comma();">-</button></td>
</tr>
<tr>
<td class="td-table">[ </td>
<td class="td-table" id="m_[">10</td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_lbracket();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_lbracket();">-</button></td>
</tr>
<tr>
<td class="td-table">] </td>
<td class="td-table" id="m_]">10 </td>
<td class="td-table"><button class="b_r_arrow" onclick="buy_rbracket();">+</button></td>
<td class="td-table"><button class="s_r_arrow" onclick="sell_rbracket();">-</button></td>
</tr>
</table>
</div>
</div>
<div id="explain">
<h2>How it works</h2>
<p>There are four sections: the portfolio, the code window, the terminal and the market.</p>
<ul>
<li>In your
<a class="highlight">portfolio</a>, you can see how many of each symbol you currently have at your disposal - and how many symbols would be used by the program currently in the code window. You can also see how much Money you have.</li>
<li>In the
<a class="highlight">code window</a>, you can enter code to be executed by pressing the "interpret this!" button.</li>
<li>The <a class="highlight">Terminal</a> will display results from interpreting the code - it will also display errors and warnings.</li>
<li>The
<a class="highlight">market</a> displays the current value of each symbol. You can press the +/- buttons next to each symbol to buy/sell the symbol to the left of the button.</li>
</ul>
<p>Prices will change as you type, so keep an eye on the market !</p>
</div>
</body>
<script src="thecode.js "></script>
</html>