You are on page 1of 40

CHAPTER ONE

INTRODUCTION
1.1 BACKGROUND OF THE STUDY
Game is a set of activities involving one or more players with a set goal, constraints and
consequences. A game is rule-guided and involves some aspects of a contest or a trial of skill or
ability (Kasvi, 2017). Games and gaming activities have been in existence form the time
immemorial and gradually becoming an integral part of modern society. The fact that games are
immersive and engaging in a way that traditional workbooks or manuals are not, constitutes the
primary source of appeal to education and training professionals because students are highly
motivated and are more likely to engage in devote effort to persist longer at a particular activity.

In recent years, educational games have become more and more prevalent. There is an
abundance of specifically designed educational games such as the kaboot, algebraic function,
who wants to be a millionaire etc. There are also many entertainment games that have been
used for training or education. Educational games are serious games specifically used for
education. Serious games, in turn, are a concept with numerous definitions. In a broad sense
the term refers to the idea of using games (Specifically designed ones) for purposes beyond
pure entertainment. With educational games being widely used, there is a clear need to analyze
how the effectiveness of game-based learning has been studied and how the results from such
studies can inform practitioners.

There are numerous definitions of computerized games and there are also widely used in
educational concepts. Salen and Zimmerman Summarize eight different definitions focusing on
different elements and arrive at a quite condensed definition: “ A game is a system in which
players engage in an artificial contest, defined by rules, that results in quantifiable outcome.”
The definition is narrow, in particular with respect to quantifiable outcomes. In many
occasions a more open characterization, such as the one provided by prensky, including the
elements rules, goals and objectives, outcomes and feedback, conflict, competition, challenge,
opposition, interaction, and representation or story is useful. The concept of cooperation is also
an important aspect of playing educational games. Indeed, there are many games that do not
focus on competitive elements or winning. The term educational games have been defined by

1
Zyda as follows: “Educational game is a mental contest, played with a computer in accordance
with specific rules that uses entertainment to further educational objectives”.

Over the last few years, an emerging trend of games in the area of learning has been observed.
From early isolated reports on conferences and books reflecting about possible application of
digital games for learning (Gee 2003) more and more practitioners and researchers embraced
the idea, including the E learning community. The discussion are primarily focused on the pros
and Cons of the application of the game for learning, trying to find answers to why don’t we
use games more often in classrooms? Often it is painted at the difficulty to find games that
cover the curricular topics, the low tolerance of the environment towards the games where the
games are often perceived as unserious activity, with some lecturers fearing that the learning
objectives wouldn’t be reached.

Scrabble is an old classic board game, with game rules that are not very complicated.
Compared to other classic board games, such as Chess, there are more factors to take into
consideration when making a move in Scrabble. Apart from anagramming and generating
words, there are other crucial decisions to make. A player would probably find several legal
moves in one round, and then would have to decide which one to place. Choosing the move
that generates the highest score is not always the ideal way to go. It could be that making
such a move would create a situation in the next round where nothing could be done, or let
the opponent score highly.

Making the choice of which move to use include many factors, and there are several different
techniques and strategies one can follow to make the decision easier. Hitting the bonus squares
can generate an extremely high score, hence one strategy is to try to always hit the bonus
squares and prevent the opponent from doing the same. Another way of being successful is to
prioritize using letters with high score, since they would not only generate a high total score to
the player, but could also create difficult situations in the future if not used as soon as
possible.
Scrabble game is a simple game played by four, three, two even one person. Scrabble game is
also played with tiles and encountered on a special and well-designed board. The game can be
played with a board disserted with a cross-like path. In between any of the two arms of the
cross path is a center square calved out as a square box, which has a symbol of star. At the
2
down side of this board, there is a device called a Rack where the tiles are been placed before
they are picked. This rack can be any colour depending on the developer or the user, titles and
the rack can have the same colour. This rack is occupied by seven tiles at a starting and can be
change or shuffle when the need arises. Each player has a starting point (middle) where he/she
will place the tiles when picked. This spot is of different colour as the box (others) and is
called the starting point. Other features of the board include smaller square boxes that make up
the steps on the path which each tile steps on as it enters the path to produce a word.
There are double and tripple word squares on the board. In the double word lines or square if
two tiles that will generate a meaning are placed there, the player will score a high mark
likewise the tripple word square. There are tiles, which are used to call for placement, which
determine how the score is been ranked on the score device. Some makes use of the standard
set number, while some make use of only seven (7) depending on the players.

When the game is being played, the objective of each player is to navigate his tile on
the path to achieve a meaningful word. And any player whose tiles finished first wins the
games or any player that scores the highest point wins the game i.e. top score or best player.
But in other hand, the player whose tiles remain after number-of- players have finish, come
last and become the worst looser. Each player must abide by the rules and regulation of
the game that will be specified in subsequent chapters.

1.2 STATEMENT OF THE PROBLEM


Because scrabble game is played manually, young people do not have much interest in it. But
making it computer based will make young people to enjoy it.

Secondly, according to recent research inability to spell has being one of the cause of failing
examinations. Scrabble game expose players to a words from simpler to harder words, hence
help them know when the spelling they think is correct is truly correct or not.

1.3 AIM AND OBJECTIVES OF THE PROJECT


The aim of this project is to develop a scrabble game using python. The objectives are:
1. to review related works.
2. to simulate scrabble game using python programming language.

3
1.4 SIGNIFICANCE OF THE STUDY
The significance of this project cannot be overlooked especially in our today society where
education has become very paramount. Pupils in school irrespective of the level that they are in
needs to be educationally sound. And to be educationally sound, pupils must be able to
communicate in the general English language both orally and verbally. To be verbally sound
means to know how to spell and write words correctly. This proposed game will help the pupils
go a long way on that. It will help the pupils:
1. To improve spelling and vocabulary
2. Improve their verbal reasoning IQ through the logics of unscrambling a scrambled word.
3. Improves pupils creativity: it allows the pupils to use their own creativity to make new
words from the letters provided.

1.5 SCOPE AND DELIMITATION OF THE PROJECT

The scope of this project is to design a computer based scrabble game. Thus, the words in
the game may not be updated regularly. It is not an online based game.

