html terminal
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
use mindus::block::ratios::Resource;
use mindus::fluid::Type as Fluid;
use mindus::item::Type as Item;

static E2E: phf::Map<char, &str> = phf::phf_map! {
    '' => "<:launch_pad:1165059549477220382>",
    '' => "<:surge_conveyor:1165056614835945542>",
    '' => "<:pyratite_mixer:1164832608002256906>",
    '' => "<:poly:1165060238341316720>",
    '' => "<:vault:1165057825110761583>",
    '' => "<:copper_wall_large:1164868430726430790>",
    '' => "<:segment:1164869661591089163>",
    '' => "<:ripple:1164869672458530816>",
    '' => "<:hail:1164869685133717564>",
    '' => "<:force_projector:1164868932440698891>",
    '' => "<:distributor:1165056571445874798>",
    '' => "<:message:1165059277409484820>",
    '' => "<:naval_factory:1164846856094875738>",
    '' => "<:liquid_source:1165056998862237857>",
    '' => "<:impact_reactor:1165057397711179846>",
    '' => "<:illuminator:1165057394418655311>",
    '' => "<:melter:1164832622455824395>",
    '' => "<:item_source:1165056586012700793>",
    '' => "<:logic_processor:1165059269356433459>",
    '' => "<:payload_source:1165055051648209008>",
    '' => "<:phase_conduit:1165057015228407899>",
    '' => "<:disassembler:1164832634598346813>",
    '' => "<:minke:1165060225489981440>",
    '' => "<:titanium_wall:1164868373335773184>",
    '' => "<:plastanium_wall:1164868410379874404>",
    '' => "<:scrap_wall_gigantic:1164868400410005545>",
    '' => "<:bridge_conveyor:1165056566337220678>",
    '' => "<:payload_loader:1165055042408165376>",
    '' => "<:container:1165057808954310667>",
    '' => "<:zenith:1165060268607418440>",
    '' => "<:hyper_processor:1165059260837806110>",
    '' => "<:phase_weaver:1164832617389113374>",
    '' => "<:cyerce:1165060197996310618>",
    '' => "<:world_cell:1165059286414659657>",
    '' => "<:vela:1165060264958382081>",
    '' => "<:liquid_container:1165056989135655034>",
    '' => "<:scatter:1164869667295346732>",
    '' => "<:liquid_void:1165057004889444402>",
    '' => "<:payload_router:1165055049630748672>",
    '' => "<:quad:1165060243500322967>",
    '' => "<:memory_cell:1165059275572387921>",
    '' => "<:salvo:1164869669224722432>",
    '' => "<:liquid_router:1165056995783614574>",
    '' => "<:wave:1164869646873280562>",
    '' => "<:overdrive_dome:1164868924186316940>",
    '' => "<:payload_void:1165055058988240906>",
    '' => "<:meltdown:1164869678598979655>",
    '' => "<:scrap_wall_huge:1164868397377527849>",
    '' => "<:core_nucleus:1165057814801170583>",
    '' => "<:tsunami:1164869649125605396>",
    '' => "<:swarmer:1164869653357670480>",
    '' => "<:cryofluid_mixer:1164832639807655988>",
    '' => "<:oil_extractor:1165059446301536317>",
    '' => "<:plated_conduit:1165057017388482660>",
    '' => "<:pulverizer:1164832611500310548>",
    '' => "<:rotary_pump:1165057025089228891>",
    '' => "<:surge_wall:1164868390024921148>",
    '' => "<:duct:1165056574872633354>",
    '' => "<:micro_processor:1165059281087889479>",
    '' => "<:nova:1165060232070828062>",
    '' => "<:water_extractor:1165059449917018143>",
    '' => "<:interplanetary_accelerator:1165059547526860950>",
    '' => "<:fortress:1165060214580580352>",
    '' => "<:mega:1165060222956621847>",
    '' => "<:inverted_sorter:1165056577020121190>",
    '' => "<:air_factory:1164846858871513148>",
    '' => "<:rtg_generator:1165057406506651708>",
    '' => "<:thruster:1164868368235507754>",
    '' => "<:ground_factory:1164846860800892938>",
    '' => "<:copper_wall:1164868434006392842>",
    '' => "<:junction:1165056592169926677>",
    '' => "<:payload_conveyor:1165055040411668500>",
    '' => "<:multiplicative_reconstructor:1164846850013134920>",
    '' => "<:pulsar:1165060241394765834>",
    '' => "<:phase_conveyor:1165056600520802305>",
    '' => "<:conduit:1165056982974210179>",
    '' => "<:surge_wall_large:1164868386929512509>",
    '' => "<:tetrative_reconstructor:1164846844053028945>",
    '' => "<:bryde:1165060187229519963>",
    '' => "<:unloader:1165057822791307344>",
    '' => "<:armored_conveyor:1165056561492803644>",
    '' => "<:reign:1165060249892433940>",
    '' => "<:toxopid:1165060263368736920>",
    '' => "<:scepter:1165060256276164668>",
    '' => "<:arkyid:1165060180455739535>",
    '' => "<:canvas:1165059258124087356>",
    '' => "<:core_shard:1165057818148225064>",
    '' => "<:item_void:1165056589275865168>",
    '' => "<:corvus:1165060189876125806>",
    '' => "<:combustion_generator:1165057385799352321>",
    '' => "<:power_node_large:1165057403176358018>",
    '' => "<:plastanium_compressor:1164832614096576555>",
    '' => "<:battery:1165057379935727756>",
    '' => "<:silicon_smelter:1164832599328444447>",
    '' => "<:crawler:1165060193940422786>",
    '' => "<:antumbra:1165060178392129698>",
    '' => "<:scorch:1164869663663071282>",
    '' => "<:mend_projector:1164868930616180746>",
    '' => "<:logic_display:1165059267267674224>",
    '' => "<:router:1165056609395949638>",
    '' => "<:liquid_junction:1165056991853559868>",
    '' => "<:dagger:1165060204858183690>",
    '' => "<:cyclone:1164869703437668392>",
    '' => "<:differential_generator:1165057389242896395>",
    '' => "<:payload_unloader:1165055055473410048>",
    '' => "<:mono:1165060228618928178>",
    '' => "<:world_message:1165059289648480297>",
    '' => "<:plastanium_conveyor:1165056604174045277>",
    '' => "<:conveyor:1165056569621369013>",
    '' => "<:foreshadow:1164869696064073760>",
    '' => "<:thermal_generator:1165057421899726968>",
    '' => "<:mender:1164868927264915466>",
    '' => "<:fuse:1164869692591198208>",
    '' => "<:overdrive_projector:1164868922135289996>",
    '' => "<:switch:1165059283331862620>",
    '' => "<:battery_large:1165057382066434149>",
    '' => "<:graphite_press:1164832630643105853>",
    '' => "<:memory_bank:1165059272426668102>",
    '' => "<:incinerator:1164832628642431037>",
    '' => "<:oct:1165060234310598788>",
    '' => "<:solar_panel:1165057408616366101>",
    '' => "<:armored_duct:1165056563300544523>",
    '' => "<:arc:1164869705882943580>",
    '' => "<:retusa:1165060254183206942>",
    '' => "<:quasar:1165060246646046740>",
    '' => "<:thorium_wall:1164868384018665552>",
    '' => "<:overflow_gate:1165056597467332678>",
    '' => "<:power_node:1165057399678308383>",
    '' => "<:blast_drill:1165059437363474504>",
    '' => "<:kiln:1164832625547018251>",
    '' => "<:mass_driver:1165056595466649620>",
    '' => "<:separator:1164832606160961606>",
    '' => "<:liquid_tank:1165057003027181649>",
    '' => "<:mechanical_drill:1165059443264864307>",
    '' => "<:core_foundation:1165057811387011203>",
    '' => "<:impulse_pump:1165056986040250448>",
    '' => "<:titanium_wall_large:1164868370177466388>",
    '' => "<:sei:1165060259719680160>",
    '' => "<:atrax:1165060183593074710>",
    '' => "<:gamma:1165060216719683664>",
    '' => "<:shield_projector:1164868919903928330>",
    '' => "<:exponential_reconstructor:1164846847148445716>",
    '' => "<:mechanical_pump:1165057009620635749>",
    '' => "<:scrap_wall:1164868403593482281>",
    '' => "<:horizon:1165060220070932551>",
    '' => "<:payload_mass_driver:1165055046216585226>",
    '' => "<:surge_tower:1165057419894853725>",
    '' => "<:phase_wall_large:1164868414100213760>",
    '' => "<:door_large:1164868422555926538>",
    '' => "<:bridge_conduit:1165056979702657024>",
    '' => "<:titanium_conveyor:1165056617809715210>",
    '' => "<:sorter:1165056611480502322>",
    '' => "<:thorium_reactor:1165057424915431474>",
    '' => "<:cultivator:1164832636452216922>",
    '' => "<:phase_wall:1164868417803796490>",
    '' => "<:coal_centrifuge:1164832643246989333>",
    '' => "<:thorium_wall_large:1164868375353249793>",
    '' => "<:flare:1165060210944127067>",
    '' => "<:multi_press:1164832620522242068>",
    '' => "<:lancer:1164869681472094219>",
    '' => "<:world_processor:1165059291473006612>",
    '' => "<:duo:1164869699817967616>",
    '' => "<:plastanium_wall_large:1164868405661278229>",
    '' => "<:diode:1165057391172272188>",
    '' => "<:underflow_gate:1165056619873320981>",
    '' => "<:pneumatic_drill:1165059448058953728>",
    '' => "<:pulse_conduit:1165057021205303336>",
    '' => "<:eclipse:1165060207517372456>",
    '' => "<:steam_generator:1165057415658614795>",
    '' => "<:laser_drill:1165059440077189140>",
    '' => "<:blast_mixer:1164832645126041600>",
    '' => "<:door:1164868425294823524>",
    '' => "<:parallax:1164869674568261683>",
    '' => "<:scrap_wall_large:1164868391950106704>",
    '' => "<:spectre:1164869658365673512>",
    '' => "<:surge_smelter:1164832648426950706>",
    '' => "<:solar_panel_large:1165057412126998649>",
    '' => "<:silicon_crucible:1164832602696462346>",
    '' => "<:large_logic_display:1165059264230981702>",
    '' => "<:spore_press:1164832597411647508>",
    '' => "<:additive_reconstructor:1164846854006120551>",
    '' => item(Item::Tungsten),
    '' => item(Item::Titanium),
    '' => item(Item::Thorium),
    '' => item(Item::SurgeAlloy),
    '' => item(Item::SporePod),
    '' => item(Item::Silicon),
    '' => item(Item::Scrap),
    '' => item(Item::Sand),
    '' => item(Item::Pyratite),
    '' => item(Item::Plastanium),
    '' => item(Item::PhaseFabric),
    '' => item(Item::Metaglass),
    '' => item(Item::Lead),
    '' => item(Item::Graphite),
    '' => item(Item::FissileMatter),
    '' => item(Item::DormantCyst),
    '' => item(Item::Copper),
    '' => item(Item::Coal),
    '' => item(Item::Carbide),
    '' => item(Item::BlastCompound),
    '' => item(Item::Beryllium),
    '' => item(Item::Oxide),
    '' => fluid(Fluid::Water),
    '' => fluid(Fluid::Slag),
    '' => fluid(Fluid::Oil),
    '' => fluid(Fluid::Cryofluid),
    '' => fluid(Fluid::Neoplasm),
    '' => fluid(Fluid::Arkycite),
    '' => fluid(Fluid::Gallium),
    '' => fluid(Fluid::Ozone),
    '' => fluid(Fluid::Hydrogen),
    '' => fluid(Fluid::Nitrogen),
    '' => fluid(Fluid::Cyanogen),
};

