| | 274 | |
|---|
| | 275 | public function toString():String |
|---|
| | 276 | { |
|---|
| | 277 | return this.generatePatFileString(this.pat); |
|---|
| | 278 | } |
|---|
| | 279 | |
|---|
| | 280 | private function generatePatFileString(pat:Array):String { |
|---|
| | 281 | var x:int, y:int, c:int; |
|---|
| | 282 | var out:String = ''; |
|---|
| | 283 | for (c = 2; c >= 0; c--) { |
|---|
| | 284 | for (x = 15; x >= 0; x--) { |
|---|
| | 285 | for (y = 0; y < 16; y++) { |
|---|
| | 286 | out += String(' ' + int(pat[y][x][c])).substr(-4); |
|---|
| | 287 | } |
|---|
| | 288 | out += '\n'; |
|---|
| | 289 | } |
|---|
| | 290 | } |
|---|
| | 291 | out += '\n'; |
|---|
| | 292 | for (c = 2; c >= 0; c--) { |
|---|
| | 293 | for (y = 15; y >= 0; y--) { |
|---|
| | 294 | for (x = 15; x >= 0; x--) { |
|---|
| | 295 | out += String(' ' + int(pat[y][x][c])).substr(-4); |
|---|
| | 296 | } |
|---|
| | 297 | out += '\n'; |
|---|
| | 298 | } |
|---|
| | 299 | } |
|---|
| | 300 | out += '\n'; |
|---|
| | 301 | for (c = 2; c >= 0; c--) { |
|---|
| | 302 | for (x = 0; x < 16; x++) { |
|---|
| | 303 | for (y = 15; y >= 0; y--) { |
|---|
| | 304 | out += String(' ' + int(pat[y][x][c])).substr(-4); |
|---|
| | 305 | } |
|---|
| | 306 | out += '\n'; |
|---|
| | 307 | } |
|---|
| | 308 | } |
|---|
| | 309 | out += '\n'; |
|---|
| | 310 | for (c = 2; c >= 0; c--) { |
|---|
| | 311 | for (y = 0; y < 16; y++) { |
|---|
| | 312 | for (x = 0; x < 16; x++) { |
|---|
| | 313 | out += String(' ' + int(pat[y][x][c])).substr(-4); |
|---|
| | 314 | } |
|---|
| | 315 | out += '\n'; |
|---|
| | 316 | } |
|---|
| | 317 | } |
|---|
| | 318 | out += '\n'; |
|---|
| | 319 | return out; |
|---|
| | 320 | } |
|---|