1.6 DEFINITION OF TERMS


1. Anchor square: Vacant board square adjacent to a placed tile.
2. Bag: Tiles that have not been drawn by players.
3. BOR: Balance on rack player.
4. BS: Bonus square player.
5. Center star Square: This is a start square n the board that doubles the word.
6. Cross check set: Set of possible letters on an anchor square with regard to adjacent
word going vertical from named square.
7. Database: Organized store computerized data.
8. DAWG: Directed acyclic word graph
9. Entertainments: This is a condition that is considered favourable
10. Exchange: The act of taken and replacing.

4
11. Game: game is any activity which is executed only for pleasure and without
conscious purpose
12. Hints: Piece of practical formation.
13. Human: This is a type of game choose in scrabble
14. HSW: High score word player.
15. I spy: This is a game played by order children.
16. Kits: Instruments used in playing scrabble game.
17. Play Now Button: A command button that make the game to start
18. Programming: The act of instructing a computer to do your bidding
19. Premium Square: This is a start up square, which double the words.
20. Quit Button: A button used to terminate the operation of the game.
21. Rack: A device that holds the tiles in a scrabble game.
22. Score: To win or obtain a point in a competitive activity.
23. Scrabble Game: A game played on a board covered in square in which player wins
point by combining letter.
24. Scrabble Dictionary: A device in the scrabble game where words are listed
25. Shuffle: Often to give an appearance of activity when nothing useful is being done.
26. Solitaire: One persons game e.g. word game.
27. Submit: This makes the letter to be permanent on the board and also score the player.
28. Tiles: A piece of plastic used in playing game.
29. Triple word score: This triples the number of word on it.
30. Triple letter score: This triples the number of letter placed on it.
31. Vowel ratio: Ratio describing how many of the total number of tiles are vowels.

5
CHAPTER TWO
LITERATURE REVIEW
2.1 INTRODUCTION
In 1938, American architect Alfred Mosher Butts created the game as a variation on an
earlier word game he invented called Lexiko. The new game, which he called "Criss-
Crosswords," added the 15×15 gameboard and the crossword-style game play. He
manufactured a few sets himself, but was not successful in selling the game to any major
game manufacturers of the day.
In 1948, James Brunot, a resident of Newtown, Connecticut – and one of the few owners of
the original Criss-Crosswords game – bought the rights to manufacture the game in exchange
for granting Butts a royalty on every unit sold. Though he left most of the game (including the
distribution of letters) unchanged, Brunot slightly rearranged the "premium" squares of the
board and simplified the rules; he also changed the name of the game to "Scrabble", a real
word which means "to scratch frantically". In 1949, Brunot and his family made sets in a
converted former schoolhouse in Dodgingtown, a section of Newtown. They made
2,400 sets that year, but lost money. According to legend, Scrabble's big break came in 1952
when Jack Straus, president of Macy's, played the game on vacation. Upon returning from
vacation, he was surprised to find that his store did not carry the game. He placed a large order
and within a year, "everyone had to have one.
In 1952, unable to meet demand himself, Brunot sold manufacturing rights to Long Island-
based Selchow and Righter, one of the manufacturers who, like Parker Brothers and Milton
Bradley Company, had previously rejected the game. In its second year as a Selchow and
Righter-built product, nearly four million sets were sold.
Selchow and Righter bought the trademark to the game in 1972. JW Spears began selling
the game in Australia and the UK on January 19, 1955. The company is now a subsidiary
of Mattel.
In 1986, Selchow and Righter was sold to Coleco, who soon after went bankrupt. The
company's assets, including Scrabble and Parcheesi, were purchased by Hasbro.
In 1984, Scrabble was turned into a daytime game show on NBC. Scrabble ran from July
1984 to March 1990, with a second run from January to June 1993. The show was hosted by
Chuck Woolery. The tagline of the show in promo broadcasts was, "Every man dies; not
6
every man truly Scrabbles." In 2011, a new TV variation of Scrabble, called Scrabble
Showdown, aired on The Hub cable channel, which is a joint venture of Discovery
Communications, Inc. and Hasbro. Scrabble was inducted into the National Toy Hall of
Fame in 2004

2.2 THEORY
2.2.1 Dictionary Representation
Words from a dictionary can be stored by representing the letters as edges in a trie. A path
represents a word. Each path can have sub-paths that represent shorter word variations by
letting the nodes mark the end of a word.
Appel and Jacobsen showed that the size of the dictionary representation can be reduced with
a Directed Acyclic Word Graph, referred to as a DAWG, Jacobsen, (1988). The DAWG
can be constructed by first creating a trie and minimizing it by finding cases where two
or more words can share a common letter (node).
A new edge is then created from the previous node in one of the words to the other words
node. Finally, the unnecessary edge and node are removed.
A trie has a lot of redundancy, because identical edges and nodes are stored, while the DAWG
allows elimination of duplications.
A dictionary consisting of more than 100 000 words occupies 0.5 MB with a trie, but is
reduced to only 175 kB with a DAWG
2.2.2 Word generation algorithm
Finding and forming words to lay out on the board is difficult. Appel and Jacobsen presented a
solution to the problem by reducing the board to one dimension. Instead of searching both
horizontally and vertically, it is possible to generate words only horizontally. The
argument is that generating a word vertically is basically the same thing, with the only
difference that the board is transposed. Therefore, the word generation algorithm is
limited to only finding words horizontally. Two searches are made for each move, and
one of them over the transposed board Jacobsen, (1988).
2.2.3 Game strategies
Some of the different Scrabble game strategies are:

7
Difficult letters: letters with high score are usually more
difficult to place and should be used as soon as possible e.g. Z or
C.
Balance on the rack: it is easy to get stuck with only consonants or only vowels on the rack.
Keeping a good balance can be a good idea to help construct words in the next turn.
Bonus squares: hitting the bonus squares will generate a higher score. It is also important to
occupy them first to destroy the bonus opportunities for the opponent.
Word extensions: the ability to identify extensions (i.e. prefixes and suffixes) to words, is a
key to being a successful player. Such moves can generate very high scores, as the word will
use many existing tiles, Sheppard, (2002).
Vocabulary: there are many short words in the language, and it is rewarding if a player can
learn many short word letters which are easy to lay out.

