-
Notifications
You must be signed in to change notification settings - Fork 2
/
bonus.rb
1246 lines (1244 loc) · 11.9 KB
/
bonus.rb
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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
require_relative 'lib/assembunny'
assembler = Assembunny::Interpreter.new((ARGV.empty? ? DATA : ARGF).readlines)
_, out = assembler.run(
{a: 0, b: 0, c: 0, d: 0},
outs: :store,
)
puts out.pack('c*')
__END__
cpy -1232 d
jnz 1 1228
cpy 1 a
cpy -1187 d
jnz 1 1158
out 120
cpy 1 a
cpy -1183 d
jnz 1 1154
out 10
cpy -1194 d
jnz 1 1182
cpy 0 a
cpy -1177 d
jnz 1 1148
cpy -1211 d
jnz 1 1208
cpy 4 a
cpy -1172 d
jnz 1 1143
out 10
cpy -1211 d
jnz 1 1207
cpy 1 a
cpy -1166 d
jnz 1 1137
out 120
cpy 1 a
cpy -1162 d
jnz 1 1133
out 10
cpy -1173 d
jnz 1 1161
cpy 0 a
cpy -1156 d
jnz 1 1127
cpy -1190 d
jnz 1 1187
cpy 7 a
cpy -1151 d
jnz 1 1122
out 10
cpy -1190 d
jnz 1 1186
cpy 1 a
cpy -1145 d
jnz 1 1116
out 120
cpy 1 a
cpy -1141 d
jnz 1 1112
out 10
cpy -1152 d
jnz 1 1140
cpy 0 a
cpy -1135 d
jnz 1 1106
cpy -1169 d
jnz 1 1166
cpy 10 a
cpy -1130 d
jnz 1 1101
out 10
cpy -1169 d
jnz 1 1165
cpy 1 a
cpy -1124 d
jnz 1 1095
out 120
cpy 1 a
cpy -1120 d
jnz 1 1091
out 10
cpy -1131 d
jnz 1 1119
cpy 0 a
cpy -1114 d
jnz 1 1085
cpy -1148 d
jnz 1 1145
cpy 2 a
cpy -1109 d
jnz 1 1080
out 10
cpy -1148 d
jnz 1 1144
cpy 1 a
cpy -1103 d
jnz 1 1074
out 120
cpy 1 a
cpy -1099 d
jnz 1 1070
out 10
cpy -1110 d
jnz 1 1098
cpy 0 a
cpy -1093 d
jnz 1 1064
cpy -1127 d
jnz 1 1124
cpy 5 a
cpy -1088 d
jnz 1 1059
out 10
cpy -1127 d
jnz 1 1123
cpy 1 a
cpy -1082 d
jnz 1 1053
out 120
cpy 1 a
cpy -1078 d
jnz 1 1049
out 10
cpy -1089 d
jnz 1 1077
cpy 0 a
cpy -1072 d
jnz 1 1043
cpy -1106 d
jnz 1 1103
cpy 4 a
cpy -1067 d
jnz 1 1038
out 10
cpy -1106 d
jnz 1 1102
cpy 1 a
cpy -1061 d
jnz 1 1032
out 120
cpy 1 a
cpy -1057 d
jnz 1 1028
out 10
cpy -1068 d
jnz 1 1056
cpy 0 a
cpy -1051 d
jnz 1 1022
cpy -1085 d
jnz 1 1082
cpy 2 a
cpy -1046 d
jnz 1 1017
out 10
cpy -1085 d
jnz 1 1081
cpy 1 a
cpy -1040 d
jnz 1 1011
out 120
cpy 1 a
cpy -1036 d
jnz 1 1007
out 10
cpy -1047 d
jnz 1 1035
cpy 0 a
cpy -1030 d
jnz 1 1001
cpy -1064 d
jnz 1 1061
cpy 4 a
cpy -1025 d
jnz 1 996
out 10
cpy -1064 d
jnz 1 1060
cpy 1 a
cpy -1019 d
jnz 1 990
out 120
cpy 1 a
cpy -1015 d
jnz 1 986
out 10
cpy -1026 d
jnz 1 1014
cpy 0 a
cpy -1009 d
jnz 1 980
cpy -1043 d
jnz 1 1040
cpy 4 a
cpy -1004 d
jnz 1 975
out 10
cpy -1043 d
jnz 1 1039
cpy 1 a
cpy -998 d
jnz 1 969
out 120
cpy 2 a
cpy -994 d
jnz 1 965
out 10
cpy -1005 d
jnz 1 993
cpy 0 a
cpy -988 d
jnz 1 959
cpy -1022 d
jnz 1 1019
cpy 29 a
cpy -983 d
jnz 1 954
out 10
cpy -1011 d
jnz 1 996
cpy 17 a
cpy -977 d
jnz 1 948
cpy -1011 d
jnz 1 1008
cpy 2 a
cpy -972 d
jnz 1 943
out 10
cpy -1000 d
jnz 1 985
cpy 10 a
cpy -966 d
jnz 1 937
cpy -1000 d
jnz 1 997
cpy 1 a
cpy -961 d
jnz 1 932
out 10
cpy -989 d
jnz 1 974
cpy 0 a
cpy -955 d
jnz 1 926
cpy -989 d
jnz 1 986
cpy 1 a
cpy -950 d
jnz 1 921
out 10
cpy -989 d
jnz 1 985
cpy 20 a
cpy -944 d
jnz 1 915
out 120
cpy 1 a
cpy -940 d
jnz 1 911
out 10
cpy -951 d
jnz 1 939
cpy 2 a
cpy -934 d
jnz 1 905
cpy -968 d
jnz 1 965
cpy 4 a
cpy -929 d
jnz 1 900
out 10
cpy -940 d
jnz 1 928
cpy 1 a
cpy -923 d
jnz 1 894
cpy -957 d
jnz 1 954
cpy 5 a
cpy -918 d
jnz 1 889
out 10
cpy -929 d
jnz 1 917
cpy 0 a
cpy -912 d
jnz 1 883
cpy -946 d
jnz 1 943
cpy 3 a
cpy -907 d
jnz 1 878
out 10
cpy -946 d
jnz 1 942
cpy 1 a
cpy -901 d
jnz 1 872
out 120
cpy 4 a
cpy -897 d
jnz 1 868
out 10
cpy -925 d
jnz 1 910
cpy 32 a
cpy -891 d
jnz 1 862
cpy -925 d
jnz 1 922
cpy 1 a
cpy -886 d
jnz 1 857
out 10
cpy -897 d
jnz 1 885
cpy 3 a
cpy -880 d
jnz 1 851
cpy -914 d
jnz 1 911
cpy 30 a
cpy -875 d
jnz 1 846
out 10
cpy -886 d
jnz 1 874
cpy 1 a
cpy -869 d
jnz 1 840
cpy -903 d
jnz 1 900
cpy 18 a
cpy -864 d
jnz 1 835
out 10
cpy -875 d
jnz 1 863
cpy 0 a
cpy -858 d
jnz 1 829
cpy -892 d
jnz 1 889
cpy 14 a
cpy -853 d
jnz 1 824
out 10
cpy -881 d
jnz 1 866
cpy 10 a
cpy -847 d
jnz 1 818
cpy -881 d
jnz 1 878
cpy 3 a
cpy -842 d
jnz 1 813
out 10
cpy -870 d
jnz 1 855
cpy 6 a
cpy -836 d
jnz 1 807
cpy -870 d
jnz 1 867
cpy 3 a
cpy -831 d
jnz 1 802
out 10
cpy -859 d
jnz 1 844
cpy 4 a
cpy -825 d
jnz 1 796
cpy -859 d
jnz 1 856
cpy 1 a
cpy -820 d
jnz 1 791
out 10
cpy -848 d
jnz 1 833
cpy 0 a
cpy -814 d
jnz 1 785
cpy -848 d
jnz 1 845
cpy 1 a
cpy -809 d
jnz 1 780
out 10
cpy -848 d
jnz 1 844
cpy 12 a
cpy -803 d
jnz 1 774
out 120
cpy 1 a
cpy -799 d
jnz 1 770
out 10
cpy -810 d
jnz 1 798
cpy 2 a
cpy -793 d
jnz 1 764
cpy -827 d
jnz 1 824
cpy 29 a
cpy -788 d
jnz 1 759
out 10
cpy -816 d
jnz 1 801
cpy 5 a
cpy -782 d
jnz 1 753
cpy -816 d
jnz 1 813
cpy 2 a
cpy -777 d
jnz 1 748
out 10
cpy -788 d
jnz 1 776
cpy 2 a
cpy -771 d
jnz 1 742
cpy -805 d
jnz 1 802
cpy 21 a
cpy -766 d
jnz 1 737
out 10
cpy -794 d
jnz 1 779
cpy 15 a
cpy -760 d
jnz 1 731
cpy -794 d
jnz 1 791
cpy 3 a
cpy -755 d
jnz 1 726
out 10
cpy -783 d
jnz 1 768
cpy 2 a
cpy -749 d
jnz 1 720
cpy -783 d
jnz 1 780
cpy 2 a
cpy -744 d
jnz 1 715
out 10
cpy -755 d
jnz 1 743
cpy 3 a
cpy -738 d
jnz 1 709
cpy -772 d
jnz 1 769
cpy 20 a
cpy -733 d
jnz 1 704
out 10
cpy -744 d
jnz 1 732
cpy 2 a
cpy -727 d
jnz 1 698
cpy -761 d
jnz 1 758
cpy 29 a
cpy -722 d
jnz 1 693
out 10
cpy -733 d
jnz 1 721
cpy 0 a
cpy -716 d
jnz 1 687
cpy -750 d
jnz 1 747
cpy 47 a
cpy -711 d
jnz 1 682
out 10
cpy -739 d
jnz 1 724
cpy 11 a
cpy -705 d
jnz 1 676
cpy -739 d
jnz 1 736
cpy 3 a
cpy -700 d
jnz 1 671
out 10
cpy -728 d
jnz 1 713
cpy 8 a
cpy -694 d
jnz 1 665
cpy -728 d
jnz 1 725
cpy 3 a
cpy -689 d
jnz 1 660
out 10
cpy -717 d
jnz 1 702
cpy 7 a
cpy -683 d
jnz 1 654
cpy -717 d
jnz 1 714
cpy 1 a
cpy -678 d
jnz 1 649
out 10
cpy -706 d
jnz 1 691
cpy 6 a
cpy -672 d
jnz 1 643
cpy -706 d
jnz 1 703
cpy 2 a
cpy -667 d
jnz 1 638
out 10
cpy -695 d
jnz 1 680
cpy 5 a
cpy -661 d
jnz 1 632
cpy -695 d
jnz 1 692
cpy 1 a
cpy -656 d
jnz 1 627
out 10
cpy -684 d
jnz 1 669
cpy 4 a
cpy -650 d
jnz 1 621
cpy -684 d
jnz 1 681
cpy 2 a
cpy -645 d
jnz 1 616
out 10
cpy -673 d
jnz 1 658
cpy 3 a
cpy -639 d
jnz 1 610
cpy -673 d
jnz 1 670
cpy 1 a
cpy -634 d
jnz 1 605
out 10
cpy -662 d
jnz 1 647
cpy 1 a
cpy -628 d
jnz 1 599
cpy -662 d
jnz 1 659
cpy 3 a
cpy -623 d
jnz 1 594
out 10
cpy -651 d
jnz 1 636
cpy 0 a
cpy -617 d
jnz 1 588
cpy -651 d
jnz 1 648
cpy 1 a
cpy -612 d
jnz 1 583
out 10
cpy -651 d
jnz 1 647
cpy 13 a
cpy -606 d
jnz 1 577
out 120
cpy 1 a
cpy -602 d
jnz 1 573
out 10
cpy -630 d
jnz 1 615
cpy 10 a
cpy -596 d
jnz 1 567
cpy -630 d
jnz 1 627
cpy 2 a
cpy -591 d
jnz 1 562
out 10
cpy -619 d
jnz 1 604
cpy 9 a
cpy -585 d
jnz 1 556
cpy -619 d
jnz 1 616
cpy 2 a
cpy -580 d
jnz 1 551
out 10
cpy -591 d
jnz 1 579
cpy 0 a
cpy -574 d
jnz 1 545
cpy -608 d
jnz 1 605
cpy 3 a
cpy -569 d
jnz 1 540
out 10
cpy -597 d
jnz 1 582
cpy 27 a
cpy -563 d
jnz 1 534
cpy -597 d
jnz 1 594
cpy 1 a
cpy -558 d
jnz 1 529
out 10
cpy -569 d
jnz 1 557
cpy 4 a
cpy -552 d
jnz 1 523
cpy -586 d
jnz 1 583
cpy 9 a
cpy -547 d
jnz 1 518
out 10
cpy -558 d
jnz 1 546
cpy 3 a
cpy -541 d
jnz 1 512
cpy -575 d
jnz 1 572
cpy 1 a
cpy -536 d
jnz 1 507
out 10
cpy -547 d
jnz 1 535
cpy 2 a
cpy -530 d
jnz 1 501
cpy -564 d
jnz 1 561
cpy 1 a
cpy -525 d
jnz 1 496
out 10
cpy -536 d
jnz 1 524
cpy 1 a
cpy -519 d
jnz 1 490
cpy -553 d
jnz 1 550
cpy 2 a
cpy -514 d
jnz 1 485
out 10
cpy -525 d
jnz 1 513
cpy 0 a
cpy -508 d
jnz 1 479
cpy -542 d
jnz 1 539
cpy 1 a
cpy -503 d
jnz 1 474
out 10
cpy -542 d
jnz 1 538
cpy 1 a
cpy -497 d
jnz 1 468
out 120
cpy 5 a
cpy -493 d
jnz 1 464
out 10
cpy -521 d
jnz 1 506
cpy 33 a
cpy -487 d
jnz 1 458
cpy -521 d
jnz 1 518
cpy 1 a
cpy -482 d
jnz 1 453
out 10
cpy -510 d
jnz 1 495
cpy 30 a
cpy -476 d
jnz 1 447
cpy -510 d
jnz 1 507
cpy 4 a
cpy -471 d
jnz 1 442
out 10
cpy -499 d
jnz 1 484
cpy 24 a
cpy -465 d
jnz 1 436
cpy -499 d
jnz 1 496
cpy 1 a
cpy -460 d
jnz 1 431
out 10
cpy -488 d
jnz 1 473
cpy 23 a
cpy -454 d
jnz 1 425
cpy -488 d
jnz 1 485
cpy 1 a
cpy -449 d
jnz 1 420
out 10
cpy -477 d
jnz 1 462
cpy 18 a
cpy -443 d
jnz 1 414
cpy -477 d
jnz 1 474
cpy 1 a
cpy -438 d
jnz 1 409
out 10
cpy -466 d
jnz 1 451
cpy 8 a
cpy -432 d
jnz 1 403
cpy -466 d
jnz 1 463
cpy 1 a
cpy -427 d
jnz 1 398
out 10
cpy -438 d
jnz 1 426
cpy 4 a
cpy -421 d
jnz 1 392
cpy -455 d
jnz 1 452
cpy 23 a
cpy -416 d
jnz 1 387
out 10
cpy -427 d
jnz 1 415
cpy 3 a
cpy -410 d
jnz 1 381
cpy -444 d
jnz 1 441
cpy 1 a
cpy -405 d
jnz 1 376
out 10
cpy -416 d
jnz 1 404
cpy 2 a
cpy -399 d
jnz 1 370
cpy -433 d
jnz 1 430
cpy 1 a
cpy -394 d
jnz 1 365
out 10
cpy -405 d
jnz 1 393
cpy 1 a
cpy -388 d
jnz 1 359
cpy -422 d
jnz 1 419
cpy 3 a
cpy -383 d
jnz 1 354
out 10
cpy -394 d
jnz 1 382
cpy 0 a
cpy -377 d
jnz 1 348
cpy -411 d
jnz 1 408
cpy 1 a
cpy -372 d
jnz 1 343
out 10
cpy -411 d
jnz 1 407
cpy 1 a
cpy -366 d
jnz 1 337
out 120
cpy 6 a
cpy -362 d
jnz 1 333
out 10
cpy -390 d
jnz 1 375
cpy 40 a
cpy -356 d
jnz 1 327
cpy -390 d
jnz 1 387
cpy 2 a
cpy -351 d
jnz 1 322
out 10
cpy -379 d
jnz 1 364
cpy 30 a
cpy -345 d
jnz 1 316
cpy -379 d
jnz 1 376
cpy 2 a
cpy -340 d
jnz 1 311
out 10
cpy -368 d
jnz 1 353
cpy 17 a
cpy -334 d
jnz 1 305
cpy -368 d
jnz 1 365
cpy 2 a
cpy -329 d
jnz 1 300
out 10
cpy -357 d
jnz 1 342
cpy 16 a
cpy -323 d
jnz 1 294
cpy -357 d
jnz 1 354
cpy 2 a
cpy -318 d
jnz 1 289
out 10
cpy -329 d
jnz 1 317
cpy 5 a
cpy -312 d
jnz 1 283
cpy -346 d
jnz 1 343
cpy 37 a
cpy -307 d
jnz 1 278
out 10
cpy -318 d
jnz 1 306
cpy 4 a
cpy -301 d
jnz 1 272
cpy -335 d
jnz 1 332
cpy 5 a
cpy -296 d
jnz 1 267
out 10
cpy -307 d
jnz 1 295
cpy 3 a
cpy -290 d
jnz 1 261
cpy -324 d
jnz 1 321
cpy 5 a
cpy -285 d
jnz 1 256
out 10
cpy -296 d
jnz 1 284
cpy 2 a
cpy -279 d
jnz 1 250
cpy -313 d
jnz 1 310
cpy 25 a
cpy -274 d
jnz 1 245
out 10
cpy -285 d
jnz 1 273
cpy 1 a
cpy -268 d
jnz 1 239
cpy -302 d
jnz 1 299
cpy 5 a
cpy -263 d
jnz 1 234
out 10
cpy -274 d
jnz 1 262
cpy 0 a
cpy -257 d
jnz 1 228
cpy -291 d
jnz 1 288
cpy 5 a
cpy -252 d
jnz 1 223
out 10
cpy -280 d
jnz 1 265
cpy 41 a
cpy -246 d
jnz 1 217
cpy -280 d
jnz 1 277
cpy 4 a
cpy -241 d
jnz 1 212
out 10
cpy -269 d
jnz 1 254
cpy 38 a
cpy -235 d
jnz 1 206
cpy -269 d
jnz 1 266
cpy 5 a
cpy -230 d
jnz 1 201
out 10
cpy -258 d
jnz 1 243
cpy 36 a
cpy -224 d
jnz 1 195
cpy -258 d
jnz 1 255
cpy 5 a
cpy -219 d
jnz 1 190
out 10
cpy -247 d
jnz 1 232
cpy 33 a
cpy -213 d
jnz 1 184
cpy -247 d
jnz 1 244
cpy 1 a
cpy -208 d
jnz 1 179
out 10
cpy -236 d
jnz 1 221
cpy 32 a
cpy -202 d
jnz 1 173