pub const fn res(r: Resource) -> &'static str {
    match r {
        Resource::Item(i) => item(i),
        Resource::Fluid(f) => fluid(f),
    }
}

pub const fn fluid(f: Fluid) -> &'static str {
    use Fluid::*;
    match f {
        Water => "<:water:1144220582204944434>",
        Slag => "<:slag:1144220603671396352>",
        Oil => "<:oil:1144220637448118353>",
        Cryofluid => "<:cryofluid:1144220686018154599>",
        Neoplasm => "<:neoplasm:1144220645794791505>",
        Arkycite => "<:arkycite:1144220710106038383>",
        Gallium => "<:gallium:1144220668238516264>",
        Ozone => "<:ozone:1144220628627497091>",
        Hydrogen => "<:hydrogen:1144220658746798090>",
        Nitrogen => "<:nitrogen:1144220641160077363>",
        Cyanogen => "<:cyanogen:1144220681945489408>",
    }
}

/// Returns the emoji of a item
pub const fn item(i: Item) -> &'static str {
    use Item::*;
    match i {
        Tungsten => "<:tungsten:1144220586382458970>",
        Titanium => "<:titanium:1144220588978749551>",
        Thorium => "<:thorium:1144220593068191784>",
        SurgeAlloy => "<:surgealloy:1144220597484789822>",
        SporePod => "<:sporepod:1144220601205149777>",
        Silicon => "<:silicon:1144220607710502922>",
        Scrap => "<:scrap:1144220611531505704>",
        Sand => "<:sand:1144220613880315934>",
        Pyratite => "<:pyratite:1144220617319657572>",
        Plastanium => "<:plastanium:1144220622403153971>",
        PhaseFabric => "<:phasefabric:1144220626224156794>",
        Metaglass => "<:metaglass:1144220649901019206>",
        Lead => "<:lead:1144220654686699570>",
        Graphite => "<:graphite:1144220661137551400>",
        FissileMatter => "<:fissilematter:1144220673670131742>",
        DormantCyst => "<:dormantcyst:1144220677994446928>",
        Copper => "<:copper:1144220690216648704>",
        Coal => "<:coal:1144220692729036800>",
        Carbide => "<:carbide:1144220696927555584>",
        BlastCompound => "<:blastcompound:1144220701671305319>",
        Beryllium => "<:beryllium:1144220705739788288>",
        Oxide => "<:oxide:1144220632746295316>",
    }
}

pub fn replace(s: &str) -> String {
    let mut o = String::with_capacity(s.len());
    for ch in s.chars() {
        if let Some(mtch) = E2E.get(&ch) {
            o.push_str(mtch)
        } else {
            o.push(ch);
        }
    }
    o
}

#[test]
fn convrt() {
    assert_eq!(
        replace("the  will output many /s"),
        "the <:spore_press:1164832597411647508> will output many <:sporepod:1144220601205149777>/s"
    );
}