2.2.4 Three Basic Types Of Game


As a result of research that was carried out during the development this project, a lot of books
and materials were combined such as the world Book Encyclopedia (W B E P22) which states
clearly that there are three types (basic) of games via.
 Lucky games
 Games that involves skill
 Physical Endurance Game
Board game such as scrabble game is an example of skill game since the players success
depends on the outcome of scores on the placement of tiles. The players must have skill to
win games such as darts and rings toss. However, many games call for the combination of
luck, endurance and skills.
2.2.5 Games for Young Children
Children enjoy just like adults do. The world Book Encyclopedia specifies the following
children’s game that only provides enjoyment for young children, but also helps develop
physical skills and sharp observation. These game enable the players (children) learn to adjust
to new situation and to follow rules.
2.2.6 Jump Rope Game

8
This is a type of game that is mostly played by young girls but many boys have also turns to
play, developing the skill to jump one or two ropes at a time. Two players turn the rope while
chanting a rhyme. After the player finishes the chant, he or she move away from the turning
rope. Another player moves in and started to chant while jumping the rope. A player who
fails to jump the rope must drop out of the game.
2.2.7 Games for Older Children
Since there is advancement in things of the world, so there is advancement in Children.
As children grow older, they prefer more challenging games that test their skill. Among the
games that have been long in favour among older children are the following two games:
1. Blackboard Relay
This is a game that is been developed in form of a boardgame. This game called blackboard
relay is a classroom game played by two teams. On a signal from the teacher, a player from
each team writes a word on the blackboard. Then the players return to their mates and then
give chalk to the next player to write a complete sentence.
2. ISPY
This is also known as “Twenty questions on animals, vegetables, or minerals. One player
thinks of an object and say, “ISPY” if the object is not nearby, he or she must give a clue to its
location. The other players try to guess the object by asking questions. But the first playercan
answer only with “yes” or “no”. This first player wins the games, if others could not guess
the right answer after twenty questions.

2.2.8 Games for adults


As children grew up, they begin to select the type of games that are suitable for them. Adults
mostly have interest in some advanced games such as board games that required thinking and
reasoning. Others enjoy outdoors games and sports, or indoor action games, and also games
that are in conjunction with actions and thought. Word games and some guessing games
become popular because they challenge imagination.
In scrabble for instance, players form meaningful words by combining blocks that have letters
printed on them, players also reason wisely before making a decision or before playing the
game, puzzle game and riddle are also popular. In a game called wrong capital a player
purposely name a capital in a wrong state. His opponent must locate the capital correctly.

9
Board game played with movable pieces challenge the player’s foresight and imagination.
These games include checkers chess, monopoly, life ludo game etc. In monopoly, players
try to acquire more wealth and properties than their opponents by gaining monopolies in
properties. In life, the players try to gain as much wealth as possible through investment and
business deeds.

2.2.9 Online Game.

An online game is a video game that is either partially or primarily played through


the Internet or any other computer network available. Online games are ubiquitous on modern
gaming platforms, including PCs, consoles and mobile devices, and span many genres,
including first-person shooters, strategy games, and massively multiplayer online role-playing
games (MMORPG). The design of online games can range from simple text-based
environments to the incorporation of complex graphics and virtual worlds. The existence of
online components within a game can range from being minor features, such as an
online leaderboard, to being part of core gameplay, such as directly playing against other
players. Many online games create their own online communities, while other games, especially
social games, integrate the players' existing real-life communities. Some online games can
receive a massive influx of popularity due to many well-known Twitch streamers and You
Tubers playing them.

Online gaming has drastically increased the scope and size of video game culture. Online
games have attracted players from a variety of ages, nationalities, and occupations. The online
game content can also be studied in the scientific field, especially gamers' interactions
within virtual societies in relation to the behavior and social phenomena of everyday life.

TYPES OF GAMING

 Console gaming: A console game is a form of video game, consisting of manipulable


images (and usually sounds) generated by a video game console and displayed on
a television or similar audio-video system. The game itself is usually controlled and
manipulated using a handheld device connected to the console, called a controller. The
controller generally contains a number of buttons and directional controls such as analogue

10
joysticks, each of which has been assigned a purpose for interacting with and controlling the
images on the screen

 Browser games: A browser game is a video game that is played via the World Wide
Web using a web browser. These games span all genres and can be single-player or multi-
player. They are usually free-to-play.

Some browser games are also available in other forms: as a mobile app, a PC game, or on
a console. For users, the advantage of the browser version is not having to install the game;
the browser automatically downloads the necessary content from the game's website.
However, the browser version may have fewer features or inferior graphics compared to the
others, which are usually native apps.

 Player(s) versus player(s), better known as PvP, is a type of multiplayer interactive


conflict within a game between human players. This is in contrast to games where players
compete against computer-controlled opponents and/or players, which is referred to
as player versus environment (PvE). The terms are most often used in games where both
activities exist, particularly MMORPGs, MUDs, and other role-playing video games. PvP
can be broadly used to describe any game, or aspect of a game, where players compete
against each other. PvP is often controversial when used in role-playing games

 Board Game: Board games are tabletop games that typically use pieces moved or placed on


a pre-marked board (playing surface) and often include elements of table, card, role-
playing, and miniatures games as well. Most feature a competition between two or more
players. In checkers, a player wins by capturing all opposing pieces, while Eurogames often
end with a calculation of final scores. Pandemic is a cooperative game where players all win
or lose as a team, and peg solitaire is a puzzle for one person. Another example of a board
game is:

1. Scrabble: is a word game in which two to four players score points by placing tiles, each
bearing a single letter, onto a game board divided into a 15×15 grid of squares. The tiles
must form words that, in crossword fashion, read left to right in rows or downward in
columns, and be included in a standard dictionary or lexicon.

2.2.10 SCRABBLE

11
The game is played by two to four players on a square game board imprinted with a 15×15 grid
of cells (individually known as "squares"), each of which accommodates a single letter tile. In
official club and tournament games, play is between two players or, occasionally, between two
teams, each of which collaborates on a single rack.

