Section 1
//Key (Key)
package {
import flash.events.*;
import flash.display.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public function Key(){
super();
}
public static function initialize(stage:Stage):void{
if (!initialized){
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
stage.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private static function clearKeys(event:Event):void{
keysDown = new Object();
}
public static function isDown(keyCode:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((keyCode in keysDown)));
}
private static function keyPressed(event:KeyboardEvent):void{
keysDown[event.keyCode] = true;
}
private static function keyReleased(event:KeyboardEvent):void{
if ((event.keyCode in keysDown)){
delete keysDown[event.keyCode];
};
}
}
}//package
Section 2
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.filters.*;
import flash.geom.*;
import flash.ui.*;
import flash.utils.*;
public class Main extends Sprite {
private const BLOCK_TYPES:Number = 7;
private const BLOCK_DOTS:Number = 4;
private const NUM_LEVELS:Number = 10;
private const BLOCK_ORIENTS:Number = 4;
private var delay:Array;
private var level:Number;// = 0
private var gOrient:Number;// = 0
private var well_bmp:Bitmap;
private var curPiece:Number;// = -1
private var coords:Object;
private var debugText:TextField;
private var block_pos:Object;
private var pixelSize:Number;// = 20
private var newPiece:Number;// = 1
private var nextPiece:Number;// = -1
public var pieces:Array;
private var dot:Object;
private var scoreText:TextField;
private var drop_dt:Number;// = 0
private var points:Object;
private var disclaimerText:TextField;
private var lastKey:Number;// = 0
private var bl_percent:Array;
private var well_data:String;
public function Main():void{
var rand:Number;
pieces = new Array(BLOCK_TYPES);
bl_percent = new Array(70, 85, 94, 100, 100, 100, 100);
super();
var i:Number = 0;
while (i < 1000) {
rand = Math.floor((Math.random() * 100));
trace(rand);
i++;
};
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
public function show_score(temp:Object):Number{
return (1);
}
public function update_well():void{
var x:Number;
var y:Number;
var color:uint;
var wellBMP:BitmapData = new BitmapData((pixelSize * coords.well_w), (pixelSize * coords.well_h), false, 3722305023);
x = 0;
y = 0;
y = 0;
y = 0;
while (y < coords.well_h) {
x = 0;
x = 0;
while (x < coords.well_w) {
color = colorLookup(getPieceAt(y, x));
if (color != 0){
wellBMP.lock();
wellBMP.fillRect(new Rectangle((x * pixelSize), (y * pixelSize), pixelSize, pixelSize), color);
wellBMP.unlock();
};
x++;
};
y++;
};
well_bmp.bitmapData = wellBMP;
}
private function check_lines(start:Number):Object{
var points:Object;
var _loc_7:String;
var _loc_8:String;
var _loc_9:Number;
var y:Number = 0;
var x:Number = 0;
var line:Boolean;
var line_stat:Number = 0;
points = new Object();
_loc_7 = new String();
_loc_8 = new String();
_loc_9 = 0;
var i:Number = 0;
while (i < coords.well_w) {
_loc_8 = _loc_8.concat("0");
i++;
};
points.points = 0;
points.lines = 0;
if (start > (coords.well_h - BLOCK_DOTS)){
start = (coords.well_h - BLOCK_DOTS);
};
y = start;
y = start;
while (y < (start + BLOCK_DOTS)) {
line_stat = (line_stat << 1);
line = true;
x = 0;
x = 0;
while (x < coords.well_w) {
if (getPieceAt(y, x) == 0){
line = false;
break;
};
x++;
};
if (line){
if (line_stat == 0){
points.points = 50;
} else {
points.points = (points.points * 2);
};
points.lines++;
line_stat = (line_stat | 1);
_loc_7 = new String(_loc_8);
_loc_7 = _loc_7.concat(well_data.substring(0, (y * coords.well_w)));
_loc_7 = _loc_7.concat(well_data.substring(((y + 1) * coords.well_w)));
well_data = new String(_loc_7);
};
y++;
};
if (line_stat > 0){
trace("Found a line. Updating well!");
update_well();
};
return (points);
}
private function init():void{
var wellBMP:BitmapData;
stage.scaleMode = StageScaleMode.NO_SCALE;
removeEventListener(Event.ADDED_TO_STAGE, init);
newPiece = 1;
curPiece = -1;
nextPiece = -1;
lastKey = 0;
level = 0;
drop_dt = 0;
block_pos = {y:-1, x:-1};
gOrient = 0;
coords = new Object();
points = new Object();
points.points = 0;
dot = new Object();
init_coords();
stage.scaleMode = "noScale";
wellBMP = new BitmapData((pixelSize * coords.well_w), (pixelSize * coords.well_h), false, 3722305023);
well_bmp = new Bitmap(wellBMP);
addChild(well_bmp);
debugText = new TextField();
debugText.textColor = 0;
debugText.multiline = true;
debugText.wordWrap = true;
debugText.selectable = false;
debugText.width = 300;
debugText.height = 320;
debugText.x = 400;
scoreText = new TextField();
scoreText.selectable = false;
scoreText.multiline = true;
scoreText.x = 225;
scoreText.y = 5;
scoreText.autoSize = TextFieldAutoSize.LEFT;
var scoreStyle:StyleSheet = new StyleSheet();
scoreStyle.parseCSS((((((("p { color: #000000; " + "font-family: Arial, Helvetica, sans-serif; ") + "font-size: 24px; ") + "margin: 30px; ") + "display: inline; } ") + ".title { font-size: 28px; ") + "font-weight: bold; }"));
scoreText.styleSheet = scoreStyle;
addChild(scoreText);
addChild(debugText);
disclaimerText = new TextField();
disclaimerText.wordWrap = true;
disclaimerText.multiline = true;
disclaimerText.selectable = false;
disclaimerText.width = 175;
disclaimerText.height = 300;
disclaimerText.x = 215;
disclaimerText.y = 100;
var disclaimerStyle:StyleSheet = new StyleSheet();
disclaimerStyle.parseCSS("p { color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; display: inline; }");
disclaimerText.styleSheet = disclaimerStyle;
disclaimerText.text = ((((((((((("<p><span class='title'>This is Bastet</span>. It is designed to give you the pieces you need the least. There is a " + bl_percent[0]) + "% chance that you will get the absolutely worst piece. ") + (bl_percent[1] - bl_percent[0])) + "% chance that you will get the second worst piece. ") + (bl_percent[2] - bl_percent[1])) + "% chance that you will get the third worst piece. And a paltry ") + (bl_percent[3] - bl_percent[2])) + "% chance that you will get your most useful piece. ") + "You will never get any of the 3 most useful pieces.</p><br/>") + "<p>You will get frustrated. You will most likely find no joy in this game.</p><br/>") + "<p>Enjoy!</p>");
addChild(disclaimerText);
Key.initialize(this.root.stage);
newGame();
}
public function getPieceAt(y:Number, x:Number, well:String=""):Number{
if (well == ""){
well = well_data;
};
return (int(well.charAt(((y * coords.well_w) + x))));
}
private function play_game(e:Event):void{
var tmp:Object;
scoreText.text = ((((("<p><span class='title'>BASTET</span></p><p>SCORE: " + points.points) + "</p>") + "<p>LINES: ") + points.lines) + "</p>");
var y:Number = 0;
if (newPiece){
if (curPiece == -1){
curPiece = Math.floor((Math.random() * BLOCK_TYPES));
} else {
curPiece = choose_piece();
};
nextPiece = Math.floor((Math.random() * BLOCK_TYPES));
newPiece = 0;
};
y = drop_block(curPiece, points.level);
if (y >= 0){
tmp = check_lines(y);
points.points = (points.points + tmp.points);
points.lines = (points.lines + tmp.lines);
if (((((points.lines / 10) > level)) && (((points.lines / 10) < NUM_LEVELS)))){
points.level = (points.lines / 10);
};
newPiece = 1;
block_pos.y = -1;
gOrient = 0;
} else {
if (y == -1){
} else {
if (y == -2){
removeEventListener(Event.ENTER_FRAME, play_game);
newGame();
};
};
};
}
private function check_block_pos(y:Number, x:Number, type:Number, orient:Number):Number{
var dot:Array = new Array(3);
var i:Number = 0;
while (i < BLOCK_DOTS) {
dot = pieces[type][orient][i];
if (((((((((y + dot[1]) > (coords.well_h - 1))) || (((x + dot[0]) < 0)))) || (((x + dot[0]) > (coords.well_w - 1))))) || ((getPieceAt((y + dot[1]), (x + dot[0])) > 0)))){
return (0);
};
i++;
};
return (1);
}
private function init_coords(width:Number=10, height:Number=20):void{
coords.well_x = 0;
coords.well_y = 2;
coords.stat_y = 2;
coords.stat_x = 0;
coords.stat_w = 18;
coords.well_w = width;
coords.well_h = height;
}
private function eval_pos(well:String):Number{
var _loc_2:Number;
var _loc_3:Number;
var _loc_4:Number;
var _loc_5:String;
var _loc_6:String;
var _loc_7:Array;
_loc_2 = 0;
_loc_3 = 0;
_loc_4 = 0;
_loc_6 = new String();
_loc_7 = new Array(coords.well_w);
_loc_2 = 0;
_loc_2 = 0;
while (_loc_2 < coords.well_w) {
_loc_6 = _loc_6.concat("0");
_loc_2++;
};
_loc_2 = 0;
_loc_2 = 0;
while (_loc_2 < coords.well_h) {
_loc_3 = 0;
_loc_3 = 0;
while (_loc_3 < coords.well_w) {
if (getPieceAt(_loc_2, _loc_3, well) == 0){
break;
};
_loc_3++;
};
if (_loc_3 == coords.well_w){
_loc_4 = (_loc_4 + 5000);
_loc_5 = new String(_loc_6);
_loc_5 = _loc_5.concat(well.substring(0, (y * coords.well_w)));
_loc_5 = _loc_5.concat(well.substring(((y + 1) * coords.well_w)));
well = new String(_loc_5);
};
_loc_2++;
};
_loc_3 = 0;
_loc_3 = 0;
while (_loc_3 < coords.well_w) {
_loc_2 = 0;
do {
var _temp1 = _loc_2;
_loc_2 = (_loc_2 + 1);
} while ((((getPieceAt(_temp1, _loc_3, well) == 0)) && ((_loc_2 < coords.well_h))));
_loc_7[_loc_3] = (coords.well_h - _loc_2);
_loc_3++;
};
_loc_3 = 0;
_loc_3 = 0;
while (_loc_3 < coords.well_w) {
_loc_4 = (_loc_4 - (5 * _loc_7[_loc_3]));
_loc_3++;
};
return (_loc_4);
}
public function newGame():void{
var _loc_1:Number;
newPiece = 1;
curPiece = -1;
level = 1;
initialize_pieces();
init_coords();
gOrient = 0;
block_pos.y = -1;
drop_dt = 0;
lastKey = 0;
initialize_pieces();
delay = new Array(NUM_LEVELS);
delay[0] = 1000;
delay[1] = 770;
delay[2] = 593;
delay[3] = 457;
delay[4] = 352;
delay[5] = 271;
delay[6] = 208;
delay[7] = 160;
delay[8] = 124;
delay[9] = 95;
points.points = 0;
points.lines = 0;
points.level = level;
well_data = new String();
_loc_1 = 0;
var i:Number = 0;
while (i < (coords.well_h * coords.well_w)) {
well_data = well_data.concat("0");
i++;
};
addEventListener(Event.ENTER_FRAME, play_game);
update_well();
}
public function minimax(BLOCK_DOTS:Array):Array{
var tOrient:Number;
var x:Number;
var y:Number = 0;
var eval:Number = 0;
var score:Number = 0;
var well:String = new String(well_data);
var type:Number = 0;
while (type < BLOCK_TYPES) {
score = -32000;
tOrient = 0;
while (tOrient < BLOCK_ORIENTS) {
x = -2;
while (x < (coords.well_w + 2)) {
well = well_data;
y = 0;
if (!wcheck_block_pos(y, x, type, tOrient, well)){
} else {
while (wcheck_block_pos((y + 1), x, type, tOrient, well)) {
y++;
};
well = set_block(y, x, type, tOrient, well);
eval = eval_pos(well);
};
x++;
};
score = ((score < eval)) ? eval : score;
tOrient++;
};
BLOCK_DOTS[type] = score;
type++;
};
return (BLOCK_DOTS);
}
private function drop_block(type:Number, level:Number):Number{
var _loc_3:Number;
var _loc_5:Number;
var _loc_7:Number;
var tOrient:Number = gOrient;
var oldOrient:Number = 0;
_loc_3 = ((coords.well_w * 0.5) - (BLOCK_DOTS * 0.5));
_loc_5 = 0;
if (block_pos.y == -1){
block_pos.y = 0;
block_pos.x = _loc_3;
};
if (drop_dt == 0){
drop_dt = getTimer();
};
if (check_block_pos(block_pos.y, block_pos.x, type, tOrient) == 0){
return (-2);
};
draw_block(block_pos.y, block_pos.x, type, tOrient, false);
if ((getTimer() - lastKey) > 50){
if (Key.isDown(82)){
return (-2);
};
if (Key.isDown(Keyboard.RIGHT)){
if (check_block_pos(block_pos.y, (block_pos.x + 1), type, tOrient)){
draw_block(block_pos.y, block_pos.x, type, tOrient, true);
block_pos.x++;
draw_block(block_pos.y, block_pos.x, type, tOrient, false);
lastKey = getTimer();
};
} else {
if (Key.isDown(Keyboard.LEFT)){
if (check_block_pos(block_pos.y, (block_pos.x - 1), type, tOrient)){
draw_block(block_pos.y, block_pos.x, type, tOrient, true);
block_pos.x--;
draw_block(block_pos.y, block_pos.x, type, tOrient, false);
lastKey = getTimer();
};
};
};
};
if ((getTimer() - lastKey) > 100){
if (Key.isDown(Keyboard.SPACE)){
oldOrient = tOrient;
draw_block(block_pos.y, block_pos.x, type, tOrient, true);
if (tOrient == 0){
tOrient = (BLOCK_ORIENTS - 1);
} else {
tOrient--;
};
if (check_block_pos(block_pos.y, block_pos.x, type, tOrient) == 0){
tOrient = oldOrient;
};
draw_block(block_pos.y, block_pos.x, type, tOrient, false);
lastKey = getTimer();
} else {
if (Key.isDown(Keyboard.UP)){
oldOrient = tOrient;
draw_block(block_pos.y, block_pos.x, type, tOrient, true);
if (tOrient == (BLOCK_ORIENTS - 1)){
tOrient = 0;
} else {
tOrient++;
};
if (check_block_pos(block_pos.y, block_pos.x, type, tOrient) == 0){
tOrient = oldOrient;
};
draw_block(block_pos.y, block_pos.x, type, tOrient, false);
lastKey = getTimer();
};
};
};
if ((getTimer() - lastKey) > 25){
if (Key.isDown(Keyboard.DOWN)){
_loc_5 = 1;
lastKey = getTimer();
};
};
_loc_7 = getTimer();
if (((((_loc_7 - drop_dt) > delay[level])) || ((_loc_5 == 1)))){
drop_dt = getTimer();
if (check_block_pos((block_pos.y + 1), block_pos.x, type, tOrient)){
draw_block(block_pos.y, block_pos.x, type, tOrient, true);
block_pos.y++;
draw_block(block_pos.y, block_pos.x, type, tOrient, false);
} else {
well_data = set_block(block_pos.y, block_pos.x, type, tOrient);
gOrient = tOrient;
return (block_pos.y);
};
};
gOrient = tOrient;
return (-1);
}
public function colorLookup(get_level:Number):uint{
var _loc_2:uint;
switch (get_level){
case 7:
_loc_2 = 0x660066;
break;
case 6:
_loc_2 = 10053273;
break;
case 5:
_loc_2 = 16724940;
break;
case 4:
_loc_2 = 16751052;
break;
case 3:
_loc_2 = 13395558;
break;
case 2:
_loc_2 = 16737843;
break;
case 1:
_loc_2 = 0xFF3300;
break;
case 0:
default:
_loc_2 = 0;
break;
};
return (_loc_2);
}
public function choose_piece():Number{
var bl_sort:Array = new Array(BLOCK_TYPES);
var sorted:Array = new Array(BLOCK_TYPES);
var nextPiece:Number = -1;
var rand:Number = Math.floor((Math.random() * 100));
var pieceType:String = new String();
bl_sort = minimax(bl_sort);
sorted = bl_sort.sort((Array.NUMERIC | Array.RETURNINDEXEDARRAY));
debugText.text = String(rand);
var i:Number = 0;
while (i < BLOCK_TYPES) {
bl_sort[i] = (bl_sort[i] + Math.floor(((Math.random() * 5) - 2)));
i++;
};
debugText.appendText(("\n" + String(bl_percent)));
debugText.appendText(("\n" + String(bl_sort)));
debugText.appendText(("\n" + String(sorted)));
debugText.appendText((("\n" + "Score: ") + points.points));
i = 0;
while (i < BLOCK_TYPES) {
if (rand < bl_percent[i]){
nextPiece = sorted[i];
break;
};
i++;
};
switch (nextPiece){
case 0:
pieceType = "T";
break;
case 1:
pieceType = "S";
break;
case 2:
pieceType = "Z";
break;
case 3:
pieceType = "L";
break;
case 4:
pieceType = "J";
break;
case 5:
pieceType = "O";
break;
case 6:
pieceType = "I";
break;
default:
break;
};
debugText.appendText(("\nPiece = " + pieceType));
if (nextPiece == -1){
nextPiece = Math.floor((Math.random() * BLOCK_TYPES));
};
return (nextPiece);
}
public function wcheck_block_pos(y:Number, x:Number, type:Number, orient:Number, well:String):Number{
var dot:Array = new Array(3);
var i:Number = 0;
while (i < BLOCK_DOTS) {
dot = pieces[type][orient][i];
if (((((((((y + dot[1]) > (coords.well_h - 1))) || (((x + dot[0]) < 0)))) || (((x + dot[0]) > (coords.well_w - 1))))) || ((getPieceAt((y + dot[1]), (x + dot[0]), well) > 0)))){
return (0);
};
i++;
};
return (1);
}
public function draw_block(y:Number, x:Number, type:Number, tOrient:Number, erase:Boolean):void{
var tempSprite:Sprite;
var pieceX:Number;
var pieceY:Number;
var bmpData:BitmapData;
var blurFilter:ConvolutionFilter;
var blurArray:Array;
var color:uint;
var i:Number;
tempSprite = new Sprite();
bmpData = well_bmp.bitmapData;
if (erase){
i = 0;
while (i < BLOCK_DOTS) {
pieceX = ((pieces[type][tOrient][i][0] * pixelSize) + (x * pixelSize));
pieceY = ((pieces[type][tOrient][i][1] * pixelSize) + (y * pixelSize));
bmpData.fillRect(new Rectangle(pieceX, pieceY, pixelSize, pixelSize), 3722305023);
i++;
};
} else {
i = 0;
while (i < BLOCK_DOTS) {
pieceX = ((pieces[type][tOrient][i][0] * pixelSize) + (x * pixelSize));
pieceY = ((pieces[type][tOrient][i][1] * pixelSize) + (y * pixelSize));
color = colorLookup(pieces[type][tOrient][i][2]);
bmpData.fillRect(new Rectangle(pieceX, pieceY, pixelSize, pixelSize), color);
i++;
};
};
well_bmp.bitmapData = bmpData;
blurFilter = new ConvolutionFilter(3, 3, new Array(0, 1, 0, 1, -3, 1, 0, 1, 0), 0);
blurArray = new Array();
blurArray.push(blurFilter);
well_bmp.filters = blurArray;
}
private function get_level(i:Number):Number{
return (0);
}
public function initialize_pieces():void{
var n:Number;
var m:Number;
pieces[0] = new Array(new Array(new Array(2, 0, 1), new Array(2, 1, 1), new Array(2, 2, 1), new Array(2, 3, 1)), new Array(new Array(0, 1, 1), new Array(1, 1, 1), new Array(2, 1, 1), new Array(3, 1, 1)), new Array(new Array(2, 0, 1), new Array(2, 1, 1), new Array(2, 2, 1), new Array(2, 3, 1)), new Array(new Array(0, 1, 1), new Array(1, 1, 1), new Array(2, 1, 1), new Array(3, 1, 1)));
pieces[1] = new Array(new Array(new Array(1, 1, 2), new Array(2, 1, 2), new Array(1, 2, 2), new Array(2, 2, 2)), new Array(new Array(1, 1, 2), new Array(2, 1, 2), new Array(1, 2, 2), new Array(2, 2, 2)), new Array(new Array(1, 1, 2), new Array(2, 1, 2), new Array(1, 2, 2), new Array(2, 2, 2)), new Array(new Array(1, 1, 2), new Array(2, 1, 2), new Array(1, 2, 2), new Array(2, 2, 2)));
pieces[2] = new Array(new Array(new Array(1, 0, 3), new Array(1, 1, 3), new Array(1, 2, 3), new Array(2, 2, 3)), new Array(new Array(2, 0, 3), new Array(0, 1, 3), new Array(1, 1, 3), new Array(2, 1, 3)), new Array(new Array(0, 0, 3), new Array(1, 0, 3), new Array(1, 1, 3), new Array(1, 2, 3)), new Array(new Array(0, 1, 3), new Array(1, 1, 3), new Array(2, 1, 3), new Array(0, 2, 3)));
pieces[3] = new Array(new Array(new Array(1, 0, 4), new Array(2, 0, 4), new Array(1, 1, 4), new Array(1, 2, 4)), new Array(new Array(0, 0, 4), new Array(0, 1, 4), new Array(1, 1, 4), new Array(2, 1, 4)), new Array(new Array(1, 0, 4), new Array(1, 1, 4), new Array(0, 2, 4), new Array(1, 2, 4)), new Array(new Array(0, 1, 4), new Array(1, 1, 4), new Array(2, 1, 4), new Array(2, 2, 4)));
pieces[4] = new Array(new Array(new Array(1, 0, 5), new Array(1, 1, 5), new Array(2, 1, 5), new Array(2, 2, 5)), new Array(new Array(1, 0, 5), new Array(2, 0, 5), new Array(0, 1, 5), new Array(1, 1, 5)), new Array(new Array(1, 0, 5), new Array(1, 1, 5), new Array(2, 1, 5), new Array(2, 2, 5)), new Array(new Array(1, 0, 5), new Array(2, 0, 5), new Array(0, 1, 5), new Array(1, 1, 5)));
pieces[5] = new Array(new Array(new Array(2, 0, 6), new Array(1, 1, 6), new Array(2, 1, 6), new Array(1, 2, 6)), new Array(new Array(0, 0, 6), new Array(1, 0, 6), new Array(1, 1, 6), new Array(2, 1, 6)), new Array(new Array(2, 0, 6), new Array(1, 1, 6), new Array(2, 1, 6), new Array(1, 2, 6)), new Array(new Array(0, 0, 6), new Array(1, 0, 6), new Array(1, 1, 6), new Array(2, 1, 6)));
pieces[6] = new Array(new Array(new Array(1, 0, 7), new Array(1, 1, 7), new Array(2, 1, 7), new Array(1, 2, 7)), new Array(new Array(1, 0, 7), new Array(0, 1, 7), new Array(1, 1, 7), new Array(2, 1, 7)), new Array(new Array(1, 0, 7), new Array(0, 1, 7), new Array(1, 1, 7), new Array(1, 2, 7)), new Array(new Array(0, 1, 7), new Array(1, 1, 7), new Array(2, 1, 7), new Array(1, 2, 7)));
}
public function set_block(y:Number, x:Number, type:Number, orient:Number, well:String=""):String{
var dot:Array = new Array(3);
if (well == ""){
well = well_data;
};
var i:Number = 0;
while (i < BLOCK_DOTS) {
dot = pieces[type][orient][i];
well = setPieceAt((y + dot[1]), (x + dot[0]), dot[2], well);
i++;
};
return (well);
}
public function setPieceAt(y:Number, x:Number, type:Number, well:String):String{
var tempWell:String;
tempWell = new String(well.substring(0, ((y * coords.well_w) + x)));
tempWell = tempWell.concat(type);
tempWell = tempWell.concat(well.substring((((y * coords.well_w) + x) + 1)));
return (tempWell);
}
}
}//package