// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Scramble.java

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;

public class Scramble extends Frame
    implements ActionListener
{

    public static void main(String args[])
    {
        if(args.length > 0 && (args[0].equals("-nointro") || args[0].equals("-ni")))
            quick = true;
        new Scramble();
    }

    Scramble()
    {
        super("Scramble");
        backPanel = new Panel();
        donep = new Panel();
        tradep = new Panel();
        passp = new Panel();
        cancelp = new Panel();
        randy = new Random();
        menuItems = new MenuItem[5];
        oldTimerOption = "None";
        thinking = false;
        timerOptionChanged = true;
        gameRunning = false;
        firstGame = true;
        ask = true;
        randomPlayer = false;
        startSquare = 1;
        bonusSquares = 1;
        tileSet = 1;
        tileValues = 1;
        addNotify();
        dim = getToolkit().getScreenSize();
        setLocation((dim.width - 640) / 2, (dim.height - 480) / 2);
        setFont(new Font("Monospaced", 1, 14));
        clock = new Clock(this, new Rectangle(410, 430, 65, 30), this);
        mb = new MenuBar();
        setMenuBar(mb);
        Menu menu = new Menu("Game");
        mb.add(menu);
        newGame = new MenuItem("New Game", new MenuShortcut(110));
        newGame.addActionListener(this);
        newGame.setActionCommand("New Game");
        menu.add(newGame);
        options = new MenuItem("Options", new MenuShortcut(111));
        options.addActionListener(this);
        options.setActionCommand("Options");
        menu.add(options);
        exit = new MenuItem("Exit", new MenuShortcut(120));
        exit.addActionListener(this);
        exit.setActionCommand("Exit");
        menu.add(exit);
        Menu menu1 = new Menu("Help");
        mb.add(menu1);
        aboutItem = new MenuItem("About");
        aboutItem.addActionListener(this);
        menu1.add(aboutItem);
        rulesItem = new MenuItem("Rules");
        rulesItem.addActionListener(this);
        menu1.add(rulesItem);
        menuItems[0] = newGame;
        menuItems[1] = exit;
        menuItems[2] = options;
        menuItems[3] = rulesItem;
        menuItems[4] = aboutItem;
        board = new PaintedScrambleBoard(this);
        optionsPanel = new Panel(new CardLayout());
        Button button = new Button("Trade Letters");
        Button button1 = new Button("Pass");
        Button button2 = new Button("Done");
        Button button3 = new Button("Cancel");
        button.addActionListener(this);
        button1.addActionListener(this);
        button2.addActionListener(this);
        button3.addActionListener(this);
        tradep.add(button);
        passp.add(button1);
        donep.add(button2);
        cancelp.add(button3);
        optionsPanel.add("trade", tradep);
        optionsPanel.add("done", donep);
        optionsPanel.add("pass", passp);
        optionsPanel.add("cancel", cancelp);
        optionsPanel.setBounds(475, 425, 165, 57);
        letters = new PaintedLetters(this);
        letters.setBounds(10, 400, 400, 80);
        setBackground(new Color(200, 200, 200));
        setSize(640, 480);
        setResizable(false);
        setIconImage(makeIcon());
        if(quick)
            introscreen = new IntroScreen(this, 0);
        else
            introscreen = new IntroScreen(this, 1);
        introimage = introscreen.getImage().getScaledInstance(320, 240, 4);
        scrambleListener = new ScrambleListener(this);
        addWindowListener(scrambleListener);
    }

    Image makeIcon()
    {
        Image image = createImage(95, 90);
        Graphics g = image.getGraphics();
        FontMetrics fontmetrics = g.getFontMetrics();
        char ac[] = {
            'S', 'c', 'r', 'a', 'm', 'b', 'l', 'e'
        };
        int i = fontmetrics.charsWidth(ac, 0, 8);
        Color color = new Color(160, 160, 100);
        g.setColor(color);
        g.fill3DRect(19, 5, 57, 57, true);
        g.setColor(Color.black);
        g.drawArc(25, 19, 15, 30, 90, -160);
        g.drawArc(56, 19, 15, 30, 90, 160);
        g.drawLine(48, 10, 48, 55);
        g.drawLine(31, 30, 64, 30);
        g.drawLine(31, 36, 64, 36);
        g.drawRect(0, 0, 94, 89);
        g.drawString("Scramble", (95 - i) / 2, 86);
        return image;
    }

    void setOptions()
    {
        thinking = true;
        settings = new ScrambleSetup(this, choices);
        thinking = false;
        oldTimerOption = new String(choices[3]);
        choices = settings.getChoices();
        if(oldTimerOption.equals(choices[3]))
            timerOptionChanged = false;
        else
            timerOptionChanged = true;
        if(choices[0].equals("Random"))
            randomPlayer = true;
        else
            randomPlayer = false;
        if(choices[1].equals("Standard"))
            startSquare = 1;
        else
        if(choices[1].equals("Random"))
            startSquare = 2;
        else
            startSquare = 0;
        if(choices[2].equals("Standard"))
            bonusSquares = 1;
        else
        if(choices[2].equals("Random"))
            bonusSquares = 2;
        else
            bonusSquares = 0;
        if(choices[3].equals("None"))
        {
            for(int i = 0; i < 4; i++)
                alarmSettings[i] = 0;

            for(int l = 0; l < 4; l++)
                timerStates[l] = 0;

        } else
        if(choices[3].equals("Set for each player"))
        {
            for(int j = 0; j < 4; j++)
                timerStates[j] = 1;

        } else
        if(choices[3].equals("Change each round"))
        {
            for(int k = 0; k < 4; k++)
                timerStates[k] = 4;

        }
        if(choices[4].equals("Standard"))
            tileSet = 1;
        else
        if(choices[4].equals("Random"))
            tileSet = 2;
        if(choices[5].equals("Standard"))
            tileValues = 1;
        else
        if(choices[5].equals("Random"))
            tileValues = 2;
        else
        if(choices[5].equals("Adjust for frequency"))
            tileValues = 4;
        else
            tileValues = 0;
        if(gameRunning)
            bd = new ButtonDialog(this, "The changes are set, but won't take effect until you begin a new game.", ok);
    }

    void newGame()
    {
        byte byte0 = -1;
        byte byte1 = -1;
        byte abyte0[][] = new byte[15][15];
        int ai[] = new int[27];
        int ai1[] = new int[27];
        int ai2[] = new int[27];
        int ai3[] = new int[27];
        wantsomething = false;
        gameRunning = true;
        if(firstGame || timerOptionChanged)
        {
            bd = new ButtonDialog(this, "How Many Players?", howManyPlayers);
            firstGame = false;
        } else
        {
            bd = new ButtonDialog(this, "Choose number of players or keep names and timer settings from last game.", howManyPlayersPlus);
        }
        ask = true;
        if(bd.answer().equals("Same"))
            ask = false;
        else
        if(bd.answer().equals("Two"))
            numberPlayers = 2;
        else
        if(bd.answer().equals("Three"))
            numberPlayers = 3;
        else
            numberPlayers = 4;
        if(ask)
        {
            playersNames = new String[numberPlayers];
            for(int i2 = 0; i2 < numberPlayers; i2++)
            {
                td = new TextDialog(this, "Player " + (i2 + 1) + "'s name:", 40);
                playersNames[i2] = td.answer();
                for(int j3 = 0; j3 < i2; j3++)
                    if(playersNames[i2].equals(playersNames[j3]))
                    {
                        bd = new ButtonDialog(this, "Please choose a unique name.", ok);
                        i2--;
                    }

                if(choices[3].equals("Set for each player"))
                {
                    bd = new ButtonDialog(this, "Choose your timer, please.", timerOptions);
                    if(bd.answer().equals("None"))
                    {
                        alarmSettings[i2] = -1;
                        timerStates[i2] = 0;
                    } else
                    if(bd.answer().equals("Random"))
                        timerStates[i2] = 2;
                    else
                    if(bd.answer().equals("30 Sec"))
                    {
                        alarmSettings[i2] = 30;
                        timerStates[i2] = 3;
                    } else
                    if(bd.answer().equals("1 min"))
                    {
                        alarmSettings[i2] = 60;
                        timerStates[i2] = 3;
                    } else
                    if(bd.answer().equals("3 min"))
                    {
                        alarmSettings[i2] = 180;
                        timerStates[i2] = 3;
                    } else
                    if(bd.answer().equals("other..."))
                    {
                        td = new TextDialog(this, "Please enter the number of seconds for your timer.", 5);
                        alarmSettings[i2] = Integer.parseInt(td.answer());
                        timerStates[i2] = 3;
                    }
                } else
                if(choices[3].equals("Change each round"))
                {
                    for(int i4 = 0; i4 < numberPlayers; i4++)
                    {
                        int j4 = (int)(30D + Math.floor(randy.nextFloat() * 270F));
                        alarmSettings[i4] = j4;
                    }

                }
            }

        }
        nameBoard = new NameBoard(playersNames);
        board.setBounds(10, getInsets().top + 1, 400, 350);
        nameBoard.setBounds(410, getInsets().top + 1, 230, 373);
        drawBag = new DrawBag();
        if(tileSet == 1)
        {
            drawBag.letterSet = standardLetterSet;
            nameBoard.letterSet = standardLetterSet;
        } else
        if(tileSet == 2)
        {
            for(int j2 = 0; j2 < 27; j2++)
                ai2[j2] = 0;

            for(int k3 = 0; k3 < 100; k3++)
            {
                int i = (int)Math.floor(randy.nextFloat() * 27F);
                ai2[i]++;
            }

            drawBag.letterSet = ai2;
            nameBoard.letterSet = ai2;
        }
        brain = new Brain(this);
        if(startSquare == 1)
        {
            brain.startSquare = new Point(7, 7);
            board.startSquare = new Point(7, 7);
        } else
        if(startSquare == 0)
        {
            brain.startSquare = new Point(-1, -1);
            board.startSquare = new Point(-1, -1);
        } else
        {
            int j = (int)Math.floor(randy.nextFloat() * 15F);
            int l1 = (int)Math.floor(randy.nextFloat() * 15F);
            brain.startSquare = new Point(j, l1);
            board.startSquare = new Point(j, l1);
        }
        if(bonusSquares == 1)
        {
            brain.boardLayout = standardBoardLayout;
            board.boardLayout = standardBoardLayout;
        } else
        if(bonusSquares == 0)
        {
            brain.boardLayout = nobonusBoardLayout;
            board.boardLayout = nobonusBoardLayout;
        } else
        {
            for(int k2 = 0; k2 < 15; k2++)
            {
                for(int l3 = 0; l3 < 15; l3++)
                {
                    int k = (int)Math.floor(randy.nextFloat() * 255F);
                    if(k < 8)
                        abyte0[k2][l3] = 4;
                    else
                    if(k < 20)
                        abyte0[k2][l3] = 3;
                    else
                    if(k < 32)
                        abyte0[k2][l3] = 2;
                    else
                    if(k < 56)
                        abyte0[k2][l3] = 1;
                    else
                        abyte0[k2][l3] = 0;
                }

            }

            brain.boardLayout = abyte0;
            board.boardLayout = abyte0;
        }
        if(tileValues == 1)
        {
            brain.letterPointValues = standardLetterPointValues;
            board.letterPointValues = standardLetterPointValues;
            nameBoard.letterPointValues = standardLetterPointValues;
        } else
        if(tileValues == 0)
        {
            brain.letterPointValues = nobonusLetterPointValues;
            board.letterPointValues = nobonusLetterPointValues;
            nameBoard.letterPointValues = nobonusLetterPointValues;
        } else
        if(tileValues == 4)
        {
            int ai4[] = ((ScrambleSettings) (drawBag)).letterSet;
            for(int l2 = 0; l2 < 27; l2++)
                if(ai4[l2] > 4)
                    ai1[l2] = 1;
                else
                if(ai4[l2] == 3)
                    ai1[l2] = 2;
                else
                if(ai4[l2] == 4)
                {
                    int l = (int)Math.floor(randy.nextFloat() * 4F);
                    if(l == 0)
                        ai1[l2] = 2;
                    else
                        ai1[l2] = 1;
                } else
                if(ai4[l2] == 2)
                {
                    int i1 = (int)Math.floor(randy.nextFloat() * 10F);
                    if(i1 < 5)
                        ai1[l2] = 3;
                    else
                        ai1[l2] = 4;
                } else
                if(ai4[l2] == 1)
                {
                    int j1 = (int)Math.floor(randy.nextFloat() * 5F);
                    if(j1 == 0)
                        ai1[l2] = 5;
                    else
                    if(j1 < 3)
                        ai1[l2] = 8;
                    else
                        ai1[l2] = 10;
                }

            brain.letterPointValues = ai1;
            board.letterPointValues = ai1;
            nameBoard.letterPointValues = ai1;
        } else
        if(tileValues == 2)
        {
            for(int i3 = 0; i3 < 27; i3++)
            {
                int k1 = (int)Math.floor(randy.nextFloat() * 27F);
                if(k1 == 0)
                    ai[i3] = 0;
                else
                if(k1 == 1)
                    ai[i3] = 5;
                else
                if(k1 < 4)
                    ai[i3] = 10;
                else
                if(k1 < 6)
                    ai[i3] = 8;
                else
                if(k1 < 8)
                    ai[i3] = 2;
                else
                if(k1 < 13)
                    ai[i3] = 4;
                else
                if(k1 < 17)
                    ai[i3] = 3;
                else
                    ai[i3] = 1;
            }

            brain.letterPointValues = ai;
            board.letterPointValues = ai;
            nameBoard.letterPointValues = ai;
        }
        if(randomPlayer)
            firstPlayer = (byte)(int)Math.floor(randy.nextFloat() * (float)numberPlayers);
        else
            firstPlayer = 0;
        currentPlayer = firstPlayer;
        nameBoard.setPlayer(currentPlayer);
        add(board);
        add(nameBoard);
        add(letters);
        add(optionsPanel);
        add(clock.gClock);
        add(backPanel);
        setVisible(true);
        thinking = false;
        newGame.setEnabled(true);
        turnPart1();
    }

    void turnPart1()
    {
        optionlast = "blank";
        optionsPanel.setVisible(false);
        letters.setVisible(false);
        if(!clock.timing() && timerStates[currentPlayer] == 2)
        {
            int i = (int)(30D + Math.floor(randy.nextFloat() * 270F));
            alarmSettings[currentPlayer] = i;
        }
        if(currentPlayer == firstPlayer && timerStates[0] == 4)
        {
            int j = (int)(30D + Math.floor(randy.nextFloat() * 270F));
            for(int k = 0; k < numberPlayers; k++)
                alarmSettings[k] = j;

        }
        bd = new ButtonDialog(this, "Click on Ok to start your turn, " + playersNames[currentPlayer], ok);
        if(!clock.timing() && timerStates[currentPlayer] != 0)
        {
            clock.setAlarm(alarmSettings[currentPlayer]);
            clock.gClock.setVisible(true);
        }
        thinking = false;
        letters.setPlayer(currentPlayer);
        letters.repaint();
        letters.setVisible(true);
        turnPart2();
    }

    void turnPart2()
    {
        if(brain.optionAvailable() != 0)
            optionsPanel.setVisible(true);
        switch(brain.optionAvailable())
        {
        default:
            break;

        case 0: // '\0'
            if(!optionlast.equals("blank"))
                optionsPanel.setVisible(false);
            optionlast = "blank";
            break;

        case 1: // '\001'
            if(!optionlast.equals("done"))
                ((CardLayout)optionsPanel.getLayout()).show(optionsPanel, "done");
            optionlast = "done";
            break;

        case 2: // '\002'
            if(!optionlast.equals("trade"))
                ((CardLayout)optionsPanel.getLayout()).show(optionsPanel, "trade");
            optionlast = "trade";
            break;

        case 3: // '\003'
            if(!optionlast.equals("pass"))
                ((CardLayout)optionsPanel.getLayout()).show(optionsPanel, "pass");
            optionlast = "pass";
            break;

        case 4: // '\004'
            if(!optionlast.equals("cancel"))
                ((CardLayout)optionsPanel.getLayout()).show(optionsPanel, "cancel");
            optionlast = "cancel";
            break;
        }
        wantsomething = true;
    }

    void gotSomething(Point point)
    {
        if(wantsomething)
        {
            wantsomething = false;
            turnPart3(point);
        }
    }

    void turnPart3(Point point)
    {
        brain.notify(point);
        thinking = false;
        if(!brain.turnOver())
        {
            turnPart2();
            return;
        }
        if(brain.gameOver())
        {
            endGame();
            return;
        }
        brain.nextTurn();
        do
        {
            if(++currentPlayer == numberPlayers)
                currentPlayer = 0;
            if(!brain.canMove(currentPlayer))
            {
                bd = new ButtonDialog(this, playersNames[currentPlayer] + ": loses turn due to lost challenge", ok);
            } else
            {
                nameBoard.setPlayer(currentPlayer);
                turnPart1();
                return;
            }
        } while(true);
    }

    void endGame()
    {
        brain.endGame();
        killGame();
    }

    void declareWinner(byte byte0, int i)
    {
        bd = new ButtonDialog(this, "Wheeeee!  " + playersNames[byte0] + " won with " + i + " points!!!", ok);
    }

    void declareTie(boolean aflag[], int i)
    {
        StringBuffer stringbuffer = new StringBuffer();
        for(int j = 0; j < 4; j++)
            if(aflag[j] = true)
            {
                stringbuffer.append(playersNames[j]);
                stringbuffer.append(" and");
            }

        char ac[] = new char[256];
        stringbuffer.getChars(0, stringbuffer.length() - 3, ac, 0);
        String s = new String(ac);
        bd = new ButtonDialog(this, "Wow.  " + s + " have reached the " + "ultimate tie, each with " + i + " points.", ok);
    }

    void killGame()
    {
        removeAll();
        if(clock.timing())
            clock.clear();
        for(int i = 0; i < numberPlayers; i++)
        {
            letters.setPlayer(i);
            letters.putDown();
            for(int j = 0; j < 7; j++)
                letters.removeTileAt(j);

        }

        for(int k = 0; k < 15; k++)
        {
            for(int l = 0; l < 15; l++)
                board.place(' ', new Point(k, l));

        }

        gameRunning = false;
        optionlast = "blank";
        wantsomething = false;
    }

    void exit()
    {
        bd = new ButtonDialog(this, "Are you sure you want to quit Scramble?", yesNo);
        if(bd.answer().equals("Yes"))
            System.exit(0);
    }

    void timesUp()
    {
        bd = new ButtonDialog(this, "Sorry, but you've timed out.  Click okay to end your turn.", ok);
        clock.gClock.setVisible(false);
        brain.cleanUp();
        brain.nextTurn();
        do
        {
            if(++currentPlayer == numberPlayers)
                currentPlayer = 0;
            if(!brain.canMove(currentPlayer))
            {
                bd = new ButtonDialog(this, playersNames[currentPlayer] + ": loses turn due to lost challenge", ok);
            } else
            {
                nameBoard.setPlayer(currentPlayer);
                turnPart1();
                return;
            }
        } while(true);
    }

    public void actionPerformed(ActionEvent actionevent)
    {
        String s = actionevent.getActionCommand();
        int i = actionevent.getID();
        if("New Game".equals(s) && !thinking)
        {
            thinking = true;
            newGame.setEnabled(false);
            if(gameRunning)
            {
                if(clock.timing())
                    clock.clear();
                killGame();
            }
            newGame();
            return;
        }
        if("Options".equals(s) && !thinking)
        {
            setOptions();
            return;
        }
        if("Exit".equals(s) && !thinking)
        {
            thinking = true;
            exit();
            thinking = false;
            return;
        }
        if("About".equals(s) && !thinking)
        {
            thinking = true;
            new AboutScreen(this, introimage);
            thinking = false;
            return;
        }
        if("Rules".equals(s) && !thinking)
        {
            thinking = true;
            new RulesScreen(this);
            thinking = false;
            return;
        }
        if("Done".equals(s) && !thinking)
        {
            thinking = true;
            gotSomething(new Point(15, 8));
            return;
        }
        if("Trade Letters".equals(s) && !thinking)
        {
            gotSomething(new Point(15, 9));
            return;
        }
        if("Pass".equals(s) && !thinking)
        {
            gotSomething(new Point(15, 10));
            return;
        }
        if("Cancel".equals(s) && !thinking)
        {
            gotSomething(new Point(15, 11));
            return;
        }
        if("time".equals(s) && i == 2005)
            timesUp();
    }

    Image introimage;
    Panel backPanel;
    Panel optionsPanel;
    PaintedLetters letters;
    Panel donep;
    Panel tradep;
    Panel passp;
    Panel cancelp;
    Random randy;
    TextDialog td;
    ButtonDialog bd;
    IntroScreen introscreen;
    Brain brain;
    DrawBag drawBag;
    NameBoard nameBoard;
    PaintedScrambleBoard board;
    ScrambleListener scrambleListener;
    ScrambleSetup settings;
    Clock clock;
    Toolkit toolkit;
    Dimension dim;
    MenuBar mb;
    MenuItem newGame;
    MenuItem aboutItem;
    MenuItem rulesItem;
    MenuItem exit;
    MenuItem options;
    MenuItem menuItems[];
    int alarmSettings[] = {
        -1, -1, -1, -1
    };
    byte timerStates[] = {
        0, 0, 0, 0
    };
    static final String howManyPlayers[] = {
        "Two", "Three", "Four"
    };
    static final String howManyPlayersPlus[] = {
        "Same", "Two", "Three", "Four"
    };
    static final String ok[] = {
        "Ok"
    };
    static final String okCancel[] = {
        "Ok", "Cancel"
    };
    static final String yesNo[] = {
        "Yes", "No"
    };
    static final String noYes[] = {
        "No", "Yes"
    };
    static final String timerOptions[] = {
        "None", "Random", "30 Sec", "1 min", "3 min", "other..."
    };
    static final String numbers[] = {
        "one", "two", "three", "four"
    };
    String choices[] = {
        "Player 1", "Standard", "Standard", "None", "Standard", "Standard"
    };
    String oldTimerOption;
    byte firstPlayer;
    byte currentPlayer;
    int numberPlayers;
    boolean thinking;
    boolean timerOptionChanged;
    boolean wantsomething;
    boolean gameRunning;
    boolean firstGame;
    boolean ask;
    static boolean quick;
    int countDown;
    String optionlast;
    String playersNames[];
    boolean randomPlayer;
    int startSquare;
    int bonusSquares;
    int tileSet;
    int tileValues;
    byte nobonusBoardLayout[][] = {
        {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
            0, 0, 0, 0, 0
        }
    };
    int nobonusLetterPointValues[] = {
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
        1, 1, 1, 1, 1, 1, 1
    };
    byte standardBoardLayout[][] = {
        {
            4, 0, 0, 1, 0, 0, 0, 4, 0, 0, 
            0, 1, 0, 0, 4
        }, {
            0, 3, 0, 0, 0, 2, 0, 0, 0, 2, 
            0, 0, 0, 3, 0
        }, {
            0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 
            0, 0, 3, 0, 0
        }, {
            1, 0, 0, 3, 0, 0, 0, 1, 0, 0, 
            0, 3, 0, 0, 1
        }, {
            0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 
            3, 0, 0, 0, 0
        }, {
            0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 
            0, 0, 0, 2, 0
        }, {
            0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 
            0, 0, 1, 0, 0
        }, {
            4, 0, 0, 1, 0, 0, 0, 3, 0, 0, 
            0, 1, 0, 0, 4
        }, {
            0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 
            0, 0, 1, 0, 0
        }, {
            0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 
            0, 0, 0, 2, 0
        }, {
            0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 
            3, 0, 0, 0, 0
        }, {
            1, 0, 0, 3, 0, 0, 0, 1, 0, 0, 
            0, 3, 0, 0, 1
        }, {
            0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 
            0, 0, 3, 0, 0
        }, {
            0, 3, 0, 0, 0, 2, 0, 0, 0, 2, 
            0, 0, 0, 3, 0
        }, {
            4, 0, 0, 1, 0, 0, 0, 4, 0, 0, 
            0, 1, 0, 0, 4
        }
    };
    int standardLetterPointValues[] = {
        1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 
        5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 
        1, 4, 4, 8, 4, 10, 0
    };
    int standardLetterSet[] = {
        9, 2, 2, 4, 12, 2, 3, 2, 9, 1, 
        1, 4, 2, 6, 8, 2, 1, 6, 4, 6, 
        4, 2, 2, 1, 2, 1, 2
    };

}