The board is marked with "premium" squares, which multiply the number of points awarded:
eight dark red "triple-word" squares, 17 pale red "double-word" squares, of which one, the
center square (H8), is marked with a star or other symbol, 12 dark blue "triple-letter" squares,
and 24 pale blue "double-letter" squares. In 2008, Hasbro changed the colors of the premium
squares to orange for TW, red for DW, blue for DL, and green for TL, but the original premium
square color scheme is still preferred for Scrabble boards used in tournaments.

The name of the game spelled out in game tiles from the English-language version. Each tile is
marked with its point value, with a blank tile — the game's equivalent of a wild card — played
as the word's first letter. The blank tile is worth zero points.

Tiles are usually made of wood or plastic and are 19 by 19 millimetres (0.75 in × 0.75 in)
square and 4 mm (0.16 in) thick, making them slightly smaller than the squares on the board.
Only the rosewood tiles of the deluxe edition vary in width up to 2 mm (0.08 in) for different
letters. Travelling versions of the game often have smaller tiles (e.g. 13 mm × 13 mm (0.51 in
× 0.51 in)), sometimes they are magnetic to keep them in place. The capital letter is printed in
black at the centre of the tile face and the letter's point value is printed in a smaller font at the
bottom right corner. Most modern replacement tile sets come at 18 mm × 20 mm (0.7 in
× 0.8 in).

2.2.11 PYTHON

Python is an interpreted high-level general-purpose programming language. Its design


philosophy emphasizes code readability with its use of significant indentation. Its language
constructs as well as its object-oriented approach aim to help programmers write clear, logical
code for small and large-scale projects.

Python is dynamically-typed and garbage-collected. It supports multiple programming


paradigms, including structured (particularly, procedural), object-oriented and functional

12
programming. It is often described as a "batteries included" language due to its
comprehensive standard library

Python uses dynamic typing and a combination of reference counting and a cycle-detecting


garbage collector for memory management. It also features dynamic name resolution (late
binding), which binds method and variable names during program execution.

The language's core philosophy is summarized in the document The Zen of Python (PEP 20),


which includes aphorisms such as:

 Beautiful is better than ugly.


 Explicit is better than implicit.
 Simple is better than complex.
 Complex is better than complicated.
 Readability counts.

Rather than having all of its functionality built into its core, Python was designed to be
highly extensible (with modules). This compact modularity has made it particularly popular as a
means of adding programmable interfaces to existing applications. Van Rossum's vision of a
small core language with a large standard library and easily extensible interpreter stemmed
from his frustrations with ABC, which espoused the opposite approach.

Python strives for a simpler, less-cluttered syntax and grammar while giving developers a
choice in their coding methodology. In contrast to Perl's "there is more than one way to do it"
motto, Python embraces a "there should be one— and preferably only one —obvious way to do
it" design philosophy. Alex Martelli, a Fellow at the Python Software Foundation and Python
book author, writes that "To describe something as 'clever' is not considered a compliment in
the Python culture."

Most Python implementations (including CPython) include a read–eval–print loop (REPL),


permitting them to function as a command line interpreter for which the user enters statements
sequentially and receives results immediately.

Pythons Environment

13
Python comes with a Integrated development environment (IDE) called IDLE, which is more
beginner based.

Other shells, including IDLE and IPython, add further abilities such as improved auto-


completion, session state retention and syntax highlighting.

As well as standard desktop integrated development environments, there are Web browser-


based IDEs; SageMath (intended for developing science and math-related Python
programs); PythonAnywhere, a browser-based IDE and hosting environment; and Canopy IDE,
a commercial Python IDE emphasizing scientific computing.

Application Areas Of Python

Python can serve as a scripting language for web applications, e.g., via mod_wsgi for the
Apache web server. With Web Server Gateway interface, a standard API has evolved to
facilitate these applications. Web frameworks like Django, Pyramids, TurboGears, web2py,
Tornado, Flask, Bottle and Zope support developers in the design and maintenance of complex
applications. Pyjs and IronPython can be used to develop the client-side of Ajax-based
applications. SQLAlchemy can be used as a data mapper to a relational database. Twisted is a
framework to program communications between computers, and is used (for example)
by Dropbox.

Libraries such as Numpy, Scipy and Matplotlib allow the effective use of Python in scientific
computing, with specialized libraries such as Biopython and Astropy providing domain-specific
functionality. SageMath is a computer algebra system with a notebook interface programmable
in python: its liberary covers many aspects of mathematics, including algebra, combinatorics,
numerical mathematics, number theory, and calculus, OpenCV has python bindings with a rich
set of features for computer vision and image processing.

Python is commonly used in artificial intelligence projects and machine learning projects with
the help of libraries like TensorFlow, Keras, Pytorch and Scikit-learn. As a scripting language
with modular architecture, simple syntax and rich text processing tools, Python is often used
for natural language processing.

14
Python can also be used to create games, with libraries such as Pygame, which can make 2D
games.

Python has been successfully embedded in many software products as a scripting language,
including in finite element method software such as Abaqus, 3D parametric modeler
like FreeCAD, 3D animation packages such as 3ds Max, Blender, Cinema
4D, Lightwave, Houdini, Maya, modo, MotionBuilder, Softimage, the visual effects
compositor Nuke, 2D imaging programs like GIMP, Inkscape, Scribus and Paint Shop
Pro, and musical notation programs like scorewriter and capella. GNU Debugger uses Python
as a pretty printer to show complex structures such as C++ containers. Esri promotes Python as
the best choice for writing scripts in ArcGIS. It has also been used in several video games, and
has been adopted as first of the three available programming languages in Google App Engine,
the other two being Java and Go. Python is used extensively in the information
security industry, including in exploit development.

2.3 REVIEW OF RELATED WORK


(Peter Turcan from the University of Reading, 2015) developed an early computer based
Scrabble player. In his implementation he stores the lexicon as a list of words in reverse order
of length. For each word he decides whether and where the word can be played on the board
with the given rack. Unlike many other early Scrabble programs, his move evaluation function
takes simple strategic features of the board and tiles left on the rack into consideration. Most
other programs at the time used a greedy algorithm for move evaluation, simply choosing the
move with the highest point yield.

