Repository navigation
Expand file tree
/
Copy pathAlphas.sql
More file actions
92 lines (77 loc) · 29.8 KB
/
Copy pathAlphas.sql
File metadata and controls
92 lines (77 loc) · 29.8 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
/*
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{CMParitive_adv4nt4g3}', (select Id from AlphaChallenges where Name = 'Intro 3 - Loopz'), 'Read in the values from A and B. Output the lesser value to LOWER and the greater value to HIGHER. If the values are the same, do not output anything.
Implement this as an infinite loop.', '[{"Name":"B", "Data":[-1, -5, -1, 1, 0, 3, 3, 0, 4, -1]}, {"Name":"A", "Data":[3, 4, 5, 4, 5, -4, 3, 2, 2, 5]}]', '[{"Name":"HIGHER", "Data":[3, 4, 5, 4, 5, 3, 2, 4, 5]}, {"Name":"LOWER", "Data":[-1, -5, -1, 1, 0, -4, 0, 2, -1]}]',
'The Machine', 'Comparitator', 0);
insert into AlphaChallengeTests (AlphaChallengeId, InputTextJson, OutputTextJson)
values ((select Id from AlphaChallenges where Name = 'Comparitator'), '[{"Name":"B", "Data":[3, 2, 41, -21, -10, 10, 0, 24, 27, -18, -29, 14, -1, 49, -36, -26, 41, -27, 25, 43]}, {"Name":"A", "Data":[-22, 22, -15, 42, 48, 2, -37, 18, 44, -43, 31, 47, -34, -28, 35, 38, 7, -23, -27, 9]}]', '[{"Name":"LOWER", "Data":[-22, 2, -15, -21, -10, 2, -37, 18, 27, -43, -29, 14, -34, -28, -36, -26, 7, -27, -27, 9]}, {"Name":"HIGHER", "Data":[3, 22, 41, 42, 48, 10, 0, 24, 44, -18, 31, 47, -1, 49, 35, 38, 41, -23, 25, 43]}]'),
((select Id from AlphaChallenges where Name = 'Comparitator'), '[{"Name":"A", "Data":[904, -508, 963, -522, 192, 679, 70, -493, 153, -342, -408, -127, -783, -716, 565, -472, -220, 658, -421, -60, 928, 847, 891, -899, 897, -50, -96, -371, -782, 778, 767, -308, -531, -265, 94, 304, 697, -116, 191, 942, -979, -241, -390, 392, 898, -391, 912, 810, -913, 683, -776, 568, 766, -410, -508, 265, 822, 258, -592, 650, -180, -110, 834, 214, 844, 361, 215, 35, 954, -766, 906, 567, -695, -380, -437, 56, 193, -290, 122, -399, 398, -25, 149, -937, -608, -343, 499, -788, 803, 734, -668, -738, -397, 351, -127, -284, -373, 192, 95, 943, 567, 340, 732, -843, 366, -333, 932, 937, 174, 788, 951, 314, -622, 339, 23, 83, -979, -725, -160, 949, -528, 479, 382, -641, -285, 306, 33, 443, -650, -299, 304, 527, 412, 553, -12, -590, 717, 936, 29, 906, -472, -726, 408, 699, 150, 900, -7, -873, -965, -770, -573, 129, 527, -542, -131, 103, -833, -448, -1000, -230, 536, 688, 463, 0, -984, -343, 164, -264, -348, -452, 617, -461, 848, 596, 115, 336, -574, -626, 159, -522, -931, -476, -728, 60, 117, 954, -376, 234, 29, -132, 95, -393, 464, -694, 974, -849, 196, 744, -307, 691, 230, -553, -721, -406, 200, 459, -709, -770, -226, 385, 903, -363, -948, 767, -724, -300, 775, 763, 252, 929, 380, 674, 301, 5, 289, -766, 967, 982, 303, 18, -332, 169, 437, -970, 825, 244, -731, -596, 691, 960, 114, -84, -142, 553, -319, -193, 618, -269, -277, 963, 614, -532, 323, 413, 674, 227, 74, -840, 692, 435, -621, 428, -90, -11, -564, -943, -832, -391, 911, 215, 625, 389, -726, 617, -287, -285, -683, -661, 602, 68, 146, 830, -728, 981, 777, 936, -986, 446, -527, 411, 184, 183, 692, -601, 833, 689, -654, 458, -982, 612, 27, 992, -21, 153, -37, 419, 773, -228, -158, 31, 219, -459, 947, -533, 169, 216, -211, -516, -132, 689, -998, 527, 21, 440, 313, -898, -909, -851, 897, 811, -287, -795, -531, 568, -64, 431, 642, -515, -624, -682, -887, 233, -807, 182, 377, -17, -288, 467, -111, 266, -665, 75, 363, -217, -192, -600, -847, -615, 5, -769, -910, 320, 850, 726, 729, -832, -236, -86, -311, -53, -839, 586, -557, -48, 413, -427, 252, -838, 259, 980, -685, 64, 582, 673, -62, 190, 593, 443, 16, 169, -54, -201, -290, -388, -717, 779, 502, -351, -815, 839, -157, -628, 497, -814, -500, 854, 267, -130, -278, -390, 567, 448, -152, -909, -325, -286, 483, 734, -61, -470, -112, -775, 746, -790, -26, 767, -603, -590, 873, 889, -564, -393, -564, 127, 813, 445, 569, 764, -335, 18, -118, -95, 177, -734, -298, -296, 688, 91, 880, 611, -59, -84, 446, -840, -176, -729, -853, -31, 643, -99, -361, -650, -8, -208, -928, 505, 781, -237, 136, -75, -305, 977, 179, 938, -234, 10, -859, 258, -742, -285, 531, -552, 286, 923, 837, 611, -857, -253, 114, 712, 798, -448, -523, 163, 860, 782, -234, -688, -115, -689]}, {"Name":"B", "Data":[753, 985, 143, 463, 440, -944, -440, 713, 165, 782, -20, 1, 532, -586, 122, -295, 418, -395, 686, 991, -992, 977, 107, -949, 176, -51, 701, -827, 558, 255, 109, -182, 132, -543, 676, -705, 852, 620, -220, -229, 201, 162, 797, -866, 612, 935, 692, -143, 907, -988, 850, 867, 35, 676, 431, -701, 297, 854, 101, 517, 997, 132, 141, -447, 775, -422, 465, 926, 46, -563, -578, -99, -189, 67, -953, -998, -272, -753, -173, -905, 485, -369, -75, 141, 214, -616, 864, 405, -95, -501, 148, -3, -472, 103, 802, 72, -815, -967, 163, -739, 893, 970, -496, 401, 606, 188, 445, -231, -170, -746, 891, -979, -580, -457, 607, -840, -933, -714, 79, -263, -924, 65, -624, -530, 875, -243, 8, 691, 379, -870, -960, 950, 882, 493, 724, 734, -839, -931, -291, 116, -140, 773, -652, -288, 992, 483, -968, 378, -636, -16, 498, -35, -175, 256, -864, -315, -566, -303, -702, -534, 989, 446, 937, 743, -798, 807, -968, -672, 911, -269, -335, 208, -227, 525, 343, -882, 971, 30, -814, -208, 411, 973, -730, -500, -943, -202, 595, -895, 373, -46, -135, -762, -763, 452, 225, 437, 152, -549, -437, -494, -279, -621, -50, -771, -750, -603, -63, -889, -241, 213, -418, -671, 826, -764, 699, 680, 855, -163, 637, -219, 915, -111, -510, 99, -282, 962, 748, 219, 642, -128, 233, -657, -917, -692, -541, -527, -946, -992, -404, -633, -178, 818, -776, 353, 172, -98, 24, 738, -291, 253, -457, -709, -910, -549, 135, 757, -645, 778, -270, -149, -571, 308, -473, 846, 978, -863, 214, 154, 896, 345, -449, -440, -614, 31, 236, -279, 962, -247, -344, 145, -991, 122, -694, 607, 886, -753, -215, -532, 533, 452, -87, 909, 936, -85, 850, -447, -301, 888, 761, 929, 125, 509, -580, -60, 913, -547, -191, 61, -72, -691, -280, -291, -396, -540, 54, -878, -318, -413, 124, 200, -655, -985, 471, 779, 933, -435, 384, 664, -226, -847, -917, -504, -561, -579, -635, 847, 428, -686, 661, 185, 894, 721, -895, 316, 305, 52, -81, 75, 525, 285, 362, -400, 709, -607, -481, 757, 585, -748, 958, 528, 261, -334, -260, -94, -184, 218, -57, -328, -671, 191, 918, -692, 146, -10, 25, 873, -558, 13, -51, 238, -977, 270, -821, 581, 856, 895, 456, -73, -483, 695, 763, 193, -35, 906, 388, 605, 589, 598, 678, 746, 76, 189, 710, 384, 666, -811, -142, -231, -499, -779, -301, 626, -569, 96, 878, 623, 149, -502, 444, -643, 271, 942, 931, 564, -115, -741, 362, 893, -60, -491, 359, 395, -239, -566, 414, -70, -792, -11, -686, 754, -652, -897, 431, -534, 197, 872, 821, -876, -807, 979, 528, 75, -81, 794, -64, 573, -171, 940, 990, 642, 639, -825, 212, -332, -193, -441, -876, -633, 143, -580, -302, 15, 584, 361, -885, -905, 283, 289, -445, 702, 33, 141, 721, 893, 391, -41, 168, 378, -518, -477, -720, 282, 113, 966, -308, -909, -883, -781, -867, 654]}]', '[{"Name":"LOWER", "Data":[753, -508, 143, -522, 192, -944, -440, -493, 153, -342, -408, -127, -783, -716, 122, -472, -220, -395, -421, -60, -992, 847, 107, -949, 176, -51, -96, -827, -782, 255, 109, -308, -531, -543, 94, -705, 697, -116, -220, -229, -979, -241, -390, -866, 612, -391, 692, -143, -913, -988, -776, 568, 35, -410, -508, -701, 297, 258, -592, 517, -180, -110, 141, -447, 775, -422, 215, 35, 46, -766, -578, -99, -695, -380, -953, -998, -272, -753, -173, -905, 398, -369, -75, -937, -608, -616, 499, -788, -95, -501, -668, -738, -472, 103, -127, -284, -815, -967, 95, -739, 567, 340, -496, -843, 366, -333, 445, -231, -170, -746, 891, -979, -622, -457, 23, -840, -979, -725, -160, -263, -924, 65, -624, -641, -285, -243, 8, 443, -650, -870, -960, 527, 412, 493, -12, -590, -839, -931, -291, 116, -472, -726, -652, -288, 150, 483, -968, -873, -965, -770, -573, -35, -175, -542, -864, -315, -833, -448, -1000, -534, 536, 446, 463, 0, -984, -343, -968, -672, -348, -452, -335, -461, -227, 525, 115, -882, -574, -626, -814, -522, -931, -476, -730, -500, -943, -202, -376, -895, 29, -132, -135, -762, -763, -694, 225, -849, 152, -549, -437, -494, -279, -621, -721, -771, -750, -603, -709, -889, -241, 213, -418, -671, -948, -764, -724, -300, 775, -163, 252, -219, 380, -111, -510, 5, -282, -766, 748, 219, 303, -128, -332, -657, -917, -970, -541, -527, -946, -992, -404, -633, -178, -84, -776, 353, -319, -193, 24, -269, -291, 253, -457, -709, -910, -549, 135, 227, -645, -840, -270, -149, -621, 308, -473, -11, -564, -943, -832, -391, 896, 215, -449, -440, -726, 31, -287, -285, -683, -661, -344, 68, -991, 122, -728, 607, 777, -753, -986, -532, -527, 411, -87, 183, 692, -601, 833, -447, -654, 458, -982, 612, 27, 509, -580, -60, -37, -547, -191, -228, -158, -691, -280, -459, -396, -540, 54, -878, -318, -516, -132, 200, -998, -985, 21, 440, 313, -898, -909, -851, -226, -847, -917, -795, -561, -579, -635, 431, 428, -686, -624, -682, -887, 233, -895, 182, 305, -17, -288, 75, -111, 266, -665, -400, 363, -607, -481, -600, -847, -748, 5, -769, -910, -334, -260, -94, -184, -832, -236, -328, -671, -53, -839, -692, -557, -48, 25, -427, -558, -838, -51, 238, -977, 64, -821, 581, -62, 190, 456, -73, -483, 169, -54, -201, -290, -388, -717, 605, 502, -351, -815, 746, -157, -628, 497, -814, -500, -811, -142, -231, -499, -779, -301, 448, -569, -909, -325, -286, 149, -502, -61, -643, -112, -775, 746, -790, -115, -741, -603, -590, -60, -491, -564, -393, -564, -566, 414, -70, -792, -11, -686, 18, -652, -897, 177, -734, -298, -296, 688, -876, -807, 611, -59, -84, -81, -840, -176, -729, -853, -31, 643, -99, -361, -825, -8, -332, -928, -441, -876, -633, 136, -580, -305, 15, 179, 361, -885, -905, -859, 258, -742, -285, 33, -552, 286, 893, 391, -41, -857, -253, -518, -477, -720, -448, -523, 163, -308, -909, -883, -781, -867, -689]}, {"Name":"HIGHER", "Data":[904, 985, 963, 463, 440, 679, 70, 713, 165, 782, -20, 1, 532, -586, 565, -295, 418, 658, 686, 991, 928, 977, 891, -899, 897, -50, 701, -371, 558, 778, 767, -182, 132, -265, 676, 304, 852, 620, 191, 942, 201, 162, 797, 392, 898, 935, 912, 810, 907, 683, 850, 867, 766, 676, 431, 265, 822, 854, 101, 650, 997, 132, 834, 214, 844, 361, 465, 926, 954, -563, 906, 567, -189, 67, -437, 56, 193, -290, 122, -399, 485, -25, 149, 141, 214, -343, 864, 405, 803, 734, 148, -3, -397, 351, 802, 72, -373, 192, 163, 943, 893, 970, 732, 401, 606, 188, 932, 937, 174, 788, 951, 314, -580, 339, 607, 83, -933, -714, 79, 949, -528, 479, 382, -530, 875, 306, 33, 691, 379, -299, 304, 950, 882, 553, 724, 734, 717, 936, 29, 906, -140, 773, 408, 699, 992, 900, -7, 378, -636, -16, 498, 129, 527, 256, -131, 103, -566, -303, -702, -230, 989, 688, 937, 743, -798, 807, 164, -264, 911, -269, 617, 208, 848, 596, 343, 336, 971, 30, 159, -208, 411, 973, -728, 60, 117, 954, 595, 234, 373, -46, 95, -393, 464, 452, 974, 437, 196, 744, -307, 691, 230, -553, -50, -406, 200, 459, -63, -770, -226, 385, 903, -363, 826, 767, 699, 680, 855, 763, 637, 929, 915, 674, 301, 99, 289, 962, 967, 982, 642, 18, 233, 169, 437, -692, 825, 244, -731, -596, 691, 960, 114, 818, -142, 553, 172, -98, 618, 738, -277, 963, 614, -532, 323, 413, 674, 757, 74, 778, 692, 435, -571, 428, -90, 846, 978, -863, 214, 154, 911, 345, 625, 389, -614, 617, 236, -279, 962, -247, 602, 145, 146, 830, -694, 981, 886, 936, -215, 446, 533, 452, 184, 909, 936, -85, 850, 689, -301, 888, 761, 929, 125, 992, -21, 153, 913, 419, 773, 61, -72, 31, 219, -291, 947, -533, 169, 216, -211, -413, 124, 689, -655, 527, 471, 779, 933, -435, 384, 664, 897, 811, -287, -504, -531, 568, -64, 847, 642, -515, 661, 185, 894, 721, -807, 316, 377, 52, -81, 467, 525, 285, 362, 75, 709, -217, -192, 757, 585, -615, 958, 528, 261, 320, 850, 726, 729, 218, -57, -86, -311, 191, 918, 586, 146, -10, 413, 873, 252, 13, 259, 980, -685, 270, 582, 673, 856, 895, 593, 443, 16, 695, 763, 193, -35, 906, 388, 779, 589, 598, 678, 839, 76, 189, 710, 384, 666, 854, 267, -130, -278, -390, 567, 626, -152, 96, 878, 623, 483, 734, 444, -470, 271, 942, 931, 564, -26, 767, 362, 893, 873, 889, 359, 395, -239, 127, 813, 445, 569, 764, -335, 754, -118, -95, 431, -534, 197, 872, 821, 91, 880, 979, 528, 75, 446, 794, -64, 573, -171, 940, 990, 642, 639, -650, 212, -208, -193, 505, 781, -237, 143, -75, -302, 977, 584, 938, -234, 10, 283, 289, -445, 702, 531, 141, 721, 923, 837, 611, 168, 378, 114, 712, 798, 282, 113, 966, 860, 782, -234, -688, -115, 654]}]'),
((select Id from AlphaChallenges where Name = 'Comparitator'), '[{"Name":"A", "Data":[0, 2, 1, 2, 2, 2, 0, 2, 2, 2, 0, 0, 2, 2, 1, 2, 1, 1, 1, 1]}, {"Name":"B", "Data":[0, 1, 1, 2, 0, 1, 1, 0, 1, 0, 0, 0, 2, 0, 2, 1, 0, 1, 2, 1]}]', '[{"Name":"LOWER", "Data":[1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1]}, {"Name":"HIGHER", "Data":[2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2]}]');
*/
/*
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{some_of_you_might_remember_RL_and_RR_instructions}', (select Id from AlphaChallenges where Name = 'Comparitator'), 'A previous version of O-77/e had rotate left and rotate right instructions to complement the shift left and shift right instructions.
Eg: Right rotation of 0001_0111_0111 by 3 is the number 1110_0010_1110.
Read a value from VALUE and an amount to rotate from ROT. Left rotate VALUE by ROT.',
'[{"Name":"VALUES", "Data":[1525, 1318, -1159, -149, -414]}, {"Name":"ROT", "Data":[5, 8, 12, 0, 1]}]', '[{"Name":"OUTPUT", "Data":[-341, 1618, -1159, -149, -827]}]',
'The Machine', 'Rotatitator', 10)
insert into AlphaChallengeTests (AlphaChallengeId, InputTextJson, OutputTextJson)
values ((select Id from AlphaChallenges where Name = 'Rotatitator'), '[{"Name":"VALUES", "Data":[1525, 1318, -1159, -149, -414]}, {"Name":"ROT", "Data":[5, 8, 12, 0, 1]}]', '[{"Name":"OUTPUT", "Data":[-341, 1618, -1159, -149, -827]}]'),
((select Id from AlphaChallenges where Name = 'Rotatitator'), '[{"Name":"VALUES", "Data":[722, 710, 342, 657, 114, -1255, 1303, 448, -1395, 197]}, {"Name":"ROT", "Data":[6, 2, 6, 6, 12, 4, 8, 5, 6, 0]}]', '[{"Name":"OUTPUT", "Data":[1163, -1256, 1413, 1098, 114, 411, 1873, -2045, 874, 197]}]'),
((select Id from AlphaChallenges where Name = 'Rotatitator'), '[{"Name":"VALUES", "Data":[-60, 1948, 353, -415, -606, -1570, 217, -100, 529, -849, 1393, -1353, 1816, 1989, -2000, -821, 1279, -345, 2020, 955, 1038, -494, 2022, -1705, 1679, 1634, 535, -1676, 1239, 1266, 1594, 399, -1487, -438, 962, 444, 97, -1432, 1005, -1912]}, {"Name":"ROT", "Data":[12, 6, 4, 6, 12, 5, 12, 6, 8, 6, 6, 6, 5, 7, 10, 10, 6, 1, 11, 9, 11, 6, 5, 3, 9, 12, 3, 11, 10, 6, 9, 9, 11, 1, 4, 0, 3, 7, 3, 0]}]', '[{"Name":"OUTPUT", "Data":[-60, 1822, 1553, -1927, -606, -1069, 217, 1854, 289, -1038, -939, -534, 782, 702, 524, -206, -45, -689, 1010, 1655, 519, 1208, -817, -1348, -303, 1634, 185, 1210, -715, -877, 1223, -463, -744, -875, -989, 444, 776, 1107, -151, -1912]}]')
*/
/*
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{Racing_The_Beam}', (select Id from AlphaChallenges where Name = 'Comparitator'), 'The component you''re replacing used to signal which of the 4 input lanes was high. When S0 is 1, write a 0 to HISIG. When S1 is 1, write a 1 to HISIG, etc.
Don''t write any output if none of S0, S1, S2, or S3 are 1.',
'[{"Name":"S0", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]}, {"Name":"S1", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}, {"Name":"S2", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}, {"Name":"S3", "Data":[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}]',
'[{"Name":"HISIG", "Data":[3, 0, 0, 3, 2, 0, 2, 0, 3, 0]}]', 'The Machine', 'Signal Time Compressor', 20)
insert into AlphaChallengeTests (AlphaChallengeId, InputTextJson, OutputTextJson)
values ((select Id from AlphaChallenges where Name = 'Signal Time Compressor'), '[{"Name":"S0", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1]}, {"Name":"S1", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}, {"Name":"S2", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}, {"Name":"S3", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}]', '[{"Name":"HISIG", "Data":[2,0,0,0,0]}]'),
((select Id from AlphaChallenges where Name = 'Signal Time Compressor'), '[{"Name":"S0", "Data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]}]', '[{"Name":"HISIG", "Data":[2, 3, 1, 0, 3, 1, 3, 0, 2, 1, 0, 0, 3, 2, 2, 0, 0, 0, 1, 3, 3, 3, 0, 1, 2, 1, 1, 2, 2, 2, 3, 2, 2, 0, 2, 1, 3, 1, 2, 2, 3, 2, 3, 3, 2, 3, 2, 1, 3, 3]}]')
*/
/*
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{a_b_c_its_as_easy_as_1_2_3}', (select Id from AlphaChallenges where Name = 'Comparitator'), 'This component read values from TOSORT, 3 at a time. It sorted these values and then output them in ascending order to SORTED.
Implement this as an infinite loop',
'[{"Name":"TOSORT", "Data":[100, 300, 200, 0, 1, 0, 3, 0, -3]}]', '[{"Name":"SORTED", "Data":[100, 200, 200, 0, 0, 1, -3, 0, 3]}]',
'The Machine', 'Out of Sorts', 5)
insert into AlphaChallengeTests (AlphaChallengeId, InputTextJson, OutputTextJson)
values ((select Id from AlphaChallenges where Name = 'Out of Sorts'), '[{"Name":"TOSORT", "Data":[100, 300, 200, 0, 1, 0, 3, 0, -3]}]', '[{"Name":"SORTED", "Data":[100, 200, 200, 0, 0, 1, -3, 0, 3]}]'),
((select Id from AlphaChallenges where Name = 'Out of Sorts'), '[{"Name":"TOSORT", "Data":[1, 2, 3, 1, 3, 2, 2, 1, 3, 2, 3, 1, 3, 1, 2, 3, 2, 1]}]', '[{"Name":"SORTED", "Data":[1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3]}]'),
((select Id from AlphaChallenges where Name = 'Out of Sorts'), '[{"Name":"TOSORT", "Data":[0,0,0, 0,0,1, 0,1,0, 1,0,0, 0,1,1, 1,0,1, 1,1,0]}]', '[{"Name":"SORTED", "Data":[0,0,0, 0,0,1, 0,0,1, 0,0,1, 0,1,1, 0,1,1, 0,1,1]}]')
*/
/*
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{personally_I_prefer_othello}', (select Id from AlphaChallenges where Name = 'Comparitator'), 'This component is really strange. It takes in 5 words and outputs them in reverse order. Given that the O-77/e only has 4 registers, I''m not sure how that''s possible.',
'[{"Name":"TOP", "Data":[1,2,3,4,5]}, {"Name":"BOTTOM", "DATA":[]}]', '[{"Name":"REVERSED", "Data":[5,4,3,2,1]}]', 'The Machine', 'Reversi', 15)
insert into AlphaChallengeTests (AlphaChallengeId, InputTextJson, OutputTextJson)
values ((select Id from AlphaChallenges where Name = 'Signal Time Compressor'), '[{"Name":"TOP", "Data":[1,2,3,4,5]}, {"Name":"BOTTOM", "DATA":[]}]', '[{"Name":"REVERSED", "Data":[5,4,3,2,1]}]'),
((select Id from AlphaChallenges where Name = 'Reversi'), '[{"Name":"TOP", "Data":[0,1,10,100,1000]}, {"Name":"BOTTOM", "DATA":[]}]', '[{"Name":"REVERSED", "Data":[1000,100,10,1,0]}]'),
((select Id from AlphaChallenges where Name = 'Reversi'), '[{"Name":"TOP", "Data":[8,13,34,13,8]}, {"Name":"BOTTOM", "DATA":[]}]', '[{"Name":"REVERSED", "Data":[8,13,34,13,8]}]'),
((select Id from AlphaChallenges where Name = 'Reversi'), '[{"Name":"TOP", "Data":[9,8,7,6,5]}, {"Name":"BOTTOM", "DATA":[]}]', '[{"Name":"REVERSED", "Data":[5,6,7,8,9]}]'),
((select Id from AlphaChallenges where Name = 'Reversi'), '[{"Name":"TOP", "Data":[0,9,-9,10,-10]}, {"Name":"BOTTOM", "DATA":[]}]', '[{"Name":"REVERSED", "Data":[-10,10,-9,9,0]}]')
*/
/*
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{i_hate_bcd_and_now_you_do_too}', (select Id from AlphaChallenges where Name = 'Comparitator'), 'Why would she even make something like this?
Values in the BCD port are represented in Binary-Coded-Decimal. Values in the BIN port are in binary. Your task is 2-fold: Conver the BCD representation to its binary value and output that to BINOUT, and then output to CMP 1 if the value in BIN is equal to the value represented in BCD, or 0 if it''s not.
Implement this as an infinite loop.',
'[{"Name":"BCD", "Data":[1,2,16,32,34,1904,0]}, {"Name":"BIN", "DATA":[1,4,10,20,780,-1]}]', '[{"Name":"BINOUT", "Data":[1,2,10,20,22,770,0]}, {"Name":"CMP", "DATA":[1,0,1,1,0,0]}]',
'The Machine', 'BCD Madness', 18)
insert into AlphaChallengeTests (AlphaChallengeId, InputTextJson, OutputTextJson)
values ((select Id from AlphaChallenges where Name = 'BCD Madness'), '[{"Name":"BCD", "Data":[337, 323, 866, 1925, 1425, 841, 1033, 1874, 1428, 1940]}, {"Name":"BIN", "DATA":[151, 143, 362, 785, 591, 349, 409, 752, 594, 794]}]', '[{"Name":"BINOUT", "Data":[151, 143, 362, 785, 591, 349, 409, 752, 594, 794]}, {"Name":"CMP", "DATA":[1,1,1,1,1,1,1,1,1,1]}]'),
((select Id from AlphaChallenges where Name = 'BCD Madness'), '[{"Name":"BCD", "Data":[1303, 532, 565, 273, 1926, 1088, 1809, 22, 565, 1795]}, {"Name":"BIN", "DATA":[1,1,1,1,1,1,1,1,1,1]}]', '[{"Name":"BINOUT", "Data":[517, 214, 235, 111, 786, 440, 711, 16, 235, 703]}, {"Name":"CMP", "DATA":[0,0,0,0,0,0,0,0,0,0]}]'),
((select Id from AlphaChallenges where Name = 'BCD Madness'), '[{"Name":"BCD", "Data":[1303, 532, 565, 273, 1926, 1088, 1809, 22, 565, 1795]}, {"Name":"BIN", "DATA":[517,214,1,111,1,440,1,1,1,1]}]', '[{"Name":"BINOUT", "Data":[517, 214, 235, 111, 786, 440, 711, 16, 235, 703]}, {"Name":"CMP", "DATA":[1,1,0,1,0,1,0,0,0,0]}]')
*/
/*
-- Attempt 1 at Integretator. I think it's not possible to use separate time values and linearly approximate.
insert into AlphaChallenges (Flag, PredecessorId, Description, InputTextJson, OutputTextJson, Category, Name, [Order])
values ('FLAG{sk00l_iz_for_chumps!}', (select Id from AlphaChallenges where Name = 'Comparitator'), 'The board you''re replacing is a linear integral approximator. The physical board that it was connected to had an oscillating measure that it is constantly reporting the current velocity of.
The velocity of the measure arrives in the VEL port, and the time that measurement was taken is sent to the TIME port. Your goal is to integrate the VEL values with respect to TIME, determining the position of the measure at each TIME, and writing it to POS.',
'[{"Name":"VEL", "Data":[0,0,2,3,5,7,3,1,2,0]}, {"Name":"TIME", "Data":[0,1,2,4,5,9,10,11,13,15]}]', '[{"Name":"POS", "Data":[0,0,1,6,10,34,39,41,44,46]}]',
'The Machine', 'Integretator', 30)
*/
select * from AlphaChallenges order by Category, [Order]
select a.*, Name from AlphaChallengeTests a join AlphaChallenges b on b.Id = a.AlphaChallengeId order by b.Category, b.[Order]
select * from CompletedChallenges