FINAL-PROJECT_COMPROG
FINAL-PROJECT_COMPROG
Brain Drain
by:
ACAR, ZAIRA KAE L.
UNTALAN, JOHN PRINCELEE
PEREZ, ARIAN JOY C.
Instructor
Mariefel T. Basibas
MAY 2024
OVERVIEW
Technology was created and one of the most advanced tools as it plays an important part in
society and with that, the world changes from time to time as the people make life a lot easier and
convenient. According to Mickeel Allen (2019), technology has been made in order to improve
the learnings of human beings as well as to enhance its immersiveness and engagement with others.
Technology allows the people to have a better communication with the content they are learning
as well as the purpose of it is in order to enhance the knowledge as well as to entertain the people
world today is full of automated machines. Computer programming uses different languages as
well as software for different categories that the developers intended to create. One of the impacts
that happened is Python as it is a programming language that is known for being the easiest
programming tool that was created for beginners. Python can be used for a variety of purposes and
as a result, it can be used to build or create it both in desktop and mobile applications. Python can
also be used to build sophisticated theoretical and numerical applications and built with features
that creates data processing and visualization easier. According to Abhishek Jaiswal (2013),
Python can run on a wide variety of technological devices and maintain a reliable user interface
for all platforms. Thus, python is an excellent language with an immersive mode that allows users
to input data from a simulator directly into the language, facilitating interactive analysis and
debugging of code snippets. The rapid advancement of technology has resulted in a high demand
for computer programming in a variety of areas, including medicine, education, and, most notably,
entertainment. Many apps, such as gaming, are created online and are used by many people to
amuse themselves and to take a break from the stressful and exhausting world. With these
considerations in mind, the programmers devised a plan to create a simple and user-friendly game
that anyone of any age might enjoy. The Brain Drain is a game that is created in order to know the
individual's limitation to think that will actually make your brain drain.
This game is powered by Python, a high-level programming language that is easy to use,
understand, and execute. It is an environmentally friendly and user-friendly application game that
will stimulate and measure a person's capacity and capability to think, as well as improve their
awareness of critical thinking. Basically, the game Brain Drain can be used in a variety of fields
since it can be easily changed using simple programming codes, and one example is using it for
educational purposes. The game number one entitled “Hangman” can be used as an icebreaker and
an energizer to start every lesson. In this game, the users will guess the word with which they are
given five chances to think of a letter that may be included in the spelling of the said word. The
"Trivia Game" is the title of the second game. It's just a simple true or false question with
interesting facts and trivias that will teach the users new information or even test their memory.
Last but not least, the "Tic-Tac-Toe," a two-player game that stimulates the users' critical thinking
ability and skill. It is similar to the traditional tic tac toe game. The game is played on a three-by-
three-square grid, with player one using X and player two using O. The winner is the first player
to get three of her marks in a row (up, down, across, or diagonally) and the game is over when all
OBJECTIVE
Brain Drain is a game in which it will test the credibility of an individual to know
their own capacity to think. The goal of this project are as follows:
● To allow the users to discover and appreciate the power and value of technology.
● To make learning an enjoyable way to acquire skills and form an emotional attachment to
● To create a relation and negative free environment for both users and programmers.
● To serve as an aid in advancing and enhancing the student’s level of understanding without
stressing.
METHODOLOGY
approach in systems analysis and software engineering for describing the structure of an
information processing program or other process. Many introductory programming and systems
analysis texts introduce this as the most basic structure for describing a process.
The inputs represent the flow of data and materials into the process from the outside. The
processing step includes all tasks required to effect a transformation of the inputs. Outputs, on the
other hand, are the data and materials flowing out of the transformation process.(Schembri, 2012).
The table below shows the IPO model that must be followed by the program. For the first
part, ask the users for their respective names, and let them choose the game they want to play,
through the use of if elif else-statement(Input). Then, the user will play and answer as per
conditions given by the game he/she picked (Process). After that, the program will display if the
Table 1
Input-Process-Output
greeting before
Game number - Show the game the - Options for the game
will show.
game.
Functions
Brain Drain is a program that is designed to give entertainment to its users. The following are the
functions used in the program as it provides three sets of games the user can choose to play.
Parameters:
Parameters:
their name
programmer or not
Parameters:
displayed.
Parameters:
displayed.
sequence of characters
representing text.
in a guessing game or a
similar application.
game or interactive
program.
errors encountered in a
program.
game or algorithmic
Republic of the Philippines
BATANGAS STATE UNIVERSITY
The National Engineering University
Alangilan Campus
Golden Country Homes, Alangilan Batangas City, Batangas, Philippines 4200
Tel Nos.: (+63 43) 425-0139 local 2121 / 2221
E-mail Address: [email protected] | Website Address: http://www.batstate-u.edu.ph
process.
Parameters:
displayed.
false.
T, and t”.
F, and f”.
trivia game
Parameters:
displayed.
dictionary.
moves made.
PROJECT FEATURES
Below are the screenshots of the valid inputs and outputs that are acknowledged by the
program.
Figure 1A Character
As shown in Figure 1A, in the game environment of "BrainDrain," users are greeted with
a warm welcome message displayed through the `print()` function, inviting them to explore the
array of games prepared for their entertainment. Following the welcoming message, the code
prompts users to make a selection from the available games by inputting their desired choice. This
input is then stored in the `game_picked` variable, enabling subsequent processing to determine
the specific game to launch or to tailor the presentation of game content based on the user's
selection. This interaction mechanism provides users with an engaging entry point into the gaming
experience, facilitating their immersion and enjoyment within the "BrainDrain" universe.
Figure 2A presents a conditional structure that executes different functions based on the
"G1", the function game_1() is called; if it matches "G2", game_2() is executed; and if it matches
"G3", game_3() is invoked. If game_picked does not match any of these values, a message "Sorry,
it's either 'G1' or 'G2' or 'G3' as the answer. Goodbye!" is printed, indicating that the user provided
an invalid input. This code segment effectively controls the flow of the program, directing it to
different game functions depending on the user's choice or informing them of an incorrect input.
Figure 3A Hangman
Figure 3A is a Python code containing a simple text-based Hangman Game. The code
features the following function definitions: intro() – prints a welcome message and prompts the
player to select a game: Hangman, Trivia, or Tic-Tac-Toe; game_1() – actual Hangman game;
game_2() – actual Trivia game; game_3() – actual Tic-Tac-Toe game; get_player_name() – asks
the user to provide their name and offers to rename the player to Pretty. The word in game_1() to
be guessed is ‘python,’ and the player has five attempts to guess it. The player takes turns guessing
words by letter. If the player guessed a letter correctly, all its occurrences are revealed in the word.
If he guessed wrong, the player lost an attempt. The game pranks the player until he guesses the
Figure 4A provided Python code outlines a straightforward text-based Trivia Game with several
key features. It starts by warmly welcoming players and providing clear instructions on how to
engage with the game. Through a series of ten true or false questions, players are prompted to input
their answers, with the code ensuring input validation for accuracy. Correct answers are rewarded
with points, and immediate feedback is provided after each response, enhancing the interactive
experience. At the game's conclusion, the total number of correct answers out of ten is displayed,
giving players a sense of accomplishment. They're then offered choices for the next action, whether
it's to replay the trivia game, explore other games, or exit. The game loop ensures smooth
progression through questions, maintaining engagement until completion. With its modular design
and seamless integration into the main menu, the trivia game offers both structure and flexibility,
Figure 5A Tic-Tac-toe
Figure 5A shows a comprehensive overview of the Tic Tac Toe game code, highlighting its
various features and functionalities. The game begins with a welcoming message and clear
instructions on how to play, ensuring that players understand the objectives and rules. It then
initializes a blank 3x3 grid where players take turns marking spaces with their symbols. The code
includes validations to ensure moves are valid and checks for winning conditions after each turn.
Additionally, it provides options for players at the end of the game, allowing them to retry the
same game, start a new one, or exit. The recursive functionality enables continuous gameplay
without restarting the program, seamlessly integrating with the main menu for a unified gaming
experience. Overall, the code facilitates user interaction at various stages, ensuring an engaging
Figure 6B Number
Figure 6B shows that users are presented with a prompt asking them what they would like
to do next after engaging with the game. They are given three options: to try again, to play another
game, or to indicate that they are finished playing. Users are then instructed to input their choice,
displayed, thanking them for their participation in the game. This interaction structure not only
provides users with a clear pathway to continue or conclude their gaming experience but also
expresses appreciation for their engagement, fostering a positive connection between the player
Source Code
print("")
game_picked = input("What game would you like to play? print(char, end=' ')
else: game_1()
print("Sorry, it's either 'G1' or 'G2' or 'G3' as the answer. elif "2" in next_move:
Goodbye!") intro()
else:
def game_1(): print("\n Okay then, thank you for playing with
print("") us!")
until you guess the correct word.") guess = input("\nGuess a character: ")
print("You only have five tries! Use lowercase letters guesses += guess
print("") turns -= 1
next_move = input("What do you want to do "Dictionary data type is used to store a collection of
next?\n 1. I want to try again.\n 2. I want to play another different data types of elements in the form of key-value
game. \n 3. I'm done playing. (1/2/3)\n> ") pairs; it is mutable and stores the unique key.",
print("\n Okay then, thank you for playing with types of elements, and it is immutable.",
print("This game consists of 10 rounds. The following "Robot is a machine resembling a human being and able
trivia is answerable only by True or False.") to replicate certain human movements and functions
"An integrated development environment is a software while True: # Loop until the player gives a valid
Development Environment (IDE) providing a wide range of if (choice.upper() in true and answers[i]) or
essential tools for Python developers, tightly integrated to (choice.upper() in false and not answers[i]):
"Python is not interpreted, object-oriented, high-level break # Break out of the loop if the answer is
else:
incorrect_attempts += 1 print("Use numbers 1-9 to mark your turn. The first to get
print("\nCongratulations! You got", correct, "out of 10 print("Are you ready? Let's go!\n")
correct.")
attempts.") blankboard = {
# Display correct answers '4': ' ', '5': ' ', '6': ' ',
print("\nCorrect answers:") '7': ' ', '8': ' ', '9': ' ',
for i in range(10): }
board_keys = list(blankboard.keys())
want to try again.\n 2. I want to play another game. \n 3. I'm # Function to print the board
game_2() print('-+-+-')
intro() print('-+-+-')
print("Tic Tac Toe is a two-player game where the first for i in range(10):
print("while the second player represents the symbol '0'. print("It's your turn, " + turn + ". Move to which
print("\t\t4 | 5 | 6")
print("\t\t7 | 8 | 9") # Check if the move is valid and update the board
continue
# Check for win or tie conditions next_move = input("What do you want to do next?\n 1. I
if count >= 5: want to try again.\n 2. I want to play another game. \n 3. I'm
blankboard['2'] == blankboard['5'] == print("\nOkay then, thank you for playing with us!")
name = alt_name
on our game.")
Republic of the Philippines
BATANGAS STATE UNIVERSITY
The National Engineering University
Alangilan Campus
Golden Country Homes, Alangilan Batangas City, Batangas, Philippines 4200
Tel Nos.: (+63 43) 425-0139 local 2121 / 2221
E-mail Address: [email protected] | Website Address: http://www.batstate-u.edu.ph
main()
Programmer
Function, Programmer