(Stuart Shapiro of SUNY Buffalo, 2016) has implemented several Scrabble programs. His
implementations use a tree structure of letters to represent the lexicon, where each path down
the tree has an associated list of words which can be played using the letters on that path. The
tree is ordered with higher scoring letters appearing higher in the tree so that higher scoring
words are found first, in case a full search cannot be completed in the given time. His move
evaluation takes the first move found with a score higher than some threshold.

15
(Andrew Appel and Guy Jacobson, 2015) discuss an algorithm they developed that allows for
rapid move generation in Scrabble. Their implementation uses a Directed Acyclic Word Graph
(DAWG) to represent the lexicon. They discuss how their program analyses the board in terms
of anchor squares and cross sets. A “backtracking” algorithm is proposed which generates
moves from anchor squares by constructing word prefixes to the left, and then generating
words by constructing corresponding suffixes to the right. Their program uses a simple
evaluation function but they suggest at the possibility of improving performance by using a
more sophisticated heuristics function.

(Stephen Gordon, 2017) developed a data structure, called a GADDAG, which can be used to
reduce the amount of time taken to generate all possible word plays 5 when compared to using
a DAWG. The structure was designed specifically for the purpose of word generation in
Scrabble. He uses a word generation algorithm that is a slight variation on the one proposed by
Appel and Jacobson. Gordon’s representation stores a version of each word in the lexicon
starting from each letter in the word. His proposed representation is five times larger in
memory but allows words to be generated twice as fast compared to Appel and Jacobson. He
later goes on to analyse the use of different heuristics in move evaluation, and employs simple
machine learning techniques to “tune” these AI parameters. Lastly, he investigates the use and
performance of a probabilistic search method for evaluating moves. Since the probabilistic
search method is computationally expensive, he suggests combining the two methods by using
a heuristic function to narrow down the number of candidate moves to be considered.
A study was conducted by (Dianti Dwi Ningthyas, 2015) from the English education
department faculty of Tarbiyah and teacher training state Islamic institution of Tulungagung.
The research was conducted in 2015 entitled “The Effectiveness of Scrabble game towards
students Vocabulary Mastery”. In this study, the researcher used pre-experimental research
design in the form of one group of pe-test and post-test. The researcher have the objective of
the conducted in teaching vocabulary using scrabble game that aims to know the mastery of
vocabulary before being taught using scrabble game, to know the mastery of students’
vocabulary after used scrabble game .
(According to Lin, Young, Hung, and Lin, 2007). In their research titled Vocabulary learning
and retention a comparison between serious game aided and traditional English vocabulary

16
acquisition. They stated that the plentiful contexts, cognitive engagements and virtual language
learning situations in the serous games could also act as an stimulus to improve the
effectiveness of language learning. They stated that through peer interactivity and cohort
activities, beginners o English language learning successfully acquired English vocabulary
using the scrabble game on their mobile applications. That, the scrabble game was applied at
the elementary school level, without relating to the tertiary education level.

17
CHAPTER THREE
SYSTEM ANALYSIS AND DESIGN

3.1 ANALYSIS OF THE EXISTING SYSTEM


Before advancing into designing of the scrabble game, serious feasibility studies of the
manual system were carried out.
In manual play, each player keeps score, with a running tally, and these are compared from
time to time throughout the game. Some players like to make these comparisons upon every
play. This is found to be annoying and distracting. The going-out scoring in manual play is
slightly different from the rules, which come with Scrabble sets. When the bag of tiles is
empty and a player clears out his/her rack, the game is over and that player who just went
out doubles that value of the tiles in the opponent’s rack. Manual scrabble is played using
tiles, when it is a player’s turn, he shuffles the tiles in the bag or any material used and
placed or submit on the board. If a tile is selected it must not be place on any other square
except on the center start square which is pink, and always double the score for the first
word. The game end when all possible play have been made, or when each player’s scores
zero points (by passing, exchanging or losing challenges) the three consecutive turns.

3.2 WEAKNESS OF THE EXISTING SYSTEM.


The purpose of sounds is to create entertainment and push aware boredom. The reason why
most games are played for very wrong time is that they have good music embedded into the
games’ environment. In the manual system, lack of pleasant sound to the player creates
boredom. Secondly, in the manual mode of the game, it is impossible for one player to play
the game. A player needs an opponent. The game lovers cannot play the game from the
comfort of their home. With computerization of the game, it can be played with an AI
computer anywhere, anytime.
There is no automatic means of determining the winner apart from counting the tiles which
may result in erroneous counting and misjudgment.
The cost of obtaining a scrabble board is somehow expensive compared to downloading the
computerized version. And also the computerized version is more portable.

18
3.3 DATA COLLECTION TECHNIQUES
Data collection is the process of gathering and measuring information on variable of interest,
in an established systematic fashion that enables one to answer stated research question, test
hypotheses and evaluate outcomes.
The Data collection techniques used during the development of this game are:
1. Oral Interview: - Many expert in scrabble game were interviewed and the result
got from them were analyzed and used in this project.
2. Internet: - Most data were collected from the internet. Sites such as National
Scrabble Association; were visited for information on scrabble game

3.4 ANALYSIS OF THE PROPOSED SYSTEM

The game is an advanced version of the manual method. The game is designed using
python. The module used is known pygame. Pygame is a cross platform set of python
modules designed for writing 2D games. It includes computer graphics and sound liberaris
designed to be used with the python. The game is structured to be entertaining and
educative. Sounds and animations are added to the game. On launching of the game, the
welcome board is displayed. On this screen, the player is expected to select an option from
the list of option. These options are Casual, Timed, Hyper, Anagram Finder

Casual: The player has 3 lives and must guess as much valid word to earn points. Invalid
words and duplicate answers will deduct 1 life from the player. multiple word existing from
combination of the letters of the scrambled word give the user bonus scores.

Timed: The player must guess as much valid word to earn points within 60 seconds. Once
the time elapses the player lost his or her current point and its redirected to the main
interface window.

