Friday, September 20, 2019
Analysis Of Scrabble, The Board Game
Analysis Of Scrabble, The Board Game Scrabble is a word building multiuser game that consists of tiles which are distributed to the players. Scrabble game can have two to four players and the ultimate objective is to form crosswords on the scrabble board. Scrabble board: The board is of 15*15 square grids. There are exactly 100 tiles available in which 98 of them are marked tiles which are alphabets from A-Z and two anonymous letters [blank tiles] and each alphabet is given a score and a blank letter is given 0 points. In scrabble, each letter have different value depends on the frequency of its usage. Blank tiles can be a substitute for any letter. Tile Values: Letters Q,Z have 10points Letters j, x have 8 points Letters f,h,v,w and y have 4 points Letter k have 5 points Letters b,c,m,p have 3 points Letters d,g have 2 points Letters a,e,i,o,u,s,t,r,n,l have 2 points each Extra points: In the scrabble board we have some squares represent multipliers. If a tile is placed on those squares the tile value is doubled or tripled based on the type of square. Double letter score: If a tile is placed on this square space the tile value is doubled, generally these cells are in light blue colour on scrabble board Triple letter score: If a tile is placed on this square space the tile value is tripled, generally these cells are in dark blue colour on scrabble board Double word Score: If a player place a word on one of these squares, the value of the entire word is doubled.generally, these are found diagonally towards the four corners of the scrabble board and these cells are in light red/pink colour. Triple word Score: If a player place a word on one of these squares, the value of the entire word will be tripled. Generally, these are found on all the sides of the board equidistant from all the corners of the scrabble board. http://www.scrabblepages.com/scrabble/rules/ Course of the game: The players are initially given a rack with seven letters known as tiles placed on a rack which can be exchanged from the bag which already consists of the tiles that act as warehouse for storing the letters. To frame a word on the scrabble board, we should place a tile from the rack connecting at least single tile which is already placed on the board. New tiles will be placed on the rack from the sack, based on the number of tiles placed on the board. Each letter will have different point value, so the game strategy is to play words with high scoring letter combinations. (Scrabble rules, 2010). A Dictionary is used to check whether the words formed by the players are valid or not. A player can Pass his chance to opponent. Also we will have another way that when a player clicks on exchange button (for this the player will be given 0 points) it will perform two activities: Firstly it replaces the set of tiles on the rack/stand with new set of tiles and then it will give the turn to the opponent player. If an individual used all his 7tiles on the rack at a time he will be awarded bonus points. Aim: Objective: Requirements: Literature Survey: Random Number Generation Algorithm: The algorithm is used when the user wants to exchange his entire rack of 7 letters with a new set of letters from the bag. The user when tries to click the exchange button, this algorithm needs to run generating the different random letters given to the user for forming a word in his next turn as mentioned in the course of the game. This algorithm can be implemented in several ways by using the function Math.random () that generates numbers between 0 and 1. As the letters need to be generated, they can be converted to characters by multiplying with 26 which represents the number of alphabets (Programming Forums, 2010). System Architecture: The system architecture is useful in the design or developing games as this process comprises of listing the requirements and finding the paths to meet the requirements. In the current design of scrabble board, the requirements are mainly categorized in two different types. The primary thing is to play the game of scrabble. Next priority is given to the implementation of scrabble game with GADDAG or DAWG algorithms. Initial requirement for playing a scrabble are about the software that would be used: 1. Java, platform independent language is used for implementing the game: The key class files that are needed for the initial start-up of scrabble: a. Board b. Rack c. Dictionary. These are the files which are primarily responsible for the user interface view. The user when executes the java file, these classes are initialized. The class file Board.java consists of a main function which in turn calls the method board (). The variables that might be used in this class are: tiles, blocks, word, square, and letters. Another method: Rack.java is initialized once the player starts the game. At the time of initialization, the rack consists of seven letters that are taken from the bag that consists of letters that will be distributed to each player based on the count of the number of letters placed on the board. Rack gets exchanged with a new set of letters if the player wishes to skip his turn by clicking an exchange button. Bag.java is the class file which fetches the information related to all the letters, their values are stored separately; this is initiated in preliminary step of Start Game. The bag contains all the 26 letters and blank letters. While playing the move, the user mouse events need to be noted. So, the methods: Mouse Clicked (), Mouse Released (), Mouse Pressed (), Mouse Exited (), Mouse Entered () will be defined based on the required events. The drag and drop of letters on the board are noted with the help of Mouse Pressed () and Mouse Released (). If the axis co-ordinates are same for both the events, it is noted that the letter is not placed on the board. Else if the co-ordinates are changed, the letters that are placed are noted. When the user hits the play button, event: Mouse Clicked () triggers and the result: letters that are placed on the board. Thus, the formed word is validated using the dictionary program which will be the implementation of GADDAG algorithm. This can be used in two different situations: a. When the user hits play button, it calculates the number of letters that the user placed on the board an d those many numbers of random letters are placed on the rack. When the user hits exchange button, the exchange.java program starts here: It selects all the letters are drop them in to the database i.e., (Bag) and provide the player with a new set of letters. Score for each letter and their values are calculated depending on the word formed and tiles under the letter. Logic for scoring goes under this area where a triple letter or triple word or double letter or double word is calculated. Execution Flow: The design of the scrabble is as follows. The first step would be to show a board, a rack and score with initial values zero for all the players. But initially the rack would be showing the seven letters those need to be on the rack for forming a word. Then, the words are formed using these letters on the rack. The letters that are placed on the scrabble is performed by using the methods: Move generation and Go On procedure as explained in the GADDAG algorithm. Moreover, GADDAG algorithm is implemented for the underlying reason of dictionary implementation which validates the word formed. The valid word as mentioned, score of each letter is counted adding all the special tiles (triple or double letter or words). There are certain variables that need to be initialized for the execution of scrabble. There should be a counter that identifies the number of letters placed or number of points awarded. Once the user plays his move with the help of Move generation and Go On procedures, the word is set to check for the validity. The variable validity is set to 0 if the word is not valid and a message that the word is invalid is displayed. Else, if the variable is set to 1 then, the Score.java class gets executed. The variable score takes the count of all the points that the player scored and updates the scoreboard for the respective players. Scrabble Board Additional Features: The optional requirements of clicking the exchange button that result in the new set of 7 letters on the rack. Here, the score becomes zero for that turn of the player. Here, the program needs to drop the letters from the rack and retrieve new set of letters. One more additional feature that might be present is Help button: When this button is triggered, the help button results in showing hints for two letter words that can be easily formed when there is a least chance for forming a word. Mouse event that needs to be triggered for this action is Mouse Clicked (). The final option that needs to be placed on the scrabble board is about: Quit button. This triggers the mouse event: Mouse Exited () which will prompt the user if he really wants to quit from the game with a menu options of Yes or No. There is one more way to finish the game. When all the tiles are used and there are no ways in which the tiles can be used for forming a word. The number of points that come from these letters that are present on the rack are calculated. These points are deducted from the total score on the scoreboard. Then, the final scores are compared with each player and the player with more points is considered to be the winner which is obvious result for a game. Technical Specifications: A scrabble board will be designed with the help of swings or Java Server Pages to form a 15*15 tiles board. The board that consists of tiles need to be filled with letters which are represented as images that have score for each corresponding letter. All the letters are stored in a database (mysql) which can be retrieved from the database using the concept of JDBC (Java Database Connectivity). While placing the tiles the concept of counter decrementing or incrementing is used for keeping the timer. Java Server Pages helps the user to design certain web applications in the form of static and dynamic components. The features of JSP technology include constructs that would be used for accessing server side objects and the code is written in text based documents that consists of the responses and requests from and to the server respectively. Swings provide multiple platform independent interfaces that may interact the users and GUI components. These APIs can be imported from the package import javax.swing.*; JDBC: is a Java API that can be used in accessing tables and entities which are stored in a relational database. These coding and technical specifications can be implemented in user friendly interfaces namely Eclipse or NetBeans IDE software where the code can be written to make easier manner of implementation (Java, 2010). Testing: Testing is a part of software development lifecycle. Life cycle of a testing identifies what activities should carry out and when to accomplish those activities. Testing plan should identify the areas to be tested and also it should calculate the risk associated with the implementation. Testing need to be carried until it reaches a checkpoint without any errors. We have different types of testing like unit testing, black box testing, white box testing, Integration testing, End-to-end testing, alpha testing, functional testing,compatable testing etc. Types of Software Testing: Different Testing Types with Details
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.