generated from Hgit-1/Hnet-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mscop1.3ser.cpp
486 lines (486 loc) · 13.7 KB
/
mscop1.3ser.cpp
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
//WARNING!THIS PROGRAM MAY HAVE ERROR!IF YOU FIND ERROR,PLEASE CALL H!e-mail:[email protected]/[email protected]/[email protected]!
//server load page
//now all(4)server
//1.0server:start,time:1day,upload day:unkhown/unkhown/unkhown/unkhown:unkhown:unkhown(this server was delete,if you want to find older vertion,please search wechat record)
//1.1server:upload receive port(use new algorithm(before:check x[?](have error,classify on code,use if,ifelse,ifelseif),now:j-?,x[?](plus classify on code+length,use if,ifelse,ifelseif(less use)))),time:2hour,upload day:2022/6/3/21:50:00
//1.2server:upload receive port(use new algorithm(1.1ser:use x[?],1.2ser:use a,b,c,d,e,f))time:2hour,upload day:2022/6/10/22:23:00(clear any error on normal use(DO NOT USE THIS UNNORMAL,OR IT WILL BE IN A FOREVER-LOOP OR SOMETHING ERROR!)
//1.3server:upload send port(plus code to send to wechat or some thing web!)time:2hour,upload day:2022/6/12/15:46:00(now use on main)
#include<bits/stdc++.h>
using namespace std;
int mswechat() {
char x;
unsigned long long y;
cout << "how many words you want to cout?" << endl;
cin >> y;
cout << "WARNING!IF YOU WANT TO PRINT'......',YOU HAVE TO PRINT'|'!" << endl;
cout << "what to you want to compile?(includeing error(not in dictionary))" << endl;
for (int i = 1; i <= y; i++) {
cin >> x;//TODO
if (x == 'a') {
cout << ".-" << endl; //TODO
} else if (x == 'b') {
cout << "-..." << endl;
} else if (x == 'c') {
cout << "-.-." << endl;
} else if (x == 'd') {
cout << "-.." << endl;
} else if (x == 'e') {
cout << "." << endl;
} else if (x == 'f') {
cout << "..-." << endl;
} else if (x == 'g') {
cout << "--." << endl;
} else if (x == 'h') {
cout << "...." << endl;
} else if (x == 'i') {
cout << ".." << endl;
} else if (x == 'j') {
cout << ".---" << endl;
} else if (x == 'k') {
cout << "-.-" << endl;
} else if (x == 'l') {
cout << ".-.." << endl;
} else if (x == 'm') {
cout << "--" << endl;
} else if (x == 'n') {
cout << "-." << endl;
} else if (x == 'o') {
cout << "---" << endl;
} else if (x == 'p') {
cout << ".--." << endl;
} else if (x == 'q') {
cout << "--.-" << endl;
} else if (x == 'r') {
cout << ".-." << endl;
} else if (x == 's') {
cout << "..." << endl;
} else if (x == 't') {
cout << "-" << endl;
} else if (x == 'u') {
cout << "..-" << endl;
} else if (x == 'v') {
cout << "...-" << endl;
} else if (x == 'w') {
cout << ".--" << endl;
} else if (x == 'x') {
cout << "-..-" << endl;
} else if (x == 'y') {
cout << "-.--" << endl;
} else if (x == 'z') {
cout << "--.." << endl;
} else if (x == '0') {
cout << "-----" << endl;
} else if (x == '1') {
cout << ".----" << endl;
} else if (x == '2') {
cout << "..---" << endl;
} else if (x == '3') {
cout << "...--" << endl;
} else if (x == '4') {
cout << "....-" << endl;
} else if (x == '5') {
cout << "....." << endl;
} else if (x == '6') {
cout << "-...." << endl;
} else if (x == '7') {
cout << "--..." << endl;
} else if (x == '8') {
cout << "---.." << endl;
} else if (x == '9') {
cout << "----." << endl;
} else if (x == '.') {
cout << ".-.-.-" << endl;
} else if (x == ',') {
cout << "--..--" << endl;
} else if (x == '!') {
cout << "---..." << endl;
} else if (x == '?') {
cout << "..--.." << endl;
} else if (x == '|') {
cout << ".----." << endl;
} else if (x == '-') {
cout << "-....-" << endl;
} else if (x == '(') {
cout << "-.--." << endl;
} else if (x == ')') {
cout << "-.--.-" << endl;
} else if (x == '/') {
cout << "-..-." << endl;
} else if (x == '=') {
cout << "-...-" << endl;
} else if (x == '+') {
cout << ".-.-." << endl;
} else if (x == '"') {
cout << ".-..-." << endl;
} else if (x == '*') {
cout << "-..-" << endl;
} else {
cout << "error" << endl;
}
}
}
int ms() {
char x;
unsigned long long y;
cout << "how many words you want to cout?" << endl;
cin >> y;
cout << "WARNING!IF YOU WANT TO PRINT'......',YOU HAVE TO PRINT'|'!" << endl;
cout << "what to you want to compile?(includeing error(not in dictionary))" << endl;
for (int i = 1; i <= y; i++) {
cin >> x;//TODO
if (x == 'a') {
cout << ".-" << " "; //TODO
} else if (x == 'b') {
cout << "-..." << " ";
} else if (x == 'c') {
cout << "-.-." << " ";
} else if (x == 'd') {
cout << "-.." << " ";
} else if (x == 'e') {
cout << "." << " ";
} else if (x == 'f') {
cout << "..-." << " ";
} else if (x == 'g') {
cout << "--." << " ";
} else if (x == 'h') {
cout << "...." << " ";
} else if (x == 'i') {
cout << ".." << " ";
} else if (x == 'j') {
cout << ".---" << " ";
} else if (x == 'k') {
cout << "-.-" << " ";
} else if (x == 'l') {
cout << ".-.." << " ";
} else if (x == 'm') {
cout << "--" << " ";
} else if (x == 'n') {
cout << "-." << " ";
} else if (x == 'o') {
cout << "---" << " ";
} else if (x == 'p') {
cout << ".--." << " ";
} else if (x == 'q') {
cout << "--.-" << " ";
} else if (x == 'r') {
cout << ".-." << " ";
} else if (x == 's') {
cout << "..." << " ";
} else if (x == 't') {
cout << "-" << " ";
} else if (x == 'u') {
cout << "..-" << " ";
} else if (x == 'v') {
cout << "...-" << " ";
} else if (x == 'w') {
cout << ".--" << " ";
} else if (x == 'x') {
cout << "-..-" << " ";
} else if (x == 'y') {
cout << "-.--" << " ";
} else if (x == 'z') {
cout << "--.." << " ";
} else if (x == '0') {
cout << "-----" << " ";
} else if (x == '1') {
cout << ".----" << " ";
} else if (x == '2') {
cout << "..---" << " ";
} else if (x == '3') {
cout << "...--" << " ";
} else if (x == '4') {
cout << "....-" << " ";
} else if (x == '5') {
cout << "....." << " ";
} else if (x == '6') {
cout << "-...." << " ";
} else if (x == '7') {
cout << "--..." << " ";
} else if (x == '8') {
cout << "---.." << " ";
} else if (x == '9') {
cout << "----." << " ";
} else if (x == '.') {
cout << ".-.-.-" << " ";
} else if (x == ',') {
cout << "--..--" << " ";
} else if (x == '!') {
cout << "---..." << " ";
} else if (x == '?') {
cout << "..--.." << " ";
} else if (x == '|') {
cout << ".----." << " ";
} else if (x == '-') {
cout << "-....-" << " ";
} else if (x == '(') {
cout << "-.--." << " ";
} else if (x == ')') {
cout << "-.--.-" << " ";
} else if (x == '/') {
cout << "-..-." << " ";
} else if (x == '=') {
cout << "-...-" << " ";
} else if (x == '+') {
cout << ".-.-." << " ";
} else if (x == '"') {
cout << ".-..-." << " ";
} else if (x == '*') {
cout << "-..-" << " ";
} else {
cout << "error" << " ";
}
}
}
int mcout() {
char a, b, c, d, e, f;
int y;
int z;
cout << "how many codes you want to cout?" << endl;
cin >> y;
for (int i = 1; i <= y; i++) {
cout << "the length of the code?" << endl;
cin >> z;
if (z > 6) {
cout << "error" << endl; //TODO
}
if (z < 1) {
cout << "error" << endl; //TODO
}
cout << "WARNING!COMPILE MUST USE SPACE IMMEDIATELY!" << endl;
if (z == 1) {
cin >> a;
if (a == '.') {
cout << "E" << endl; //TODO
} else {
cout << "T" << endl; //TODO
}//TODO
} else if (z == 2) { //aimn
cin >> a >> b;
if (a == '.') { //ai
if (b == '-') {
cout << "A" << endl; //TODO
} else {
cout << "I" << endl; //TODO
}//TODO
} else { //mn
if (b == '-') {
cout << "M" << endl; //TODO
} else {
cout << "N" << endl; //TODO
}//TODO
}//TODO
}
if (z == 3) { //dgkorsuw
cin >> a >> b >> c;
if (a == '.') { //rsuw
if (b == '.') { //su
if (c == '.') {
cout << "S" << endl; //TODO
} else {
cout << "U" << endl; //TODO
}//TODO
} else { //rw
if (c == '.') {
cout << "R" << endl; //TODO
} else {
cout << "W" << endl; //TODO
}//TODO
}//TODO
} else { //dgko
if (b == '.') { //dk
if (c == '.') {
cout << "D" << endl; //TODO
} else {
cout << "K" << endl; //TODO
}//TODO
} else { //go
if (c == '.') {
cout << "G" << endl; //TODO
} else {
cout << "O" << endl; //TODO
}//TODO
}//TODO
}//TODO
} else if (z == 4) { //bcfhjlpqvxyz*
cin >> a >> b >> c >> d;
if (a == '.') { //jfhlpv
if (b == '.') { //fhv
if (c == '.') { //hv
if (d == '.') {
cout << "H" << endl; //TODO
} else {
cout << "V" << endl; //TODO
}//TODO
} else {
cout << "F" << endl; //TODO
}//TODO
} else { //jlp
if (c == '.') {
cout << "L" << endl; //TODO
} else {
if (d == '.') {
cout << "P" << endl; //TODO
} else {
cout << "J" << endl; //TODO
}//TODO
}//TODO
}//TODO
} else { //bcjqxyz*
if (b == '.') { //bcxy*
if (c == '.') { //bx*
if (d == '.') {
cout << "B" << endl; //TODO
} else {
cout << "X" << endl; //TODO
}//TODO
} else { //cy
if (d == '.') {
cout << "C" << endl; //TODO
} else {
cout << "Y" << endl; //TODO
}//TODO
}//TODO
} else { //qz
if (d == '.') {
cout << "Z" << endl; //TODO
} else {
cout << "Q" << endl; //TODO
}//TODO
}//TODO
}//TODO
} else if (z == 5) { //1234567890(/=+
cin >> a >> b >> c >> d >> e;
if (a == '.') { //12345+
if (b == '.') { //2345
if (c == '.') { //345
if (d == '.') { //45
if (e == '.') {
cout << 5 << endl; //TODO
} else {
cout << 4 << endl; //TODO
}//TODO
} else {
cout << 3 << endl; //TODO
}//TODO
} else {
cout << 2 << endl; //TODO
}//TODO
} else { //1+
if (c == '.') {
cout << "+" << endl;; //TODO
} else {
cout << 1 << endl; //TODO
}
}//TODO
} else { //67890(/=
if (b == '.') { //6(/=
if (c == '.') { //6/=
if (d == '.') { //6=
if (e == '.') {
cout << 6 << endl; //TODO
} else {
cout << "=" << endl; //TODO
}//TODO
} else {
cout << "/" << endl; //TODO
}//TODO
} else {
cout << "(" << endl; //TODO
}//TODO
} else { //7890
if (c == '.') {
cout << 7 << endl; //TODO
} else {
if (d == '.') {
cout << 8 << endl; //TODO
} else {
if (e == '.') {
cout << 9 << endl; //TODO
} else {
cout << 0 << endl; //TODO
}//TODO
}//TODO
}//TODO
}//TODO
}//TODO
} else if (z == 6) { //.,!?......-)"
cin >> a >> b >> c >> d >> e >> f;
if (a == '.') { //.?......"
if (b == '.') {
cout << "?" << endl; //TODO
} else { //."......
if (c == '.') { //."
if (d == '.') {
cout << '"' << endl;; //TODO
} else {
cout << "." << endl; //TODO
}//TODO
} else {
cout << "......" << endl; //TODO
}//TODO
}//TODO
} else { //,!-)
if (b == '.') {
if (c == '-') {
cout << ")" << endl; //TODO
} else {
cout << "-" << endl; //TODO
} //TODO
} else {
if (c == '.') {
cout << "," << endl; //TODO
} else {
cout << "!" << endl; //TODO
}//TODO
}//TODO
}//TODO
} else {
cout << "";
}
}
}
int main() {
int ask;
cout << "please input your ans(1-send,2-receive,3-wechat send,other-quit)" << endl;
cin >> ask;
if (ask == 1) {
ms();//TODO
} else if (ask == 2) {
mcout();//TODO
} else if (ask == 3) {
mswechat();
} else {
cout << "quit" << endl;
}
cout << "compile over";
}
//user manual(1.3ser)
//1:what is this program?
// this is a program to send/compile morse-code.
//2:use
//2.1:first "cin"
// first "cin" is doing for ask which mode you want to use.
//2.2:send
// we will ask you how many code you want to send(if you write too much,system may cout error/compile over too early).
// warning:this is a "unsigned-long-long mode",you can cin 0-18446744073709551615,
// DO NOT CIN NUMBER BIGGER THAN 18446744073709551615 OR SMALLER THAN 0,DO NOT CIN
// "float-mode(like:0.0,1.8......)",DO NOT CIN "char-mode(like:hello,?......)",
// OTHER USE "int-mode",DO NOT CIN NUMBER BIGGER THAN 2147483647,SMALLER THAN
// -2147483648!NITHER,YOU CAN NOT CIN "float-mode"OR"char-mode"!if it is char mode,
// you can cin char,number(DO NOT CIN NUMBER BIGGER THAN 9 AND SMALLER THAN 0!).
// you can cin some sentence and see/ctrl+c cout code!and wechat mode can plus enter!(we are so sorry that we did not record chinese)
//2.3:receive
// we will ask you how many code you want to cin(if you write too much,system may cout error/compile over too early).
// "int mode" user manual is in "send".when you want to cin code,please cin like that:
// .-to. -or.+enter+-,we are checked if you cin on normal set there will be no problem!
//2.4:quit
// if you cin a number apart from 1or2or3,we will end this program.
//3:tips
// DO NOT CHANGE CODE IF YOU UNSAVE MAIN FILE OR YOU ARE NOT A PROGRAMMER!
// IF THERE ARE ANY ERROR,PLEASE CALL:"[email protected]"(send in:24h,send receive:14h)/"[email protected]"(send in:24h,send receive:unkhown)
// "[email protected]"(send in:24h,send receive:14h)
// if you receive this flie,please test that keys are right.net:https://www.qsl.net/bg3tt/zl/mesdm.htm
//4:flie creater:
// 1:programmer:H
// 2:ideas giver:H/Z
// 3:support:H/Z/Red Panda Dev-C++ 6.5/source forge/qsl.net(bg3tt)