Hyper: A combination of casual and timed mode.

Anagram Finder: The player must find all the anagrams from a selection of characters. The
player has 3 lives and must guess as much valid word to earn points.

Invalid words and duplicate answers will deduct 1 life from the player . in each of the game
modes, the words are display in box form. The player uses they keyboard to enter the word
19
that is scrambled. The player will press the enter button to validate the word. Each
scrambled word may have many possible words that can be formed from its letter. The game
is designed in such a way that for each possible correct words the player validates, the
computer add bonus to the players score. The game uses embedded dictionary to validate
words.

3.5 SYSTEM ALGORITHM

An algorithm is basically an instance of logic written in software by software developers, to


be effective for the intended "target" computer(s) to produce output from given (perhaps
null) input.  Python algorithms are a set of instructions that are executed to get the solution
to a given problem. Since algorithms are not language-specific, they can be implemented in
several programming languages. No standard rules guide the writing of algorithms.
Pseudocode: Set of instructions that mimic programming language instructions. pseudocode
is a plain language description of the steps in an algorithm or another system. Pseudocode
often uses structural conventions of a normal programming language, but is intended for
human reading rather than machine reading.

Below is the algorithm for this program.

Step 1 : Start

Step 2 : Display Main Interface

Step 3 : IF User Option = C then Display Casual Game Interface

Step 4 : ElseIf User Option = H then Display Hyper Game Interface

Step 5 : Else If User Option = T Then Display Time Game Interface

Step 6 : Else If User Option = A Then Display Anagram Finder Interface

Step 7 : Stop

20
3.6 SYSTEM FLOWCHART

START

DISPLAY MAIN INTERFACE

YES DISPLAY CASUAL GAME


IF OPTION = C INTERFACE

NO

IF OPTION = H
YES DISPLAY HYPER
INTERFACE

NO

IF OPTION = T
YES DISPLAY TIMED
INTERFACE

NO

YES DISPLAY Anagram


IF OPTION = A
Finder INTERFACE

NO

STOP

Fig. 3.1: Main Menu

21
3.7 ENTITY RELATIONAL DIAGRAM

PLAYER GAME MODES

FIRSTNAME CASUAL MODE



LASTNAME HYPER MODE
NICKNAME ∞ TIMED MODE
AGE ANAGRAM
SCORE

Fig. 3.2: Entity Relational Model

3.7.1 DATA DICTIONARY

Table 3.1: Player Table


Player

Fields Data type Max_length Required

Firstname Varchar 15 Yes

Lastname Varchar 15 Yes

Nickname Varchar 15 Yes

Age Int 3 Yes

Table 3.2: Games Mode


Game modes

Fields Data type Max length Required

Casual mode Enum 1 Yes

Hyper mode Enum 1 Yes

Timed mode Enum 1 Yes

Anagram Enum 1 Yes

Score Int 10 Yes

22
CHAPTER FOUR

SYSTEM IMPLEMENTATION AND EVALUATION

4.1 PROGRAM DEVELOPMENT

The programming language used in the development of this game is Python. This is because
python is one of the most demanding and most developing language. Also, its simplicity,
efficiency and robustness make it a good option for 2D game development. Python is open
source, and cross platform independent. It has vast libraries and is very extensive. The
module used in designing this game is known as pygame. As defined in the earlier chapter,
Pygame is a cross platform set of python modules designed for writing 2D games. It
includes computer graphics and sound libraries designed to be used with the python.
The objective of using pygame in the developing the game includes:
i. to design a software that simulates scrabble game
ii. to design a well formatted graphic interface for the playing of the game
iii. to maintain a two player or more setting for the game

4.2 SYSTEM REQUIREMENTS


A computer system consists of tangible units, interconnected, and integrated to
communicate with each other to perform tasks in order to achieve a specified goal. The
system comprise of two major components which are Hardware and Software. This two is
not separable. They are interdependent. Since this project can only work on a computer
system, there are some basic requirement that must be met in order to be able to use the
program. This is classified into Software requirement and Hardware requirement.
4.2.1 SOFTWARE REQUIREMENTS
The software requirement refers to those software that needs to be installed and working in
order for the program to run effectively. The software requirements for this program are:
1. An operating system (windows 7 or latest)

For editing and modification purpose, python needs to be installed on the system, and
pygame needs to be installed.

4.2.2 HARDWARE REQUIREMENTS


The hardware requirement refers to those hardware or electromechanical devices that are
needed to play the game. These include:
1. A mouse
23
2. A keyboard
3. Not less than 1GB RAM installed
4. At least 650 MHZ of processing speed
5. At least 1GB free space on the hard disk to hold the installation set up for the
program.

4.3 SYSTEM INTERFACES


System interface is the font-end application view through which users interact with
the computer. Users can manipulate and control the program by common instructions
through a program interface. A good User interface is an attribute of a good program as it
makes the operation of the program very easy. There are many standards to follow in
developing a good program. Many factors are considered when designing the virtual
interface of a program. The targeted audience needs to be put into consideration. This factor
includes color, font style and font size. The interface of this program was designed to be
interactive and attractive..
System interface is basically divided into two. These are input interface and output interface
4.3.1 INPUT INTERFACE
This refers to that which enables the user to send data into the system, command or instruct
the program. The input interface was graphically designed to be user friendly (easy to
operate). All protocols of designing good and attractive user interface were obeyed.

Fig 4.1 Home Screen Interface

24
Fig 4.2 Casual Mode Interface

Fig 4.3 Timing Mode Interface

4.3.2 OUTPUT INTERFACE

The output interface was designed to conform with start UI design conventions. In the game

the output are results of actions such as pressing the enter key for word validation. And also

in the time based modes, once the time is up, a game over screen is display.

Fig 4.4 Game over screen

25
Fig 4.5 Message that pops when user validate wrong letter combination

4.4 SYSTEM PERFORMANCE


The software operates at a guide of 1 – 2 seconds per interval. players can easily access the
software conveniently. Almost every combination of letters of a particular scrambled word
can be recognized by the AI computer. Operating the game is typed based. The player
instructs using the keyboard.
4.5 SYSTEM TRAINING
The aspect of training in software development is very important because if not done, the
program will not operate perfectly and the intended aim will not be met. So, computer
system familiarization program should be organized so as to get the user acquainted with the
operation of the system.

