Jump to content

Demonic God

Member
  • Posts

    257
  • Joined

  • Last visited

  • Days Won

    12

Reputation Activity

  1. Upvote
    Demonic God got a reaction from Pipstickz in The mason's puzzle   
    A bit late... o well. I'm not even sure why I made this, since most contestant drew their own thing xD. This is a tool to visualize what you made, and the scores you get... provided that it doesn't throw an error.
    For those that likes tinkering around, this might be fun for you to poke around with
    from graphics import * BORDER_THICKNESS = 3 SQUARE_THICKNESS = 50 SHAPES = { 'T_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,2,0),(0,1,1)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,1)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,1,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,1)}) }, 'L_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,2,0),(0,0,1)}), frozenset({(0,0,0),(0,1,0),(0,2,0),(0,2,1)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,0)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,2)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,0,0)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,2,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,2)}) }, 'Z_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,1,1),(0,2,1)}), frozenset({(0,0,1),(0,1,1),(0,1,0),(0,2,0)}), frozenset({(0,0,0),(0,0,1),(0,1,1),(0,1,2)}), frozenset({(0,1,0),(0,1,1),(0,0,1),(0,0,2)}) }, 'I_SHAPE':{ frozenset({(0,0,0),(0,1,0)}), frozenset({(0,0,0),(0,0,1)}) }, 'DOT_SHAPE':{ frozenset({(0,0,0)}) } } POINTS = { 'Z_SHAPE': 4, 'T_SHAPE': 3, 'L_SHAPE': 3, 'I_SHAPE': 1, 'DOT_SHAPE': 0 } COLORS = { 'Z_SHAPE': 'red', 'T_SHAPE': 'green', 'L_SHAPE': 'blue', 'I_SHAPE': 'purple', 'DOT_SHAPE': 'yellow', 'BORDER': 'black' } def rotateFlat(shape): o = [] #re-order detect = [max(x) for x in [*zip(*shape)]] if detect[0] == 0: return shape # already flat elif detect[1] == 0: o = [1,0,2] elif detect[2] == 0: o = [2,1,0] else: raise Exception('Nonrotatable shape') return {(x[o[0]],x[o[1]],x[o[2]]) for x in shape} def getSimplifiedShape(index, matrix): tiles = [] for x,surface in enumerate(matrix): for y,line in enumerate(surface): for z,point in enumerate(line): if point == index: tiles.append([x,y,z]) simplifier = [min(x) for x in [*zip(*tiles)]] #Transpose to find min x y z simplified_shape = {(tile[0] - simplifier[0], tile[1] - simplifier[1], tile[2] - simplifier[2]) for tile in tiles} simplified_shape = rotateFlat(simplified_shape) return simplified_shape def getShape(index, matrix): simplified_shape = getSimplifiedShape(index, matrix) for SHAPE in SHAPES: if simplified_shape in SHAPES[SHAPE]: return SHAPE else: print(f'Cannot find shape {simplified_shape}') raise Exception() def getColor(matrix, layer, x, y): if isBorder(x,y): return COLORS['BORDER'] elif isInnerBorder(x,y): if _isInnerBorder(x) and not _isInnerBorder(y): x, y = getIndex(x,y) index_1 = matrix[layer][y][x-1] index_2 = matrix[layer][y][x] elif _isInnerBorder(y) and not _isInnerBorder(x): x, y = getIndex(x,y) index_1 = matrix[layer][y-1][x] index_2 = matrix[layer][y][x] else: return COLORS['BORDER'] if index_1 == index_2: shape = getShape(index_1, matrix) return COLORS[shape] else: return COLORS['BORDER'] else: x, y = getIndex(x,y) index = matrix[layer][y][x] shape = getShape(index, matrix) return COLORS[shape] def draw(matrix, offset_x = 30, offset_y = 30): size = BORDER_THICKNESS * 9 + SQUARE_THICKNESS * 8 window = GraphWin(width = size * 3 + offset_x * 4, height = size + offset_y * 2 + 40) indexSet = set() score = 0 for surface in matrix: for line in surface: for index in line: if index in indexSet: continue else: indexSet.add(index) score += POINTS[getShape(index, matrix)] message = Text(Point(window.getWidth() / 2 - 50, window.getHeight() - 40), f'Score: {score}') message.setTextColor('black') message.setSize(20) message.draw(window) for layer in range(3): for y in range(size): x = 0 while x < size: color = getColor(matrix, layer, x, y) point_a = Point(x + offset_x * (layer + 1) + layer * size, y + offset_y) if color != COLORS['BORDER']: if _isInnerBorder(x): length = BORDER_THICKNESS else: length = SQUARE_THICKNESS elif _isBorder(y): length = size elif _isInnerBorder(x) or _isBorder(x): length = BORDER_THICKNESS else: length = SQUARE_THICKNESS point_b = Point(point_a.getX() + length , point_a.getY()) x += length line = Line(point_a, point_b) line.setFill(color) line.draw(window) def _isBorder(x): return x < BORDER_THICKNESS or x >= ((BORDER_THICKNESS + SQUARE_THICKNESS) * 8) def isBorder(x, y): return _isBorder(x) or _isBorder(y) def _isInnerBorder(x): if _isBorder(x): return False while x >= BORDER_THICKNESS + SQUARE_THICKNESS: x -= BORDER_THICKNESS + SQUARE_THICKNESS if _isBorder(x): return True return False def isInnerBorder(x,y): if isBorder(x,y): return False return _isInnerBorder(x) or _isInnerBorder(y) def getIndex(x,y): return (x//(BORDER_THICKNESS + SQUARE_THICKNESS), y//(BORDER_THICKNESS + SQUARE_THICKNESS)) testArr = [ [ [0, 0, 1, 1, 1, 2, 2, 2], [3, 0, 0, 1, 4, 13, 14, 2], [3, 17, 18, 4, 4, 21, 22, 23], [24, 25, 26, 27, 4, 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] ] ] # draw(testArr) f = open("blocks.txt", "r", encoding="utf-8") matrix = [] layer = [] for line in f: line.replace(';',' ').replace(',',' ') data = [int(x) for x in line.split()] if len(data) == 0: continue assert len(data) == 8 layer.append(data) if len(layer) == 8: matrix.append(layer) layer = [] f.close() draw(matrix) input("Enter any key to quit.") You'd need to have python + graphics.py installed. Make a text file, name it "blocks.txt", and it *should* work.
    Here's an example of how "blocks.txt" should look like
    0 0 1 1 1 2 2 2 3 0 0 1 4 13 14 2 3 17 18 4 4 21 22 23 24 25 26 27 4 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 If you don't get any of this... well, it's just a tool ~~that I made after Yoshi submitted numbers~~ that is kinda used to grade stuff.
    I'll be making the grading script for the rock-paper-scissor game later, for those who wants to poke around with that too
  2. Like
    Demonic God got a reaction from Muratus del Mur in Scene makover challenge: Bring some colour to MD!   
    I'm not too good at it, but here's my attempt
    I liked how peaceful wind sanctuary is, so I opted to go for some simple kites and balloons, which goes great in an open sky.
     

  3. Like
    Demonic God got a reaction from Chewett in Scene makover challenge: Bring some colour to MD!   
    I'm not too good at it, but here's my attempt
    I liked how peaceful wind sanctuary is, so I opted to go for some simple kites and balloons, which goes great in an open sky.
     

  4. Upvote
    Demonic God got a reaction from Aia del Mana in Scene makover challenge: Bring some colour to MD!   
    I'm not too good at it, but here's my attempt
    I liked how peaceful wind sanctuary is, so I opted to go for some simple kites and balloons, which goes great in an open sky.
     

  5. Like
    Demonic God got a reaction from Aelis in Scene makover challenge: Bring some colour to MD!   
    I'm not too good at it, but here's my attempt
    I liked how peaceful wind sanctuary is, so I opted to go for some simple kites and balloons, which goes great in an open sky.
     

  6. Upvote
    Demonic God reacted to Ungod in Scene makover challenge: Bring some colour to MD!   
    Not much decoration here, but I'm of the opinion you don't need much to get a party going. 
    Just lay a blanket, open the picnic basket that contains wine and bacon and just enjoy...this is a chill place to wait (for years) for those MP3s to direct them to the spear&halberd rack, teach them to use the whetstone and everything. 

  7. Like
    Demonic God reacted to Poppi Chullo in Scene makover challenge: Bring some colour to MD!   
    Special spot for me? Of course the "Gates of Ages". This is where I spent almost my entire day. I also lost my bathtub here, which should be next to the left post. It fell into the abyss. T_T

  8. Like
    Demonic God got a reaction from Kaya in Scene makover challenge: Bring some colour to MD!   
    I'm not too good at it, but here's my attempt
    I liked how peaceful wind sanctuary is, so I opted to go for some simple kites and balloons, which goes great in an open sky.
     

  9. Like
    Demonic God got a reaction from Yoshi in The mason's puzzle   
    A bit late... o well. I'm not even sure why I made this, since most contestant drew their own thing xD. This is a tool to visualize what you made, and the scores you get... provided that it doesn't throw an error.
    For those that likes tinkering around, this might be fun for you to poke around with
    from graphics import * BORDER_THICKNESS = 3 SQUARE_THICKNESS = 50 SHAPES = { 'T_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,2,0),(0,1,1)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,1)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,1,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,1)}) }, 'L_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,2,0),(0,0,1)}), frozenset({(0,0,0),(0,1,0),(0,2,0),(0,2,1)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,0)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,2)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,0,0)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,2,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,2)}) }, 'Z_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,1,1),(0,2,1)}), frozenset({(0,0,1),(0,1,1),(0,1,0),(0,2,0)}), frozenset({(0,0,0),(0,0,1),(0,1,1),(0,1,2)}), frozenset({(0,1,0),(0,1,1),(0,0,1),(0,0,2)}) }, 'I_SHAPE':{ frozenset({(0,0,0),(0,1,0)}), frozenset({(0,0,0),(0,0,1)}) }, 'DOT_SHAPE':{ frozenset({(0,0,0)}) } } POINTS = { 'Z_SHAPE': 4, 'T_SHAPE': 3, 'L_SHAPE': 3, 'I_SHAPE': 1, 'DOT_SHAPE': 0 } COLORS = { 'Z_SHAPE': 'red', 'T_SHAPE': 'green', 'L_SHAPE': 'blue', 'I_SHAPE': 'purple', 'DOT_SHAPE': 'yellow', 'BORDER': 'black' } def rotateFlat(shape): o = [] #re-order detect = [max(x) for x in [*zip(*shape)]] if detect[0] == 0: return shape # already flat elif detect[1] == 0: o = [1,0,2] elif detect[2] == 0: o = [2,1,0] else: raise Exception('Nonrotatable shape') return {(x[o[0]],x[o[1]],x[o[2]]) for x in shape} def getSimplifiedShape(index, matrix): tiles = [] for x,surface in enumerate(matrix): for y,line in enumerate(surface): for z,point in enumerate(line): if point == index: tiles.append([x,y,z]) simplifier = [min(x) for x in [*zip(*tiles)]] #Transpose to find min x y z simplified_shape = {(tile[0] - simplifier[0], tile[1] - simplifier[1], tile[2] - simplifier[2]) for tile in tiles} simplified_shape = rotateFlat(simplified_shape) return simplified_shape def getShape(index, matrix): simplified_shape = getSimplifiedShape(index, matrix) for SHAPE in SHAPES: if simplified_shape in SHAPES[SHAPE]: return SHAPE else: print(f'Cannot find shape {simplified_shape}') raise Exception() def getColor(matrix, layer, x, y): if isBorder(x,y): return COLORS['BORDER'] elif isInnerBorder(x,y): if _isInnerBorder(x) and not _isInnerBorder(y): x, y = getIndex(x,y) index_1 = matrix[layer][y][x-1] index_2 = matrix[layer][y][x] elif _isInnerBorder(y) and not _isInnerBorder(x): x, y = getIndex(x,y) index_1 = matrix[layer][y-1][x] index_2 = matrix[layer][y][x] else: return COLORS['BORDER'] if index_1 == index_2: shape = getShape(index_1, matrix) return COLORS[shape] else: return COLORS['BORDER'] else: x, y = getIndex(x,y) index = matrix[layer][y][x] shape = getShape(index, matrix) return COLORS[shape] def draw(matrix, offset_x = 30, offset_y = 30): size = BORDER_THICKNESS * 9 + SQUARE_THICKNESS * 8 window = GraphWin(width = size * 3 + offset_x * 4, height = size + offset_y * 2 + 40) indexSet = set() score = 0 for surface in matrix: for line in surface: for index in line: if index in indexSet: continue else: indexSet.add(index) score += POINTS[getShape(index, matrix)] message = Text(Point(window.getWidth() / 2 - 50, window.getHeight() - 40), f'Score: {score}') message.setTextColor('black') message.setSize(20) message.draw(window) for layer in range(3): for y in range(size): x = 0 while x < size: color = getColor(matrix, layer, x, y) point_a = Point(x + offset_x * (layer + 1) + layer * size, y + offset_y) if color != COLORS['BORDER']: if _isInnerBorder(x): length = BORDER_THICKNESS else: length = SQUARE_THICKNESS elif _isBorder(y): length = size elif _isInnerBorder(x) or _isBorder(x): length = BORDER_THICKNESS else: length = SQUARE_THICKNESS point_b = Point(point_a.getX() + length , point_a.getY()) x += length line = Line(point_a, point_b) line.setFill(color) line.draw(window) def _isBorder(x): return x < BORDER_THICKNESS or x >= ((BORDER_THICKNESS + SQUARE_THICKNESS) * 8) def isBorder(x, y): return _isBorder(x) or _isBorder(y) def _isInnerBorder(x): if _isBorder(x): return False while x >= BORDER_THICKNESS + SQUARE_THICKNESS: x -= BORDER_THICKNESS + SQUARE_THICKNESS if _isBorder(x): return True return False def isInnerBorder(x,y): if isBorder(x,y): return False return _isInnerBorder(x) or _isInnerBorder(y) def getIndex(x,y): return (x//(BORDER_THICKNESS + SQUARE_THICKNESS), y//(BORDER_THICKNESS + SQUARE_THICKNESS)) testArr = [ [ [0, 0, 1, 1, 1, 2, 2, 2], [3, 0, 0, 1, 4, 13, 14, 2], [3, 17, 18, 4, 4, 21, 22, 23], [24, 25, 26, 27, 4, 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] ] ] # draw(testArr) f = open("blocks.txt", "r", encoding="utf-8") matrix = [] layer = [] for line in f: line.replace(';',' ').replace(',',' ') data = [int(x) for x in line.split()] if len(data) == 0: continue assert len(data) == 8 layer.append(data) if len(layer) == 8: matrix.append(layer) layer = [] f.close() draw(matrix) input("Enter any key to quit.") You'd need to have python + graphics.py installed. Make a text file, name it "blocks.txt", and it *should* work.
    Here's an example of how "blocks.txt" should look like
    0 0 1 1 1 2 2 2 3 0 0 1 4 13 14 2 3 17 18 4 4 21 22 23 24 25 26 27 4 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 If you don't get any of this... well, it's just a tool ~~that I made after Yoshi submitted numbers~~ that is kinda used to grade stuff.
    I'll be making the grading script for the rock-paper-scissor game later, for those who wants to poke around with that too
  10. Like
    Demonic God got a reaction from Aelis in The mason's puzzle   
    A bit late... o well. I'm not even sure why I made this, since most contestant drew their own thing xD. This is a tool to visualize what you made, and the scores you get... provided that it doesn't throw an error.
    For those that likes tinkering around, this might be fun for you to poke around with
    from graphics import * BORDER_THICKNESS = 3 SQUARE_THICKNESS = 50 SHAPES = { 'T_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,2,0),(0,1,1)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,1)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,1,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,1)}) }, 'L_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,2,0),(0,0,1)}), frozenset({(0,0,0),(0,1,0),(0,2,0),(0,2,1)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,0)}), frozenset({(0,0,0),(0,0,1),(0,0,2),(0,1,2)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,0,0)}), frozenset({(0,0,1),(0,1,1),(0,2,1),(0,2,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,0)}), frozenset({(0,1,0),(0,1,1),(0,1,2),(0,0,2)}) }, 'Z_SHAPE':{ frozenset({(0,0,0),(0,1,0),(0,1,1),(0,2,1)}), frozenset({(0,0,1),(0,1,1),(0,1,0),(0,2,0)}), frozenset({(0,0,0),(0,0,1),(0,1,1),(0,1,2)}), frozenset({(0,1,0),(0,1,1),(0,0,1),(0,0,2)}) }, 'I_SHAPE':{ frozenset({(0,0,0),(0,1,0)}), frozenset({(0,0,0),(0,0,1)}) }, 'DOT_SHAPE':{ frozenset({(0,0,0)}) } } POINTS = { 'Z_SHAPE': 4, 'T_SHAPE': 3, 'L_SHAPE': 3, 'I_SHAPE': 1, 'DOT_SHAPE': 0 } COLORS = { 'Z_SHAPE': 'red', 'T_SHAPE': 'green', 'L_SHAPE': 'blue', 'I_SHAPE': 'purple', 'DOT_SHAPE': 'yellow', 'BORDER': 'black' } def rotateFlat(shape): o = [] #re-order detect = [max(x) for x in [*zip(*shape)]] if detect[0] == 0: return shape # already flat elif detect[1] == 0: o = [1,0,2] elif detect[2] == 0: o = [2,1,0] else: raise Exception('Nonrotatable shape') return {(x[o[0]],x[o[1]],x[o[2]]) for x in shape} def getSimplifiedShape(index, matrix): tiles = [] for x,surface in enumerate(matrix): for y,line in enumerate(surface): for z,point in enumerate(line): if point == index: tiles.append([x,y,z]) simplifier = [min(x) for x in [*zip(*tiles)]] #Transpose to find min x y z simplified_shape = {(tile[0] - simplifier[0], tile[1] - simplifier[1], tile[2] - simplifier[2]) for tile in tiles} simplified_shape = rotateFlat(simplified_shape) return simplified_shape def getShape(index, matrix): simplified_shape = getSimplifiedShape(index, matrix) for SHAPE in SHAPES: if simplified_shape in SHAPES[SHAPE]: return SHAPE else: print(f'Cannot find shape {simplified_shape}') raise Exception() def getColor(matrix, layer, x, y): if isBorder(x,y): return COLORS['BORDER'] elif isInnerBorder(x,y): if _isInnerBorder(x) and not _isInnerBorder(y): x, y = getIndex(x,y) index_1 = matrix[layer][y][x-1] index_2 = matrix[layer][y][x] elif _isInnerBorder(y) and not _isInnerBorder(x): x, y = getIndex(x,y) index_1 = matrix[layer][y-1][x] index_2 = matrix[layer][y][x] else: return COLORS['BORDER'] if index_1 == index_2: shape = getShape(index_1, matrix) return COLORS[shape] else: return COLORS['BORDER'] else: x, y = getIndex(x,y) index = matrix[layer][y][x] shape = getShape(index, matrix) return COLORS[shape] def draw(matrix, offset_x = 30, offset_y = 30): size = BORDER_THICKNESS * 9 + SQUARE_THICKNESS * 8 window = GraphWin(width = size * 3 + offset_x * 4, height = size + offset_y * 2 + 40) indexSet = set() score = 0 for surface in matrix: for line in surface: for index in line: if index in indexSet: continue else: indexSet.add(index) score += POINTS[getShape(index, matrix)] message = Text(Point(window.getWidth() / 2 - 50, window.getHeight() - 40), f'Score: {score}') message.setTextColor('black') message.setSize(20) message.draw(window) for layer in range(3): for y in range(size): x = 0 while x < size: color = getColor(matrix, layer, x, y) point_a = Point(x + offset_x * (layer + 1) + layer * size, y + offset_y) if color != COLORS['BORDER']: if _isInnerBorder(x): length = BORDER_THICKNESS else: length = SQUARE_THICKNESS elif _isBorder(y): length = size elif _isInnerBorder(x) or _isBorder(x): length = BORDER_THICKNESS else: length = SQUARE_THICKNESS point_b = Point(point_a.getX() + length , point_a.getY()) x += length line = Line(point_a, point_b) line.setFill(color) line.draw(window) def _isBorder(x): return x < BORDER_THICKNESS or x >= ((BORDER_THICKNESS + SQUARE_THICKNESS) * 8) def isBorder(x, y): return _isBorder(x) or _isBorder(y) def _isInnerBorder(x): if _isBorder(x): return False while x >= BORDER_THICKNESS + SQUARE_THICKNESS: x -= BORDER_THICKNESS + SQUARE_THICKNESS if _isBorder(x): return True return False def isInnerBorder(x,y): if isBorder(x,y): return False return _isInnerBorder(x) or _isInnerBorder(y) def getIndex(x,y): return (x//(BORDER_THICKNESS + SQUARE_THICKNESS), y//(BORDER_THICKNESS + SQUARE_THICKNESS)) testArr = [ [ [0, 0, 1, 1, 1, 2, 2, 2], [3, 0, 0, 1, 4, 13, 14, 2], [3, 17, 18, 4, 4, 21, 22, 23], [24, 25, 26, 27, 4, 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] ] ] # draw(testArr) f = open("blocks.txt", "r", encoding="utf-8") matrix = [] layer = [] for line in f: line.replace(';',' ').replace(',',' ') data = [int(x) for x in line.split()] if len(data) == 0: continue assert len(data) == 8 layer.append(data) if len(layer) == 8: matrix.append(layer) layer = [] f.close() draw(matrix) input("Enter any key to quit.") You'd need to have python + graphics.py installed. Make a text file, name it "blocks.txt", and it *should* work.
    Here's an example of how "blocks.txt" should look like
    0 0 1 1 1 2 2 2 3 0 0 1 4 13 14 2 3 17 18 4 4 21 22 23 24 25 26 27 4 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 If you don't get any of this... well, it's just a tool ~~that I made after Yoshi submitted numbers~~ that is kinda used to grade stuff.
    I'll be making the grading script for the rock-paper-scissor game later, for those who wants to poke around with that too
  11. Like
    Demonic God reacted to Fyrd Argentus in One-way Travel Arrows   
    I'm thinking of how much fun/havoc this could create in races, chases, and events of that sort.  One-Way Travel Arrows.  For example:
    You ought to be able to jump off the MDA balcony and land in the room below.
    Leading west from Marind's Marble Stair there is a road you cannot follow.  Perhaps it should lead to a crumbly cliff that dumps you somewhere in Loreroot.
    You might jump off Mount Kelle'tha with a glider, or launch yourself with a catapult, and end up -- ANYWHERE -- in the realm at random.
    I don't know how the currents flow in all these bodies of water, but entering one at one place could see you swept away to some other.
    Obviously, these are dangerous stunts and may take a %age of your vital energy away - moderated perhaps by agility-related skills.
  12. Upvote
    Demonic God got a reaction from Steno in My poor memory (and laptop)   
    And you call my quests evil... :3
    Lashtal is gonna have another field day xD
  13. Upvote
    Demonic God got a reaction from Aia del Mana in shard ability - MarkForCritAbilities   
    Revigorate
    Description: Regenerate more than just vitality!
    markforcritabilities|mark=revigorate;power=15%;duration=20;deadoralive=onlyliving;targets=e;target_abilities=regenerate
  14. Upvote
    Demonic God reacted to Ledah in Paying for a reduction of heat   
    I don't believe another feature needs to be added to reduce heat. As has been noted you can currently:
    Drop using UP/Regen Sacrifice a creature Wish for it A stronger UP has been released, which should mitigate the 3 limit we have now. We are also getting, in my opinion, insane amounts of permanent VE just for logging in every day, which will help with losing VE. Also, if you are gaining heat, that means your creatures are too. While it may be less than your profile heat, if you really want to uncap that badly, perhaps sacrifice some creatures, or a WP for that matter.
  15. Upvote
    Demonic God got a reaction from Chewett in MD Rework 2021 - Illusions   
    forgot to sign up, I hope this isn't too late @@
  16. Upvote
    Demonic God got a reaction from Poppi Chullo in The loser takes it all   
    It might have certainly been overlooked purposefully, I'd just like to raise concerns about it
    Exclusion of, even a single creature, for balance purposes, should imply that a creatures could be excluded, for balance purposes. I'd even go further, and saying for the sake of a tournament, it makes even more sense to ban the more limited creature - rather than the commonly accessible one: A creature that all can possess hardly provide an advantage to any specific individual.
  17. Like
    Demonic God got a reaction from Mallos in The loser takes it all   
    It might have certainly been overlooked purposefully, I'd just like to raise concerns about it
    Exclusion of, even a single creature, for balance purposes, should imply that a creatures could be excluded, for balance purposes. I'd even go further, and saying for the sake of a tournament, it makes even more sense to ban the more limited creature - rather than the commonly accessible one: A creature that all can possess hardly provide an advantage to any specific individual.
  18. Upvote
    Demonic God got a reaction from Granos in Perspective: Void   
    The representation of nothing as a concept. An idea that revolutionized the world (invention of zero, mathematical concept). Something that's always there, yet could easily boggles the mind of those unaware of it. The opposite of yet another mind twisting concept: infinity.
  19. Upvote
    Demonic God reacted to Sunfire in The loser takes it all   
    rules and rewards will be disclosed when the signup closes.
  20. Upvote
    Demonic God got a reaction from Ungod in Trickster's ball   
    I announce that Lady @Aia del Manahas submitted a correct solution, being the first to done so, 28 minutes after the quest was posted!
    Amazing, and congratulations!
  21. Upvote
    Demonic God got a reaction from Trola in Trickster's ball   
    The other day, I headed to the Golemus Laboratory, for some experimentation. Tinkering around, messing with the Aramors to-be-filled with AI cores.
    Alas, such work is boring! So boring indeed, that half way through, as my attention span dictate... I decided to make a very, very bouncy ball. A drop of blood, glue, rare minerals... and Voila!
    Throwing this thing in open space, would be unwise. Not that it would do any damages, but I prefer to not lose my shiny possessions. So, I had a small room built, and gave it a throw. Alas... I did not expect it to bounce so vigorously, the damn thing bounced so well, catching it would be impossible! As I ponder upon this dilemma, miraculously, the ball bounced straight back at me. Damn thing almost broke a tooth of mine, but I did managed to catch it. Impressed by this outcome, I laid down my pen and paper, and begins working out, how exactly did the ball bounce back to exactly where I was? And how many times, did that damn thing bounced around?
    So, I ask for your help, to determine the numbers of bounces the ball made. Here are the details of how it all went down - according to my memory:
    The ball somehow ignored gravity, and flew parallel to the ground at all times I started at the South-West corner of the room The ball was thrown perfectly North-East. (45 degree) The room is almost a square, of dimension 2020 cm x 2021 cm. I fully intend to sue the contractor for this error. Summarized in mathematical terms:
    You throw a perfectly bouncy ball in a rectangle (2020 x 2021) room from a corner The ball was thrown at a 45 degree angle The ball ignored gravity, and flew parallel to the ground at all time How many bounces did the ball make before it return to your location? Rewards:
    Most elegant solution - 1 Anni crit Most creative/unorthodox solution - 1 Anni crit Fastest correct solution - 1 GC All correct solutions - 5SC + 1 spell stone Lock in chaos Acoustic Remains Teleport to Papercabin
  22. Like
    Demonic God got a reaction from Aia del Mana in Trickster's ball   
    I announce that Lady @Aia del Manahas submitted a correct solution, being the first to done so, 28 minutes after the quest was posted!
    Amazing, and congratulations!
  23. Upvote
    Demonic God got a reaction from Aia del Mana in Trickster's ball   
    The other day, I headed to the Golemus Laboratory, for some experimentation. Tinkering around, messing with the Aramors to-be-filled with AI cores.
    Alas, such work is boring! So boring indeed, that half way through, as my attention span dictate... I decided to make a very, very bouncy ball. A drop of blood, glue, rare minerals... and Voila!
    Throwing this thing in open space, would be unwise. Not that it would do any damages, but I prefer to not lose my shiny possessions. So, I had a small room built, and gave it a throw. Alas... I did not expect it to bounce so vigorously, the damn thing bounced so well, catching it would be impossible! As I ponder upon this dilemma, miraculously, the ball bounced straight back at me. Damn thing almost broke a tooth of mine, but I did managed to catch it. Impressed by this outcome, I laid down my pen and paper, and begins working out, how exactly did the ball bounce back to exactly where I was? And how many times, did that damn thing bounced around?
    So, I ask for your help, to determine the numbers of bounces the ball made. Here are the details of how it all went down - according to my memory:
    The ball somehow ignored gravity, and flew parallel to the ground at all times I started at the South-West corner of the room The ball was thrown perfectly North-East. (45 degree) The room is almost a square, of dimension 2020 cm x 2021 cm. I fully intend to sue the contractor for this error. Summarized in mathematical terms:
    You throw a perfectly bouncy ball in a rectangle (2020 x 2021) room from a corner The ball was thrown at a 45 degree angle The ball ignored gravity, and flew parallel to the ground at all time How many bounces did the ball make before it return to your location? Rewards:
    Most elegant solution - 1 Anni crit Most creative/unorthodox solution - 1 Anni crit Fastest correct solution - 1 GC All correct solutions - 5SC + 1 spell stone Lock in chaos Acoustic Remains Teleport to Papercabin
  24. Like
    Demonic God got a reaction from Aelis in Trickster's ball   
    The other day, I headed to the Golemus Laboratory, for some experimentation. Tinkering around, messing with the Aramors to-be-filled with AI cores.
    Alas, such work is boring! So boring indeed, that half way through, as my attention span dictate... I decided to make a very, very bouncy ball. A drop of blood, glue, rare minerals... and Voila!
    Throwing this thing in open space, would be unwise. Not that it would do any damages, but I prefer to not lose my shiny possessions. So, I had a small room built, and gave it a throw. Alas... I did not expect it to bounce so vigorously, the damn thing bounced so well, catching it would be impossible! As I ponder upon this dilemma, miraculously, the ball bounced straight back at me. Damn thing almost broke a tooth of mine, but I did managed to catch it. Impressed by this outcome, I laid down my pen and paper, and begins working out, how exactly did the ball bounce back to exactly where I was? And how many times, did that damn thing bounced around?
    So, I ask for your help, to determine the numbers of bounces the ball made. Here are the details of how it all went down - according to my memory:
    The ball somehow ignored gravity, and flew parallel to the ground at all times I started at the South-West corner of the room The ball was thrown perfectly North-East. (45 degree) The room is almost a square, of dimension 2020 cm x 2021 cm. I fully intend to sue the contractor for this error. Summarized in mathematical terms:
    You throw a perfectly bouncy ball in a rectangle (2020 x 2021) room from a corner The ball was thrown at a 45 degree angle The ball ignored gravity, and flew parallel to the ground at all time How many bounces did the ball make before it return to your location? Rewards:
    Most elegant solution - 1 Anni crit Most creative/unorthodox solution - 1 Anni crit Fastest correct solution - 1 GC All correct solutions - 5SC + 1 spell stone Lock in chaos Acoustic Remains Teleport to Papercabin
  25. Upvote
    Demonic God got a reaction from Granos in Of Memery and Schemery   
    I shall have the honor of making the first moss meme!

×
×
  • Create New...