day 4 part 1
This commit is contained in:
parent
b1921a7656
commit
0f255d93a1
3
04/Makefile
Normal file
3
04/Makefile
Normal file
@ -0,0 +1,3 @@
|
||||
all:
|
||||
nasm -g -felf32 main.s && ld -melf_i386 -g main.o
|
||||
|
202
04/input
Normal file
202
04/input
Normal file
@ -0,0 +1,202 @@
|
||||
Card 1: 74 8 2 86 40 25 93 17 61 32 | 65 25 73 55 75 94 54 99 53 17 89 4 44 13 15 32 57 92 8 21 74 64 5 87 24
|
||||
Card 2: 8 18 79 59 71 84 72 23 96 74 | 22 83 74 78 72 30 8 59 6 23 7 71 31 84 18 96 21 36 51 67 80 79 60 28 42
|
||||
Card 3: 63 27 56 19 85 86 40 78 67 54 | 34 32 79 64 35 46 61 31 24 41 33 44 10 56 49 36 4 82 98 54 23 21 63 86 51
|
||||
Card 4: 2 95 87 25 13 12 9 24 68 29 | 84 54 49 78 52 60 34 25 97 26 55 39 66 79 23 94 29 67 12 51 9 16 19 76 8
|
||||
Card 5: 70 92 50 61 43 16 53 71 91 7 | 17 70 62 84 82 9 14 16 56 15 63 91 77 57 58 60 96 35 88 26 51 54 59 74 80
|
||||
Card 6: 34 86 44 60 10 4 89 5 94 92 | 60 95 35 2 86 32 94 79 82 64 4 5 92 89 44 69 34 21 76 72 9 6 52 48 61
|
||||
Card 7: 99 36 57 20 46 38 26 58 72 11 | 99 70 20 58 38 67 76 36 84 27 94 11 26 35 46 21 81 31 72 62 13 10 57 54 4
|
||||
Card 8: 19 95 24 99 44 36 58 26 31 6 | 69 10 43 42 70 64 92 40 38 47 21 98 41 49 20 71 65 59 91 72 34 74 84 29 22
|
||||
Card 9: 87 77 90 73 7 27 48 1 13 55 | 96 28 40 62 19 3 25 47 80 85 68 94 82 50 12 65 84 75 83 41 91 89 55 42 48
|
||||
Card 10: 6 89 13 82 16 54 27 67 19 76 | 65 67 94 58 97 61 54 80 53 6 73 41 95 7 83 2 23 11 63 24 78 29 13 16 82
|
||||
Card 11: 27 50 4 17 31 70 18 75 91 20 | 71 85 67 80 92 6 31 48 15 70 51 7 78 34 8 72 16 62 4 52 75 39 2 82 74
|
||||
Card 12: 27 68 79 78 21 56 53 29 2 74 | 96 69 59 49 20 42 23 71 54 72 25 7 55 19 64 37 62 41 10 66 26 75 93 18 84
|
||||
Card 13: 1 75 85 51 47 45 93 11 57 80 | 97 66 4 61 42 36 12 83 86 51 99 90 52 82 30 33 20 56 44 59 18 24 28 40 41
|
||||
Card 14: 24 28 85 42 5 3 33 76 98 75 | 31 95 54 8 90 10 6 85 75 44 94 40 62 47 83 26 9 27 68 63 88 80 82 55 93
|
||||
Card 15: 52 28 90 27 6 37 44 3 51 39 | 65 44 64 85 47 20 86 83 38 49 80 21 56 30 89 69 84 93 1 48 88 76 36 77 97
|
||||
Card 16: 28 7 3 39 71 85 84 13 44 31 | 93 79 33 21 4 18 63 23 68 49 57 9 22 54 27 69 75 29 30 78 37 98 91 38 94
|
||||
Card 17: 97 20 84 50 98 82 45 22 33 60 | 53 10 68 92 43 76 99 52 38 96 31 4 25 15 11 42 69 56 62 23 29 74 51 39 40
|
||||
Card 18: 28 66 82 85 94 35 72 29 63 68 | 73 86 63 60 20 10 64 89 66 61 90 35 72 8 85 28 29 1 88 49 76 36 82 94 68
|
||||
Card 19: 58 41 33 29 38 60 3 73 10 13 | 52 73 20 51 47 75 74 26 69 18 70 24 62 53 91 85 63 1 76 5 42 43 97 10 84
|
||||
Card 20: 46 8 66 7 27 4 9 78 24 18 | 13 14 57 92 6 59 3 81 70 10 4 51 98 23 66 64 74 49 83 27 24 73 95 35 7
|
||||
Card 21: 15 32 12 47 53 89 24 58 59 18 | 47 82 1 53 58 93 44 19 12 96 13 61 15 72 75 83 65 41 54 49 71 78 68 59 79
|
||||
Card 22: 92 27 79 68 46 97 2 96 94 80 | 18 81 12 13 39 93 83 38 52 46 89 17 24 58 49 74 10 8 57 65 35 19 54 41 11
|
||||
Card 23: 92 72 68 65 54 18 34 62 41 82 | 96 32 74 10 12 8 34 55 54 83 91 22 47 68 52 21 41 65 72 97 30 70 46 18 9
|
||||
Card 24: 49 76 13 10 59 33 86 29 95 32 | 16 60 38 33 68 51 15 50 95 61 29 93 76 6 31 71 10 25 13 40 49 77 2 32 23
|
||||
Card 25: 38 66 33 7 77 73 44 50 25 76 | 20 12 63 92 61 5 88 37 75 21 41 47 73 77 13 76 31 80 60 34 93 90 54 3 45
|
||||
Card 26: 77 45 81 84 53 80 76 22 75 61 | 25 58 38 45 98 10 6 92 70 82 24 22 4 68 97 72 14 49 17 83 27 53 77 89 75
|
||||
Card 27: 60 16 79 54 85 56 92 41 26 44 | 63 44 69 60 96 7 36 2 37 5 41 73 6 51 64 56 53 76 57 99 21 30 67 85 66
|
||||
Card 28: 41 84 40 62 67 89 29 7 2 8 | 35 9 24 29 20 33 6 98 50 95 10 36 14 80 1 3 88 15 13 48 18 72 26 76 31
|
||||
Card 29: 68 66 52 34 99 70 29 58 19 98 | 88 64 1 14 79 31 44 39 45 40 21 6 97 13 73 11 48 67 8 50 10 57 51 94 91
|
||||
Card 30: 99 45 9 78 88 76 60 86 12 98 | 54 60 30 57 68 22 64 26 98 23 89 50 7 61 91 87 83 25 2 37 56 78 94 36 31
|
||||
Card 31: 59 93 89 84 66 44 34 88 54 27 | 29 12 61 23 49 86 24 19 54 99 35 90 65 82 13 76 20 87 48 40 62 16 80 33 43
|
||||
Card 32: 44 13 99 31 54 52 55 66 58 16 | 40 88 79 93 67 20 30 37 26 24 77 2 81 62 71 82 49 92 86 41 32 59 53 16 90
|
||||
Card 33: 76 34 40 17 37 46 72 62 47 20 | 68 73 3 5 44 78 86 82 52 22 80 91 95 42 66 77 38 88 75 33 41 4 54 65 18
|
||||
Card 34: 45 19 5 25 68 70 82 73 95 54 | 28 97 19 95 89 42 27 70 17 73 15 25 61 77 82 1 45 7 65 57 54 90 5 68 79
|
||||
Card 35: 9 66 65 71 20 89 4 27 15 54 | 97 24 49 64 14 93 77 99 78 34 88 52 83 39 60 56 79 48 57 50 82 18 3 53 95
|
||||
Card 36: 66 89 69 77 32 37 22 40 82 11 | 42 74 69 97 60 22 11 49 82 67 56 90 17 15 27 40 66 13 89 77 32 5 3 37 57
|
||||
Card 37: 93 31 41 27 36 50 59 97 86 62 | 21 28 79 92 16 86 23 5 45 34 90 66 95 37 9 71 81 67 58 85 15 73 31 25 30
|
||||
Card 38: 61 92 74 75 1 70 96 71 30 68 | 66 44 94 35 78 1 92 18 83 93 2 33 70 71 68 38 61 86 56 40 20 30 74 3 46
|
||||
Card 39: 20 15 47 8 33 55 29 94 16 18 | 21 63 8 33 15 58 94 66 16 45 30 59 29 52 20 61 86 31 48 40 25 62 47 95 18
|
||||
Card 40: 27 23 32 47 55 48 31 93 74 20 | 15 77 85 31 58 53 60 98 20 22 99 92 64 44 76 1 79 9 36 87 72 21 13 48 59
|
||||
Card 41: 57 74 11 92 16 78 44 41 13 64 | 39 34 76 80 84 58 54 38 97 23 46 86 65 69 9 15 91 53 6 29 10 49 47 64 4
|
||||
Card 42: 5 4 99 36 85 18 63 81 61 47 | 43 73 80 88 76 64 79 7 86 94 98 39 37 56 33 51 49 90 70 6 20 1 21 59 82
|
||||
Card 43: 93 18 47 21 75 30 43 90 52 23 | 50 25 65 33 90 58 57 10 55 61 30 41 62 23 76 21 2 75 18 83 92 69 37 5 98
|
||||
Card 44: 24 68 45 26 90 76 33 52 19 72 | 80 68 99 1 12 97 90 26 7 32 4 40 77 8 48 83 96 14 49 27 52 94 54 81 37
|
||||
Card 45: 94 48 13 95 73 11 8 91 84 53 | 78 84 12 59 62 57 90 5 75 55 29 22 71 92 54 47 39 53 20 14 26 69 34 48 51
|
||||
Card 46: 43 63 30 28 71 57 77 20 27 46 | 49 35 56 20 79 75 44 48 95 52 5 66 12 93 24 85 39 7 16 8 99 9 80 78 71
|
||||
Card 47: 25 62 88 36 24 10 15 90 8 23 | 4 54 9 80 42 78 32 19 21 65 86 26 28 7 96 71 48 64 36 95 69 44 89 34 57
|
||||
Card 48: 54 27 17 84 63 35 73 61 65 83 | 53 6 88 32 87 63 69 19 20 49 17 29 37 45 73 93 41 27 90 54 3 83 36 56 71
|
||||
Card 49: 84 14 88 11 45 63 90 76 38 49 | 86 60 58 31 82 98 55 8 99 92 27 50 85 96 33 19 32 3 62 46 56 2 57 16 77
|
||||
Card 50: 61 24 52 67 50 37 36 75 3 2 | 32 61 84 75 22 29 21 80 70 56 86 44 96 97 99 6 65 68 81 60 90 43 85 58 66
|
||||
Card 51: 89 91 62 39 50 92 79 7 87 6 | 36 47 77 12 98 83 54 11 31 33 68 52 41 75 62 80 18 14 43 65 15 58 19 71 13
|
||||
Card 52: 79 38 23 82 69 27 67 86 48 58 | 83 17 90 42 60 68 65 47 45 33 62 7 23 76 29 91 35 95 28 71 13 24 5 25 92
|
||||
Card 53: 86 76 93 98 81 57 44 49 65 11 | 88 28 53 34 58 4 48 23 59 41 7 87 55 74 77 14 18 8 94 99 16 19 56 61 2
|
||||
Card 54: 59 11 64 1 14 17 74 82 70 6 | 99 22 37 19 2 18 13 38 26 39 46 5 86 97 56 89 78 91 33 10 30 69 52 90 44
|
||||
Card 55: 1 18 55 64 16 44 96 20 21 46 | 64 57 21 69 42 18 89 99 20 88 33 37 55 60 31 67 24 26 1 58 96 44 46 16 98
|
||||
Card 56: 10 12 98 27 64 75 70 53 9 5 | 41 26 29 93 7 98 78 66 80 57 31 88 35 18 92 58 47 50 79 74 65 84 71 69 42
|
||||
Card 57: 52 84 86 58 4 17 91 35 12 83 | 66 17 35 81 22 25 84 10 26 42 58 4 89 83 12 91 52 47 61 9 50 54 88 86 5
|
||||
Card 58: 39 77 53 52 71 86 47 31 35 87 | 54 68 67 36 96 14 70 42 65 85 79 97 39 80 72 95 9 60 4 17 81 30 50 91 55
|
||||
Card 59: 48 4 42 32 17 24 13 30 25 90 | 65 38 97 19 16 8 52 11 15 64 73 71 74 66 58 62 49 9 37 91 75 12 56 35 80
|
||||
Card 60: 82 20 70 4 17 26 94 99 47 35 | 77 16 6 22 49 83 26 91 8 47 94 44 99 59 52 10 70 90 63 86 82 67 41 4 69
|
||||
Card 61: 44 95 42 85 16 26 81 92 61 55 | 67 7 17 8 69 34 13 82 47 18 59 76 70 11 25 99 40 85 21 12 22 77 38 44 24
|
||||
Card 62: 56 81 21 43 99 50 20 88 62 51 | 81 99 95 38 43 98 88 20 30 64 79 48 6 62 50 73 7 69 34 56 36 39 85 26 21
|
||||
Card 63: 36 72 91 33 84 95 15 50 27 24 | 21 39 47 46 65 51 16 36 6 35 89 95 62 15 75 37 56 84 13 63 31 92 93 44 77
|
||||
Card 64: 24 12 30 35 3 45 38 67 73 78 | 3 37 27 12 21 92 58 55 33 14 85 74 13 68 57 15 34 94 65 2 70 63 83 61 98
|
||||
Card 65: 54 68 51 13 20 2 26 7 91 18 | 71 11 84 8 35 2 87 24 83 89 75 82 91 28 44 79 63 67 9 46 42 53 13 93 31
|
||||
Card 66: 56 80 96 75 66 83 8 37 7 22 | 28 66 87 80 4 21 92 37 90 75 57 22 65 59 99 39 8 31 63 93 89 56 29 26 96
|
||||
Card 67: 16 46 47 23 79 96 69 93 45 33 | 76 68 18 60 89 55 23 14 25 21 92 62 52 75 28 13 98 90 94 57 12 64 31 73 45
|
||||
Card 68: 76 16 78 19 61 43 35 83 55 80 | 23 51 47 64 10 87 40 77 6 84 27 48 91 38 31 22 39 62 43 67 76 58 5 7 80
|
||||
Card 69: 23 33 56 51 8 18 58 1 61 72 | 75 14 18 12 32 23 2 41 57 35 33 61 67 27 56 10 72 58 8 31 43 5 1 87 90
|
||||
Card 70: 30 44 77 73 93 35 2 72 96 88 | 40 82 38 69 34 22 31 13 90 28 80 30 92 39 5 14 83 33 93 79 71 2 58 67 97
|
||||
Card 71: 7 6 91 81 74 36 90 20 22 97 | 12 30 96 64 34 89 56 21 15 10 76 16 14 50 11 9 95 63 55 92 66 59 27 26 75
|
||||
Card 72: 83 63 17 81 44 10 18 3 99 92 | 34 42 46 3 55 37 31 47 92 41 61 39 98 29 14 10 69 62 83 48 44 28 26 93 96
|
||||
Card 73: 47 24 29 98 77 93 27 8 73 90 | 23 72 55 65 48 70 27 86 50 68 28 77 37 40 87 14 99 49 62 97 56 36 66 47 71
|
||||
Card 74: 55 23 63 86 58 94 48 20 72 79 | 77 36 17 49 39 10 47 23 31 94 3 13 40 70 79 72 8 93 56 62 2 18 55 78 97
|
||||
Card 75: 58 16 64 19 99 22 20 89 76 44 | 50 39 92 33 32 61 44 72 88 46 25 5 68 54 74 55 78 77 7 89 64 96 95 47 76
|
||||
Card 76: 39 10 25 12 88 89 42 14 32 71 | 34 30 22 46 55 43 77 24 36 20 53 47 8 26 48 45 94 62 93 82 79 63 9 89 88
|
||||
Card 77: 12 7 66 55 73 83 43 69 37 27 | 96 81 10 89 17 22 29 44 21 3 18 45 60 32 95 62 67 42 39 49 83 82 99 65 16
|
||||
Card 78: 16 73 23 52 38 81 64 25 84 87 | 20 97 9 31 95 36 77 33 63 70 68 17 27 83 53 69 94 74 96 5 99 72 89 13 67
|
||||
Card 79: 94 28 21 83 49 34 42 9 89 10 | 81 31 85 74 60 39 38 11 15 79 55 32 72 50 99 19 3 96 98 8 76 1 90 30 47
|
||||
Card 80: 18 40 55 13 5 9 66 61 20 57 | 68 85 64 60 94 34 1 27 12 43 95 80 58 38 66 91 74 56 37 88 55 20 44 57 72
|
||||
Card 81: 88 79 67 89 83 49 50 91 48 35 | 79 87 29 2 24 48 99 18 88 89 22 91 42 4 49 67 20 73 83 17 23 50 27 76 35
|
||||
Card 82: 14 49 40 54 10 90 53 63 8 65 | 8 9 60 54 42 72 87 56 79 76 90 93 40 82 49 63 38 28 10 65 69 97 14 96 53
|
||||
Card 83: 37 31 96 81 56 70 38 66 95 54 | 24 92 38 32 23 31 29 90 33 54 80 10 66 13 86 37 1 79 95 81 44 70 3 56 8
|
||||
Card 84: 78 23 98 84 3 52 37 59 56 95 | 32 36 38 24 90 7 18 74 48 21 71 57 44 8 58 6 82 25 19 72 62 70 67 47 94
|
||||
Card 85: 74 25 65 88 20 52 39 21 17 70 | 76 93 62 26 90 34 25 7 36 98 97 70 45 19 47 22 33 21 11 27 8 57 56 71 61
|
||||
Card 86: 1 44 73 15 24 94 87 84 33 51 | 53 38 56 26 16 39 99 72 7 8 36 59 69 98 34 27 5 89 25 78 55 29 62 65 83
|
||||
Card 87: 25 27 78 39 14 43 56 36 60 33 | 85 93 71 9 39 7 72 20 13 91 30 76 68 52 94 21 56 15 70 60 32 14 84 57 77
|
||||
Card 88: 37 97 26 89 54 64 57 98 32 62 | 77 29 63 33 71 20 99 9 78 4 67 31 8 51 41 12 82 19 61 55 11 56 74 24 66
|
||||
Card 89: 75 27 74 63 42 45 72 18 85 50 | 52 2 22 57 45 50 8 10 58 65 69 74 99 32 14 42 27 51 56 30 44 20 84 12 16
|
||||
Card 90: 42 22 5 75 28 20 82 31 41 32 | 31 35 75 36 23 64 14 50 25 65 7 81 46 70 27 96 44 15 77 99 39 33 61 12 54
|
||||
Card 91: 86 76 17 16 3 93 69 13 8 95 | 12 97 48 33 55 35 84 91 5 31 57 77 28 79 6 19 98 26 43 49 1 82 37 61 24
|
||||
Card 92: 76 90 89 65 20 95 59 24 63 22 | 25 71 69 47 36 32 50 77 43 85 33 20 39 27 67 96 40 19 84 34 90 98 81 52 80
|
||||
Card 93: 91 96 47 12 2 46 61 58 39 77 | 1 69 67 60 65 63 19 32 64 46 62 8 15 94 92 93 74 20 54 29 99 89 23 75 28
|
||||
Card 94: 36 66 11 56 96 54 42 44 83 84 | 19 33 82 32 15 16 97 47 64 73 72 2 12 10 29 75 38 27 5 80 39 6 22 53 24
|
||||
Card 95: 35 26 10 67 65 73 5 75 78 18 | 75 99 54 38 73 24 33 7 28 9 64 67 74 5 26 30 37 18 39 35 53 10 4 78 65
|
||||
Card 96: 17 63 42 20 93 48 94 41 89 5 | 48 88 41 89 1 40 26 53 46 5 49 97 20 91 42 28 74 17 94 79 63 32 93 7 72
|
||||
Card 97: 48 77 23 12 8 80 59 88 92 42 | 96 88 13 97 27 86 8 48 33 99 59 23 12 39 90 36 42 92 94 38 76 80 77 26 9
|
||||
Card 98: 70 35 92 63 28 96 50 20 94 98 | 70 12 13 22 96 94 61 74 50 32 92 52 93 54 98 66 20 63 28 99 35 87 78 67 91
|
||||
Card 99: 49 65 8 14 33 57 92 90 22 97 | 14 92 84 29 61 97 72 43 26 63 57 19 60 46 49 95 35 86 39 36 80 21 30 73 74
|
||||
Card 100: 44 47 96 69 98 77 52 31 80 14 | 34 74 18 25 75 67 16 2 49 36 68 39 87 97 33 43 3 19 46 10 45 86 91 50 71
|
||||
Card 101: 28 86 75 77 17 78 96 5 20 30 | 31 67 62 83 58 90 23 25 27 35 29 22 64 50 10 15 6 88 17 78 77 9 4 66 63
|
||||
Card 102: 15 8 61 1 24 98 32 16 81 93 | 99 69 26 70 88 71 25 40 53 54 79 58 15 32 48 87 18 24 52 2 98 82 10 21 6
|
||||
Card 103: 86 29 83 91 56 31 74 87 53 22 | 45 15 79 95 3 14 94 83 16 72 65 36 38 53 78 52 39 91 50 54 86 31 99 22 56
|
||||
Card 104: 22 63 37 54 36 96 90 80 8 7 | 63 75 84 80 48 54 36 35 14 74 53 25 47 37 96 23 56 22 6 8 34 90 7 64 55
|
||||
Card 105: 49 2 17 32 41 45 85 25 83 12 | 77 13 34 83 80 20 50 47 78 30 11 48 44 86 84 21 25 63 36 49 97 74 68 53 81
|
||||
Card 106: 64 2 46 80 75 13 69 56 54 71 | 42 60 95 16 48 30 75 38 46 69 18 98 59 14 93 84 55 70 97 53 32 20 76 2 19
|
||||
Card 107: 22 64 50 79 55 18 87 8 20 98 | 28 69 96 15 70 42 11 12 38 83 55 99 62 98 3 79 53 24 91 44 19 9 4 66 82
|
||||
Card 108: 1 71 73 45 2 50 17 72 19 9 | 1 62 77 47 27 54 2 55 60 89 71 96 31 43 10 67 3 65 25 9 45 68 50 88 73
|
||||
Card 109: 39 61 22 80 23 78 85 99 71 52 | 45 53 46 75 82 84 44 33 76 57 31 65 80 2 66 49 47 39 35 95 19 96 30 14 43
|
||||
Card 110: 50 31 7 42 72 16 28 77 81 43 | 2 6 90 72 16 71 48 77 63 38 31 4 93 76 49 78 45 46 5 80 27 25 26 74 33
|
||||
Card 111: 89 53 2 28 35 5 68 42 62 23 | 35 8 78 24 85 56 55 27 14 33 48 80 18 11 71 1 53 77 91 44 58 25 74 92 43
|
||||
Card 112: 33 40 80 76 16 97 71 67 26 49 | 27 34 11 35 51 26 59 58 44 86 66 54 82 21 8 74 99 77 37 71 16 50 40 61 28
|
||||
Card 113: 34 62 21 74 51 35 19 37 89 49 | 41 5 91 23 43 62 42 68 81 89 19 70 55 88 52 15 97 80 58 26 11 63 6 49 28
|
||||
Card 114: 11 63 45 75 92 50 57 42 29 79 | 13 89 23 20 58 50 26 40 3 27 16 47 71 49 85 78 59 21 37 68 34 7 98 45 19
|
||||
Card 115: 6 64 20 23 50 14 24 33 9 15 | 61 42 74 40 95 30 18 60 46 43 3 25 14 16 92 56 53 90 19 24 78 58 63 80 49
|
||||
Card 116: 69 25 32 2 1 6 24 17 89 4 | 13 57 77 49 27 87 91 68 52 96 20 21 5 62 90 39 47 55 56 63 30 38 14 79 45
|
||||
Card 117: 8 5 28 47 41 25 87 73 17 56 | 43 63 88 32 35 20 13 66 64 86 30 10 92 71 45 57 70 69 62 18 9 93 1 81 95
|
||||
Card 118: 38 54 10 60 63 36 90 47 83 18 | 63 47 45 65 78 60 55 98 91 36 22 81 83 18 90 15 40 10 87 38 54 33 8 32 4
|
||||
Card 119: 82 95 23 76 45 72 16 62 71 83 | 46 66 81 9 16 93 87 4 40 97 5 72 78 54 67 56 61 12 21 74 64 52 23 14 26
|
||||
Card 120: 64 42 36 63 41 71 84 69 85 29 | 80 31 87 20 18 71 43 64 94 7 54 36 45 86 41 60 28 84 88 26 63 85 69 58 77
|
||||
Card 121: 66 77 99 55 75 31 44 30 47 73 | 20 59 45 34 63 89 88 52 39 13 91 61 78 76 73 99 38 23 40 50 4 1 65 67 58
|
||||
Card 122: 9 20 68 24 25 67 3 63 34 12 | 81 48 31 89 72 99 11 26 13 73 58 94 42 57 59 5 74 12 18 20 60 88 83 76 2
|
||||
Card 123: 51 24 73 56 61 57 79 46 37 69 | 55 38 63 17 85 75 59 61 88 50 53 72 1 5 66 52 14 80 74 6 57 22 97 70 77
|
||||
Card 124: 59 97 26 20 53 15 27 65 2 23 | 75 2 74 22 72 91 85 33 98 11 26 99 9 62 61 16 87 69 8 32 10 37 59 20 48
|
||||
Card 125: 30 58 23 6 81 8 3 37 53 15 | 75 66 81 42 32 84 57 40 63 19 70 76 74 54 61 82 44 8 16 80 55 87 10 92 22
|
||||
Card 126: 30 71 38 18 91 61 68 99 13 16 | 91 5 99 88 86 61 16 90 13 9 58 30 69 50 71 1 28 54 20 40 68 46 18 4 73
|
||||
Card 127: 74 60 96 29 69 68 16 80 45 20 | 53 31 71 26 42 64 99 5 81 92 43 96 16 69 22 19 88 60 54 20 29 76 6 56 11
|
||||
Card 128: 47 88 77 56 66 5 38 14 70 1 | 19 5 1 76 2 77 35 51 68 22 75 44 45 13 37 96 86 60 85 87 25 26 64 11 65
|
||||
Card 129: 76 13 49 32 89 52 40 43 54 86 | 57 12 64 59 21 1 40 45 20 24 60 68 77 14 55 80 88 11 83 94 84 4 58 71 18
|
||||
Card 130: 77 98 41 54 64 1 14 20 51 26 | 5 53 6 80 46 14 29 9 77 55 94 40 84 60 33 97 66 64 81 1 75 73 28 16 36
|
||||
Card 131: 16 88 64 81 42 51 13 10 45 48 | 18 77 28 84 75 94 13 35 27 83 29 2 11 44 48 20 19 46 17 25 70 38 30 42 54
|
||||
Card 132: 17 95 50 10 52 65 94 91 49 44 | 30 19 5 13 49 97 44 60 54 38 64 92 37 87 33 67 35 43 40 16 91 15 7 96 36
|
||||
Card 133: 3 51 66 53 19 60 34 26 32 75 | 87 29 64 65 10 50 98 42 69 35 89 26 41 23 14 94 38 49 13 37 53 31 95 90 27
|
||||
Card 134: 81 88 58 61 11 31 54 29 42 50 | 44 35 72 34 21 57 86 79 2 11 67 85 37 49 83 70 64 63 95 12 62 52 71 15 3
|
||||
Card 135: 8 45 79 72 50 38 17 92 89 91 | 77 23 59 53 36 80 25 95 69 83 33 40 62 49 86 19 18 75 84 48 44 47 96 39 73
|
||||
Card 136: 4 41 75 98 60 79 65 9 74 20 | 90 98 16 2 41 9 1 79 28 27 37 47 20 80 74 36 48 60 42 26 75 65 58 4 6
|
||||
Card 137: 96 77 70 23 91 54 43 61 25 4 | 36 96 45 18 42 10 24 65 52 99 93 38 76 27 77 95 23 61 35 34 85 43 59 70 54
|
||||
Card 138: 74 87 59 72 88 15 14 97 68 13 | 11 84 15 27 33 38 8 72 12 40 88 37 14 75 97 82 39 57 87 2 83 68 74 59 13
|
||||
Card 139: 12 20 1 36 10 91 16 42 94 8 | 74 10 86 57 3 27 25 15 33 78 24 84 19 35 58 38 17 77 59 85 4 92 2 55 60
|
||||
Card 140: 62 18 78 34 56 35 70 69 12 50 | 60 8 52 72 95 97 56 69 39 59 38 78 35 43 25 7 16 89 87 57 49 36 88 62 76
|
||||
Card 141: 7 36 86 91 88 37 23 67 92 41 | 86 36 60 4 83 14 88 45 44 23 90 16 7 10 30 92 64 52 91 58 9 72 67 37 94
|
||||
Card 142: 15 68 29 85 72 87 78 4 45 33 | 70 5 78 53 22 13 88 52 72 37 55 7 24 41 90 58 84 23 73 83 3 66 96 61 92
|
||||
Card 143: 8 47 60 23 42 79 66 44 68 62 | 44 66 79 51 8 39 22 85 38 81 42 21 60 67 11 25 7 47 23 9 68 12 70 62 83
|
||||
Card 144: 46 62 12 26 90 16 95 99 8 93 | 23 5 94 99 30 85 75 16 34 81 11 53 27 8 90 82 26 62 87 55 14 73 97 67 93
|
||||
Card 145: 48 96 83 27 12 82 3 29 86 49 | 21 27 96 82 84 49 3 70 76 91 32 29 12 22 58 86 44 87 61 2 83 72 48 40 68
|
||||
Card 146: 62 1 12 83 72 10 50 17 98 5 | 19 26 83 98 49 87 24 32 40 35 50 85 18 17 38 7 61 8 5 20 77 34 1 33 62
|
||||
Card 147: 5 62 85 11 61 49 2 88 75 59 | 59 23 11 44 73 35 82 63 2 33 68 49 75 56 88 62 67 61 5 98 89 19 24 90 76
|
||||
Card 148: 89 21 6 97 13 61 82 71 37 84 | 71 5 7 34 19 66 4 61 55 10 25 82 97 9 72 30 89 13 21 77 6 31 58 84 48
|
||||
Card 149: 46 96 58 2 92 66 52 39 22 23 | 70 31 7 45 46 58 27 2 42 25 59 66 52 99 96 63 39 14 62 51 95 84 69 8 89
|
||||
Card 150: 85 61 42 49 66 9 40 74 8 77 | 41 89 97 87 48 49 69 82 21 54 91 52 71 46 28 99 47 78 98 39 81 95 9 33 85
|
||||
Card 151: 70 35 27 20 42 47 72 89 8 64 | 73 42 3 10 59 72 89 70 50 35 2 8 32 5 36 47 29 98 75 51 30 58 43 86 56
|
||||
Card 152: 65 21 42 45 83 97 90 96 12 28 | 21 30 83 14 24 49 10 65 88 79 64 8 33 15 57 1 97 32 91 78 39 62 4 99 23
|
||||
Card 153: 22 82 23 85 32 25 83 63 68 59 | 52 48 27 94 43 18 21 90 10 62 22 35 55 50 77 93 12 42 91 73 64 36 84 9 8
|
||||
Card 154: 86 15 55 71 88 99 77 18 66 30 | 31 18 38 57 76 53 82 1 49 84 77 14 26 11 40 86 41 87 47 9 62 88 20 59 21
|
||||
Card 155: 34 52 7 30 51 83 42 86 49 16 | 51 57 77 36 21 13 17 88 56 98 96 66 62 63 6 37 52 70 50 32 43 45 47 64 53
|
||||
Card 156: 1 48 76 45 33 51 16 20 25 47 | 49 41 1 64 13 57 79 53 35 6 52 71 97 83 95 87 88 58 37 16 24 63 31 94 46
|
||||
Card 157: 20 3 5 93 75 15 89 14 96 43 | 42 30 91 82 34 44 31 41 4 59 62 54 38 33 25 51 84 28 96 85 8 60 83 10 36
|
||||
Card 158: 68 19 67 1 7 92 4 81 98 53 | 71 64 18 83 66 57 25 49 30 62 95 77 93 40 75 47 15 84 78 9 48 52 24 38 34
|
||||
Card 159: 3 32 42 47 90 1 27 66 50 97 | 4 41 22 18 36 57 76 50 80 24 27 45 25 88 58 29 83 87 86 89 59 66 3 11 13
|
||||
Card 160: 76 74 90 64 70 1 97 28 68 84 | 18 19 67 84 12 51 97 60 68 92 28 90 1 94 93 64 30 2 74 76 61 49 85 70 96
|
||||
Card 161: 75 12 21 36 44 85 1 43 29 45 | 99 87 38 73 60 33 80 25 1 54 85 45 4 57 41 29 43 90 49 44 27 12 31 16 23
|
||||
Card 162: 23 69 91 77 84 98 55 89 92 74 | 26 44 25 49 10 15 82 37 39 64 61 83 53 1 38 69 22 96 5 91 36 65 75 41 98
|
||||
Card 163: 78 64 29 96 73 12 35 19 65 38 | 76 96 35 9 34 41 46 39 3 10 27 24 13 84 91 92 22 58 62 16 8 12 60 18 56
|
||||
Card 164: 82 84 96 81 23 19 58 2 24 62 | 36 93 49 5 71 87 34 39 2 98 97 28 77 70 17 53 51 23 57 81 3 48 29 27 62
|
||||
Card 165: 53 95 19 88 39 99 29 62 91 77 | 18 51 63 11 99 71 84 86 57 96 60 62 77 32 35 27 98 23 97 1 65 17 15 87 38
|
||||
Card 166: 17 46 33 41 80 57 47 91 1 64 | 33 98 57 1 88 23 64 41 43 61 84 11 7 52 80 60 4 97 75 46 55 21 47 91 79
|
||||
Card 167: 47 3 71 68 6 94 54 61 66 72 | 69 9 10 67 68 87 49 61 56 6 85 59 75 23 44 90 94 13 66 52 53 72 64 45 31
|
||||
Card 168: 90 57 89 45 63 53 61 46 96 55 | 57 94 39 18 45 53 27 24 81 79 50 30 21 31 83 99 67 98 92 90 22 47 46 80 7
|
||||
Card 169: 7 47 36 15 24 51 52 9 48 61 | 15 88 48 99 3 12 22 7 47 87 89 57 9 24 82 51 97 61 52 1 36 54 94 63 62
|
||||
Card 170: 26 42 91 72 64 18 69 81 44 22 | 46 60 73 35 4 52 33 51 13 82 62 5 27 90 95 2 7 56 44 76 75 50 87 70 74
|
||||
Card 171: 17 80 28 54 57 90 86 59 67 1 | 1 59 19 90 37 57 76 87 42 73 20 41 68 33 67 53 28 50 86 54 80 99 6 17 91
|
||||
Card 172: 95 28 26 47 83 76 31 52 70 89 | 69 18 8 50 20 27 16 60 11 88 75 13 34 57 90 1 5 91 38 32 6 68 65 35 33
|
||||
Card 173: 15 74 3 88 42 10 62 59 39 27 | 34 61 14 52 74 88 22 39 67 23 10 73 27 46 55 24 30 89 35 82 66 83 86 15 43
|
||||
Card 174: 6 8 3 61 1 87 94 18 20 93 | 59 56 13 57 85 8 67 6 14 60 10 69 29 3 99 26 44 78 82 22 49 24 36 90 87
|
||||
Card 175: 47 64 30 84 70 92 51 53 12 73 | 11 79 23 33 4 2 36 47 7 53 10 13 20 92 51 72 32 61 94 78 5 64 69 19 54
|
||||
Card 176: 55 57 29 40 25 44 96 7 70 14 | 51 88 85 62 5 66 23 30 81 33 50 75 25 61 59 43 87 71 32 76 27 48 8 11 86
|
||||
Card 177: 57 9 53 8 63 88 32 52 79 28 | 35 42 99 1 72 64 51 11 58 16 50 70 21 87 65 77 66 94 63 96 47 32 62 81 92
|
||||
Card 178: 48 22 72 59 60 61 8 39 24 67 | 34 88 67 4 48 59 84 98 83 26 50 10 57 45 14 7 9 21 63 17 94 91 37 39 36
|
||||
Card 179: 11 60 35 51 80 12 53 22 71 72 | 10 18 70 11 16 19 72 23 83 63 61 58 56 50 28 89 7 75 59 48 81 54 33 2 40
|
||||
Card 180: 50 48 20 85 86 18 67 91 27 22 | 7 14 31 51 36 42 66 56 46 16 15 10 5 67 90 2 19 63 26 35 91 82 43 68 49
|
||||
Card 181: 75 78 86 53 61 26 68 77 85 25 | 95 40 18 73 6 43 74 87 51 64 37 83 62 24 19 33 2 7 13 52 48 63 57 70 75
|
||||
Card 182: 6 60 67 18 39 29 33 54 37 83 | 15 72 38 35 8 96 36 44 81 19 21 1 40 87 46 52 9 4 28 31 85 13 68 32 41
|
||||
Card 183: 52 18 27 20 7 46 38 58 91 37 | 20 46 27 9 37 90 63 99 59 78 66 65 88 91 18 21 1 49 85 71 26 4 8 58 50
|
||||
Card 184: 38 58 36 50 76 43 32 98 69 23 | 36 24 69 33 48 92 28 44 43 91 58 50 86 4 98 78 76 81 23 32 71 27 66 40 38
|
||||
Card 185: 53 21 69 24 51 39 88 3 78 5 | 89 78 73 61 59 21 8 79 64 51 39 66 53 69 67 68 36 29 88 38 44 47 46 19 13
|
||||
Card 186: 48 54 68 40 60 27 45 51 61 17 | 52 78 51 35 45 74 62 89 27 76 48 17 56 53 40 14 61 11 68 37 31 54 39 60 4
|
||||
Card 187: 64 49 14 90 67 54 40 21 60 71 | 8 30 55 89 17 90 97 60 16 49 74 14 67 24 82 64 51 25 61 98 12 19 35 40 43
|
||||
Card 188: 53 51 65 17 4 88 5 69 28 34 | 11 24 78 69 77 26 88 4 60 71 28 20 59 10 51 2 17 49 52 65 34 8 53 64 5
|
||||
Card 189: 53 78 45 15 50 2 6 16 3 38 | 53 10 27 45 67 38 76 56 50 4 41 77 91 16 3 6 60 13 2 43 15 9 98 20 78
|
||||
Card 190: 72 54 84 76 69 10 13 19 97 26 | 84 45 29 49 71 72 2 47 16 32 46 14 5 34 35 99 6 93 56 89 22 79 73 24 64
|
||||
Card 191: 18 70 33 56 72 68 98 52 24 46 | 55 52 25 18 24 12 49 15 46 23 71 72 89 26 33 2 76 7 44 56 68 97 83 70 98
|
||||
Card 192: 33 34 57 40 93 14 12 45 79 25 | 97 20 48 39 90 64 27 40 26 58 42 60 45 2 81 80 23 34 79 57 24 18 71 53 5
|
||||
Card 193: 87 90 72 76 10 83 41 6 54 23 | 23 18 1 76 93 88 96 72 7 31 20 90 68 30 39 40 44 11 35 3 78 54 17 46 60
|
||||
Card 194: 5 10 25 27 6 45 67 86 92 32 | 68 32 21 5 33 74 42 27 84 48 46 14 38 39 64 47 95 86 45 56 31 25 67 15 17
|
||||
Card 195: 31 33 64 80 68 21 20 29 63 11 | 80 81 1 56 61 21 12 33 64 30 76 82 97 43 27 52 31 20 70 45 17 4 60 77 68
|
||||
Card 196: 73 91 78 83 14 54 94 92 9 8 | 3 56 55 76 96 22 17 43 15 40 52 51 13 50 79 65 41 25 60 11 93 53 99 4 87
|
||||
Card 197: 63 64 25 48 91 95 77 7 38 69 | 40 29 14 72 27 5 10 97 56 30 51 13 15 34 75 87 86 60 45 88 33 61 90 32 85
|
||||
Card 198: 70 60 61 56 16 81 18 12 88 65 | 5 67 62 45 43 21 32 94 19 27 77 58 50 41 9 85 29 40 92 87 54 24 76 48 33
|
||||
Card 199: 29 26 70 45 22 86 27 64 95 80 | 46 5 38 61 44 97 9 15 78 93 73 34 7 23 67 41 58 33 1 85 48 98 4 14 53
|
||||
Card 200: 3 88 81 61 64 39 54 51 49 17 | 16 87 35 37 82 68 55 19 80 33 10 2 48 25 79 89 52 4 44 59 26 72 90 83 9
|
||||
Card 201: 28 44 46 58 13 92 35 16 30 14 | 32 79 85 98 67 55 21 41 93 43 19 72 35 24 90 64 88 82 84 20 45 91 81 38 49
|
||||
Card 202: 85 43 47 11 9 21 27 53 17 95 | 10 6 26 91 30 69 52 20 28 16 82 45 72 54 58 96 88 99 38 55 78 98 15 70 4
|
6
04/input_test
Normal file
6
04/input_test
Normal file
@ -0,0 +1,6 @@
|
||||
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
|
||||
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
|
||||
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
|
||||
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
|
||||
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
|
||||
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11
|
106
04/main.s
Normal file
106
04/main.s
Normal file
@ -0,0 +1,106 @@
|
||||
%define BUFF_LIM 32768
|
||||
|
||||
%define WINNING_COUNT 10
|
||||
|
||||
global _start
|
||||
[bits 32]
|
||||
[section .text]
|
||||
|
||||
%include "utils.s"
|
||||
|
||||
_start:
|
||||
mov ebx, filename
|
||||
call open_file
|
||||
mov ecx, read_buff
|
||||
mov edx, BUFF_LIM
|
||||
call read_file
|
||||
add eax, read_buff
|
||||
mov [file_lim], eax
|
||||
mov byte [eax], 10 ; add a newline at the end
|
||||
|
||||
; 1. get to :, checking for file_lim
|
||||
; 2. repeat WINNING_COUNT times
|
||||
; get the next number
|
||||
; record in winning list
|
||||
; end
|
||||
; 3. repeat until \n
|
||||
; get the next number
|
||||
; check against the winning list
|
||||
; if match then
|
||||
; shl points, 1
|
||||
; cmovz points, 1 ???
|
||||
; end
|
||||
; end
|
||||
; 4. add to final value
|
||||
; 5. goto 1
|
||||
|
||||
mov esi, read_buff
|
||||
; 1. get to :, checking for file_lim
|
||||
find_colon:
|
||||
lodsb
|
||||
cmp al, ':'
|
||||
je start_round
|
||||
cmp esi, [file_lim]
|
||||
jge game_over
|
||||
jmp find_colon
|
||||
|
||||
; 2. repeat WINNING_COUNT times
|
||||
; get the next number
|
||||
; record in winning list
|
||||
; end
|
||||
start_round:
|
||||
mov ecx, WINNING_COUNT
|
||||
.get_next_number:
|
||||
call dec_parse
|
||||
jc .get_next_number
|
||||
; record in list (backward since loop)
|
||||
mov [(winning_list-4)+ecx*4], eax
|
||||
loop .get_next_number
|
||||
|
||||
; 3. repeat until \n
|
||||
; get the next number
|
||||
; check against the winning list
|
||||
; if match then
|
||||
; shl points, 1
|
||||
; cmovz points, 1 ???
|
||||
; end
|
||||
; end
|
||||
check_wins:
|
||||
xor ebx, ebx ; points
|
||||
.get_next_number:
|
||||
call dec_parse
|
||||
jc .get_next_number
|
||||
; check against winning list
|
||||
mov ecx, WINNING_COUNT
|
||||
mov edx, 1
|
||||
.check_winning:
|
||||
cmp [(winning_list-4)+ecx*4], eax
|
||||
jne .continue
|
||||
; matched!
|
||||
shl ebx, 1
|
||||
cmovz ebx, edx
|
||||
.continue:
|
||||
loop .check_winning
|
||||
; check for \n
|
||||
dec esi
|
||||
lodsb
|
||||
cmp al, 10 ; \n
|
||||
jne .get_next_number
|
||||
; round done
|
||||
add dword [final_value], ebx ; round points
|
||||
jmp find_colon ; restart
|
||||
|
||||
; print everything out
|
||||
game_over:
|
||||
mov eax, [final_value]
|
||||
call print_dec
|
||||
jmp exit
|
||||
|
||||
[section .data]
|
||||
file_lim: dd 0
|
||||
final_value: dd 0
|
||||
filename: db "input",0
|
||||
|
||||
[section .bss]
|
||||
winning_list: resd WINNING_COUNT
|
||||
read_buff: resb BUFF_LIM
|
120
04/utils.s
Normal file
120
04/utils.s
Normal file
@ -0,0 +1,120 @@
|
||||
; call # val val2
|
||||
; int $0x80 eax eax edx -
|
||||
;
|
||||
; arg1 arg2 arg3 arg4 arg5 arg6 arg7
|
||||
; ebx ecx edx esi edi ebp -
|
||||
|
||||
exit:
|
||||
mov eax, 1 ; exit
|
||||
int 0x80
|
||||
|
||||
; filename in EBX
|
||||
; return handle in EBX
|
||||
; read only
|
||||
open_file:
|
||||
push eax
|
||||
push ecx
|
||||
mov eax, 5 ; open
|
||||
xor ecx, ecx ; read only
|
||||
int 0x80
|
||||
mov ebx, eax
|
||||
pop ecx
|
||||
pop eax
|
||||
ret
|
||||
|
||||
; file handle in EBX
|
||||
; buffer in ECX
|
||||
; count of bytes to read in EDX
|
||||
; return bytes actually read in EAX
|
||||
; exits on error
|
||||
read_file:
|
||||
mov eax, 3 ; read
|
||||
int 0x80
|
||||
test eax, eax
|
||||
js .err
|
||||
ret
|
||||
.err:
|
||||
mov eax, 4 ; write
|
||||
mov ebx, 1 ; stdout
|
||||
mov ecx, .err_str
|
||||
mov edx, 21
|
||||
int 0x80
|
||||
jmp exit
|
||||
.err_str: db `Could not read file.\n`
|
||||
|
||||
; string input in ESI
|
||||
; value in EAX
|
||||
; CF set if none, clear if some
|
||||
; ESI set past checked area
|
||||
dec_parse:
|
||||
push ebx
|
||||
push edx
|
||||
push edi
|
||||
xor eax, eax
|
||||
xor edi, edi
|
||||
mov ebx, 10 ; base
|
||||
lodsb
|
||||
sub al, '0'
|
||||
js .no_input
|
||||
cmp al, 9
|
||||
jle .got_char
|
||||
.no_input:
|
||||
stc ; set CF
|
||||
jmp .done
|
||||
.loop:
|
||||
lodsb
|
||||
sub al, '0'
|
||||
js .dec_done
|
||||
cmp al, 9
|
||||
jg .dec_done
|
||||
.got_char:
|
||||
xchg edi,eax
|
||||
mul ebx
|
||||
add edi,eax
|
||||
jmp .loop
|
||||
.dec_done:
|
||||
clc ; clear CF
|
||||
.done:
|
||||
mov eax,edi
|
||||
pop edi
|
||||
pop edx
|
||||
pop ebx
|
||||
ret
|
||||
|
||||
; input in EAX, all regs unmodified
|
||||
print_dec:
|
||||
pushad ; save regs
|
||||
; max 4294967296 is 10 chars
|
||||
; round to nearest 32-bit boundary
|
||||
sub esp, 12
|
||||
; string in ECX, length in EDX
|
||||
lea ecx, [esp+11] ; last possible byte
|
||||
; check for 0
|
||||
test eax, eax
|
||||
jz .zero
|
||||
mov ebx, 10 ; base 10
|
||||
xor esi, esi ; counter
|
||||
.div_shit:
|
||||
xor edx, edx
|
||||
; divide
|
||||
div ebx
|
||||
dec ecx ; next char
|
||||
inc esi
|
||||
; store
|
||||
add dl, '0'
|
||||
mov byte [ecx], dl
|
||||
; check if done
|
||||
test eax, eax
|
||||
jnz .div_shit ; continue
|
||||
mov edx, esi ; counter in edx
|
||||
jmp .write
|
||||
.zero:
|
||||
mov byte [ecx], '0'
|
||||
mov edx, 1 ; length
|
||||
.write:
|
||||
mov eax, 4 ; write
|
||||
mov ebx, 1 ; stdout
|
||||
int 0x80
|
||||
add esp, 12 ; restore stack
|
||||
popad ; restore regs
|
||||
ret
|
Loading…
Reference in New Issue
Block a user