4.6 CONVERSION TO THE PROPOSED SYSTEM


In the conversion of the new system, there are basically four types of conversion techniques
that are usually employed, they include the following

Direct Changeover
In this method the old system is completely replaced by the new system in one move. This
may be avoidable where the two systems are substantially different, where the new system is
a real time system, or when an extra staff to oversee its parallel running is unobtainable.
This method is comparatively cheap but is risky. Program corrections are difficult
while the system has to remain operational. The new system should be introduced during
stack periods and in large systems. It may introduce application, allowing several months
between each stage to ensure all problems are cleared up before the whole system becomes
operational.
Parallel Changeover
26
In this method , both the manual and computerized system are operated concurrently for
sufficiently long period and their outputs compared periodically and possible discrepancies
reconciled on the new system until all users are satisfied .The old system is discontinued
when discrepancies are seen to have seized arising. It has the advantage of having an old
system to fall back on, incase the new system fails. The disadvantage is the cost of running
two systems side by side, both of which will achieve similar result.
Phase Changeover
Here, the changeover starts with a department or branch. The effect of the new system in the
sample department or branch is observed before some other department or branch which
may be more sensitive can adapt to the new system .
Pilot Changeover
In this case, some transactions that are very complex are operated using parallel changeover
and in other remaining existing system in application, direct changeover is used.
In our own case, switching to the new system depends on how people find the game
interactive and interesting. During the testing phase of this game, lots of people appreciated
our efforts and adopted the game. Therefore, the direct change over conversion is likely to
be employed.

4.7. SYSTEM MAINTENANCE


This ensures an ongoing process after implementation, its purpose being to ensure that the
system continuously provide the desired service as planned. The user or educators may
make additional capabilities, since the computer industry is rapidly changing, maintenance
would have to be carried out. This maintenance includes updating the installation and
modifying the correct version to conform the program standard. Subsequently, upgrade will
be made to make the game more interesting. But whenever there’s an update, we can notify
the user to download the new version through the game’s notification.

4.7.1 METHODS OF SYSTEM MAINTENANCE


The following are the method of system maintenance.
I. Emergency Maintenance: this is due to the malfunction or bug in the system
where maintenance is urgent and usually calls for immediate attention. The
malfunction could be because the program was not tested completely, even though
the system, must have run perfectly for months or even years. The information the
user usually identifies the malfunction. Then a team of analyst and programmers

27
should rectify it if the malfunction is in computer program and caused by a system
input.
II. Routine Maintenance: it is required to keep systems performance in order as it
reflects the organization environment. The activities may be rewriting manual
procedures, conducing training sessions, altering report formats and contents and
forming new processing logic for computer programs. For e.g a new tax law may
require a change in the calculation of net pay or new accounting depreciation
method may be adopted.
III. Special Report Request: these are periodic requests for tactical and strategic
management information, which does not come under routine production. These
special request can be satisfied directly by a user with a database management
system and the analyst assists in preparing the necessary procedures for the request.
Eg. A special report on selected products during a sales promotion.
IV. System Improvements: when a new system is implemented, users may suggest
additional improvements to the system. To make the changes, the analyst
determines if it can be met with the existing database develops the necessary
manual and computer procedures to satisfy the requirements.

CHAPTER FIVE
SUMMARY, RECOMMENDATIONS AND CONCLUSION
5.1 SUMMARY

28
At the end of this project work, the software that can successfully simulate scrabble
game was developed. The graphical interface was beautified, and the logic simulation
well-structured as to maintain a high level of accuracy in game scoring and declaring of the
winner.
This project work also will serve as a stepping stone for people who wish to research more
on this topic. The procedures for developing games are difficult, but has a lot of fun
attached to it as there are so many things to benefit from playing computer games,
especially the scrabble game as explained in the earlier chapters.

5.2 RECOMMENDATIONS

The following recommendations are made:


1. Playing of scrabble game should be encouraged as it helps to build students logical
reasoning.
2. Scrabble game should be simulated and marketed so as to gain popularity among
computer games.
3. The use of computer in playing games helps to reduce stress and should be
encouraged. It should be integrated in to classroom teaching, at least it will improve
class interactivity.

5.3 CONCLUSION
The development of computer games involves many phases. The approach used is a top-
down, one concentrating on what first, then how and moving to successive levels of details.
The first phase started with a detailed study of the problems and rules for playing games.
In the course of this project, many problems were discovered to have hindered the
effectiveness of the existing system. These problems, information needs, and activities
were documented and later used as the basis for system design, which immediately
followed the first phase. The design phase was concerned primarily with the specification
of the system elements in a manner that best met scrabble game rules. During this
phase, strict adherence was made on proven software engineering principles and
practices. To implement this design, a computer program was then written and tested in
the Vs code environment. This software product is designed to run on all windows. It is
hoped that effective implementation of this software product would eliminate many
problems discovered during systems investigation. This will no doubt result in improved

29
game simulation and catching of fun among players. The objectives were achieved using
python programming language.

REFERENCES

30
Appel, A.W., Jacobsen, G.J. (1985). The World's Fastest Scrabble Program,Commun.
ACM, 31(5).

Dianti D. N (2015). Simulation Issues in Electronics Manufacturing. Proceedings of the


1992 Winter Simulation Conference.

Gordon, S. A. (2017). A Faster Scrabble Move Generation Algorithm, Software - Practice


and experience, Vol. 24(2).

Ingalls, R.G. (1998). The Value of Simulation in Modeling Supply Chains. Proceedings of
the 1998 Winter Simulation Conference.

Jacobsen (1988). The world’s fastest scrabble program. Commum. ACM,31(5)

Law, A.M., Kelton W.D. (2000). Simulation Modeling and Analysis, 3rd ed. McGraw-
Hill.

Lin et al.(2007). Syntactic annotations for the google books ngram corpus. In Proceedings
of the ACL 2012 system demonstrations, pages 169–174. Association for
Computational Linguistics, 2012.

