| •1 |
|
| 2 |
|
| 3 |
|
| •4 |
|
| 5 |
|
| •6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| •11 |
|
| 12 |
|
| 13 |
|
| •14 |
|
| 15 |
|
| •16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
package org.stathissideris.ascii2image.text; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
public class AbstractCell { |
| 27 |
|
| 28 |
public int rows[][] = new int[3][3]; |
| 29 |
{ |
| 30 |
for(int y = 0; y < 3; y++) |
| 31 |
for(int x = 0; x < 3; x++) |
| 32 |
rows[x][y] = 0; |
| 33 |
} |
| 34 |
|
| 35 |
static AbstractCell makeHorizontalLine(){ |
| 36 |
AbstractCell result = new AbstractCell(); |
| 37 |
result.rows[0][1] = 1; |
| 38 |
result.rows[1][1] = 1; |
| 39 |
result.rows[2][1] = 1; |
| 40 |
return result; |
| 41 |
} |
| 42 |
|
| 43 |
static AbstractCell makeVerticalLine(){ |
| 44 |
AbstractCell result = new AbstractCell(); |
| 45 |
result.rows[1][0] = 1; |
| 46 |
result.rows[1][1] = 1; |
| 47 |
result.rows[1][2] = 1; |
| 48 |
return result; |
| 49 |
} |
| 50 |
|
| 51 |
static AbstractCell makeCorner1(){ |
| 52 |
AbstractCell result = new AbstractCell(); |
| 53 |
result.rows[1][1] = 1; |
| 54 |
result.rows[1][2] = 1; |
| 55 |
result.rows[2][1] = 1; |
| 56 |
return result; |
| 57 |
} |
| 58 |
|
| 59 |
static AbstractCell makeCorner2(){ |
| 60 |
AbstractCell result = new AbstractCell(); |
| 61 |
result.rows[0][1] = 1; |
| 62 |
result.rows[1][1] = 1; |
| 63 |
result.rows[1][2] = 1; |
| 64 |
return result; |
| 65 |
} |
| 66 |
|
| 67 |
static AbstractCell makeCorner3(){ |
| 68 |
AbstractCell result = new AbstractCell(); |
| 69 |
result.rows[0][1] = 1; |
| 70 |
result.rows[1][1] = 1; |
| 71 |
result.rows[1][0] = 1; |
| 72 |
return result; |
| 73 |
} |
| 74 |
|
| 75 |
static AbstractCell makeCorner4(){ |
| 76 |
AbstractCell result = new AbstractCell(); |
| 77 |
result.rows[2][1] = 1; |
| 78 |
result.rows[1][1] = 1; |
| 79 |
result.rows[1][0] = 1; |
| 80 |
return result; |
| 81 |
} |
| 82 |
|
| 83 |
static AbstractCell makeT(){ |
| 84 |
AbstractCell result = AbstractCell.makeHorizontalLine(); |
| 85 |
result.rows[1][2] = 1; |
| 86 |
return result; |
| 87 |
} |
| 88 |
|
| 89 |
static AbstractCell makeInverseT(){ |
| 90 |
AbstractCell result = AbstractCell.makeHorizontalLine(); |
| 91 |
result.rows[1][0] = 1; |
| 92 |
return result; |
| 93 |
} |
| 94 |
|
| 95 |
static AbstractCell makeK(){ |
| 96 |
AbstractCell result = AbstractCell.makeVerticalLine(); |
| 97 |
result.rows[2][1] = 1; |
| 98 |
return result; |
| 99 |
} |
| 100 |
|
| 101 |
static AbstractCell makeInverseK(){ |
| 102 |
AbstractCell result = AbstractCell.makeVerticalLine(); |
| 103 |
result.rows[0][1] = 1; |
| 104 |
return result; |
| 105 |
} |
| 106 |
|
| 107 |
static AbstractCell makeCross(){ |
| 108 |
AbstractCell result = AbstractCell.makeVerticalLine(); |
| 109 |
result.rows[0][1] = 1; |
| 110 |
result.rows[2][1] = 1; |
| 111 |
return result; |
| 112 |
} |
| 113 |
|
| 114 |
static AbstractCell makeStar(){ |
| 115 |
AbstractCell result = AbstractCell.makeVerticalLine(); |
| 116 |
for(int y = 0; y < 3; y++) |
| 117 |
for(int x = 0; x < 3; x++) |
| 118 |
result.rows[x][y] = 1; |
| 119 |
return result; |
| 120 |
} |
| 121 |
|
| 122 |
|
| 123 |
} |