Manning C. D., Raghavan P. (2008). Introduction to Information Retrieval, Cambridge


University Press.

Peter, T (2015). A competitive scrabble program. SIG Art Newsletter, 80:104109,1982.

Russel S., Norvig P. (2009). Artificial Intelligence: A Modern Approach 3rd ed. Prentice
Hall.

Sheppard B. (2002). Towards Perfect Play of Scrabble, Maastricht. Scrabble letter points,
http://en.wikipedia.org/wiki/Scrabbleletter distributions, April 2012

Staurt, S. (2016). World English-Language Scrabble Players' Association (WESPA) rules,


http://www.wespa.org/rules/RulesV2nov11.pdf

31
APPENDIX A (INTERFACE)

Fig.1Home Page Interface

Fig.2Casual Game Mode Interface

Fig.3 Casual Mode when user fails


Fig.4Casual Mode When player get right combination of letters

Fig.5Game Over in Casual Game Mode

Fig.6TimeMode when user enter wrong letter combination


Fig.7Timed Word combination

Fig.8When time is up in timed up

Fig.8Anagram Finder
Fig.8Advance Play Interface
APPENDIX B (SOURCE CODE)

For Main.py
"""Main Script (Executable)"""
from config import *
from engine import *
from interface import *
import pygame as pg
Game Engine
ENGINE = Engine()
# Initialize Game Interface
instance = Game()
# Run Game Loop
while instance.running:
# Show Start Screen
mode = instance.start_screen()
if mode == 'i' :
# Show Credits Screen
instance.credits()
continue
elif mode == None:
break
else:
# New Game, Pass Engine Instance
instance.new(ENGINE, mode)

# Show Game Over Screen


instance.game_over()

pg.quit()

for Interface
"""Game Interface Class"""

import pygame as pg
import random, math
from engine import *
from config import *
from sprites import *

class Game:

def __init__(self):
"""Initialize Game Instance
Returns:
None
"""
pg.init()
pg.mixer.init()
self.icon = pg.image.load(ICON)
self.background = pg.transform.scale(pg.image.load(BACKGROUND), (WIDTH,
HEIGHT))
pg.display.set_icon(self.icon)
pg.display.set_caption(TITLE)
self.screen = pg.display.set_mode((WIDTH, HEIGHT))
self.clock = pg.time.Clock()
self.running = True
self.load()

def load(self):
"""Load Resources

Returns:
None
"""
self.sounds = {
'fail': pg.mixer.Sound(AUDIO['fail']),
'success': pg.mixer.Sound(AUDIO['success']),
'enter': pg.mixer.Sound(AUDIO['enter']),
'click': pg.mixer.Sound(AUDIO['click']),
'start': pg.mixer.Sound(AUDIO['start']),
'end': pg.mixer.Sound(AUDIO['end'])
}

self.music = {
'menu': AUDIO['menu'],
'game': AUDIO['game']
}

def new(self, engine, mode):


"""Start a New Game

Arguments:
engine {Engine}
mode {dict} : Mode configuration

Returns:
None
"""
self.engine = engine
self.mode = mode
self.pool = self.engine.combine(mode['scrambled_words'])
self.lives = mode['lives'] if mode['lives'] != 0 else float('inf')
self.time = mode['time'] if mode['time'] != 0 else float('inf')
self.score = 0

if mode['exact_match']:
engine.search()

self.start_time = pg.time.get_ticks()
self.current_word = ''
self.matched_words = []
self.buttons = pg.sprite.Group()
self.pool_tiles = pg.sprite.Group()
self.word_tiles = pg.sprite.Group()
self.pool_tiles.empty()

for i, letter in enumerate(self.pool):


self.pool_tiles.add(Letter(letter, i + 1, len(self.pool)))

self.word_tiles.add(Text(self.mode['instructions'], 15, COLOR.BROWN, WIDTH / 2,


int(HEIGHT * 0.6)))
self.word_tiles.add(Text('PRESS [ ENTER ] TO SUBMIT AND [ ESC ] TO EXIT', 15,
COLOR.BROWN, WIDTH / 2, int(HEIGHT * 0.6) + 25))
self.sounds['start'].play()
pg.mixer.music.load(self.music['game'])
self.run()

def run(self):
"""Run Game Loop

Returns:
None
"""
For Engine
"""Core Game Engine"""
from config import DICTIONARY
from random import sample, shuffl
class Engine:
def __init__(self, path = ''):
"""Initialize Engine, load Dictionary from Path if passed
else, load from default sourc
Arguments:
path {str} : Path to dictionary file
Returns:
None
"""
if bool(path):
self.seed(path)
else:
self.seed(DICTIONARY)
self.pool = []
self.picked = []
self.matchable = []
def seed(self, path:str):
"""Read Dictionary Text File
Arguments:
path {str} : Path to text fil
Returns:
None
"""
dict_file = open(path, 'r')
self.dictionary = tuple([w.strip() for w in dict_file.readlines()])

def pick(self, number:int = 3, indices:list = []):


"""Get List of Words from Dictionary

Arguments:
number {int} : Number of Items
indices {list} : List of Indices

Returns:
{list} : List of words
"""
if len(indices):
self.picked = []

for i in indices:
self.picked.append(self.dictionary[i])
else:
self.picked = sample(self.dictionary, number)

return self.picked

def search(self, source = ''):


"""Find Anagrams from Dictionary

Arguments:
source {str|list} : Characters to user

Returns:
{list} : List of words
"""
matchable = []

if len(source):
pool = source
else:
pool = self.pool
self.matchable = matchable

for word in self.dictionary:


if sorted(word) == sorted(pool):
matchable.append(word)

return matchable

def combine(self, number:int = 3, words:list = []):


"""Create a Scrambled Character Pool

Automatically calls pick() method

Arguments:
number {int} : Number of Items to Pick
words {int} : List of Words

Returns:
{list} : Letter pool
"""
pool = []

if len(words):
picked = words
else:
picked = self.pick(number)
self.matchable = []
self.pool = pool

for word in picked:


word = list(word)
for char in pool:
if char in word:
word.remove(char)
pool += word
shuffle(pool)

You might also like