Report Template Internship Tic Tac Toe
Report Template Internship Tic Tac Toe
Faculty of Engineering
By
Tony Elie Sawma
Committee Members
Tony Sawma
I, (Tony Elie Sawma) here by release, insure, and hold harmless the Arts, Sciences & Technology
University in Lebanon from any and all liability, thereof to use and publish my personal work,
with identification of me by name.
P a g e | 2 of 33
Dedication
To whom you want to dedicate your project Family – Friends – Wife – Husband
P a g e | 3 of 33
Acknowledgements
First I would like to thank our university higher management, my project supervisor (Fady
Halabi) for his advice, and support.
The researcher moves later to acknowledge the help of people who facilitated his/her work in
collecting and processing the data (interviewed people, professionals, etc.).
The researcher may thank later on his/her managers and colleagues at work. He/she shall
continue with acknowledging his friends and finally, his parents and family.
P a g e | 4 of 33
Abstract
P a g e | 5 of 33
Table of Contents
Internship Release Form..................................................................................................................2
Dedication........................................................................................................................................3
Acknowledgements.........................................................................................................................4
Abstract............................................................................................................................................5
Chapter I Introduction.............................................................................................................10
Chapter II Work Description.....................................................................................................11
Chapter III Analysis and Evaluation...........................................................................................12
III.1 Section 1..........................................................................................................................12
III.1.1 Sub-Section 1...........................................................................................................12
III.1.2 Sub-Section 2...........................................................................................................12
Conclusion......................................................................................................................................14
Future Works.................................................................................................................................15
References.....................................................................................................................................16
Appendices....................................................................................................................................17
P a g e | 6 of 33
List of figures
Figure 1 Predefined styles in the Internship Manual....................................................................12
P a g e | 7 of 33
List of Tables
Table 1 A sample table...................................................................................................................13
P a g e | 8 of 33
List of Abbreviations
IEEE The Institute of Electrical and Electronics Engineers
…
P a g e | 9 of 33
Chapter I Introduction
P a g e | 10 of 33
4. Once the game is over the app will declare who lost the game. If no one
wins, it will declare that it was a draw match.
Prerequisites for development of Tic
Tac Toe game?
So, this android application game will be developed using the Android Studio.
To develop any Android application in Android Studio, you would definitely
need good hands of following tools / technologies:
1. The first file that we have created is activity_main.xml, this file has the
layout of the Tic Tac Toe board. Through this, we manage the interface of
the Android Application.
2. The next important file is the MainActivity.java file. This file makes the
application actually work. It has all the methods that make functioning in
the app possible.
3. Then we have developed some other files that were required for the
interface of application that are listed below:
1. style.xml: This file has the description of cells for Tic Tac Toe
board. It has height and width with the text size and colors described
2. colors.xml: This file has the colors described so it would be easy to
mention the color name to recognize it
3. strings.xml: This describes the list of strings that are used in the
application
P a g e | 11 of 33
4. dimens.xml: This has the dimension of grid of our Tic Tac Toe
android game.
P a g e | 12 of 33
Chapter II Work Description
8. Development Process
We planned the project over a period of 15 days and divided it into four iterations. We planned the
first iteration for analysis, second iteration for game design, third iteration for coding and the final
iteration for the product.
In the first iteration, we focused on Project analysis determined as the first planned milestone of the
project. Analysis is essential for starting of upcoming milestones and delivering a finished project on
time. Successful completion of a project is heavily dependent on effective analysis.
The second iteration started by brainstorming among group members on what the game would be.
Each group member denoted the attributes or properties of the game that one dreamed to implement.
We gathered suggestions together and chose the ones that was possible to be implemented within a
15 days project time. As soon as the game concept became clear, we made some early decisions on
basic requirements of the project in order to more easily reach the development goals. Game design
document was meant to be a living document. In other words, throughout the production process the
document was updated, if needed.
P a g e | 13 of 33
In the third iteration coding in Java using Android studio was under way. Therefore, most of time in
this iteration was dedicated for internal training sessions. In this iteration, we needed to achieve four
milestones each was dependent on the previous one.
Last iteration was planned for testing and finalizing the product. The testing process is an iterative
process. We performed the testing process in four iterations. The successful testing process of
software requires a good plan. Therefore, after the requirements of the project are confirmed, the
future testing of the system and the code were planned. The test plan provided information on how
and when the testing will be executed. In the second iteration, test cases were designed for the
planned tests. In iteration three, the designed test cases were executed alongside the module
testing and usability testing. During the last iteration, according to the result of the tests, the test
reports were documented properly and the bugs were reported after the testing is completed.
P a g e | 14 of 33
Chapter III Analysis and Evaluation
P a g e | 15 of 33
2. Maximum high definition.
3. Minimum hardware requirements which is relevant for this game.
4. Design whole system with efficient manner.
P a g e | 16 of 33
(d) Texturing models
(e) Animation
3. Sound engine will be responsible for playing music and sound effects.
(a) Multithreading
(b) Playing sounds
4. Input engine will be responsible for transferring mouse and keyboard input upon request to the
game engine.
(a) Retrieving Input
5. Menu Engine will handle all menus in game.
15. Testing
Testing is a process of executing a program with the intent of finding an error. Testing is a crucial
element of software quality assurance and presents ultimate review of specification, design and
coding. System Testing is an important phase. Testing represents an interesting anomaly for the
software. A good test case is one that has a high probability of finding an as undiscovered error.
16. Test Levels
The test approach is divided into three main phases: Module testing, integration testing and system
testing. In addition, the system testing includes two sub-phases: functional and usability testing.
These planned tests are explained briefly below.
(a) Module testing will perform during coding by using debug messages to check that the written
code produces wanted results. An important requirement is that the code will compile with zero bugs.
(b) Integration testing will perform after finish module testing in order to validate if each module
can work fine with each other. Integration Test proves that system works as integrated unit when all
the fixes are complete.
(c) System testing includes two phases: functional testing and usability testing. These will perform
after the product reaches its final version. During functional test phase, the tester will test if the
product meets the game requirements. The tester tests the requirements using the use cases listed
below in Test Cases section. The usability test will perform to understand how easy it is to learn to
play the game. Any person out of the team members will perform this test by playing the game.
P a g e | 17 of 33
17. Code
(a) MainActivity.java
package com.example.tuhin.tictactoe;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
Button b1,b2,b3,b4,b5,b6,b7,b8,b9;
int turn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1=(Button)findViewById(R.id.b1);
b2=(Button)findViewById(R.id.b2);
b3=(Button)findViewById(R.id.b3);
P a g e | 18 of 33
b4=(Button)findViewById(R.id.b4);
b5=(Button)findViewById(R.id.b5);
b6=(Button)findViewById(R.id.b6);
b7=(Button)findViewById(R.id.b7);
b8=(Button)findViewById(R.id.b8);
b9=(Button)findViewById(R.id.b9);
turn=1;
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b1.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b1.setText("X");
} else if (turn == 2) {
turn = 1;
b1.setText("O");
}
}
endGame();
P a g e | 19 of 33
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b2.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b2.setText("X");
} else if (turn == 2) {
turn = 1;
b2.setText("O");
}
}
endGame();
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
P a g e | 20 of 33
if(b3.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b3.setText("X");
} else if (turn == 2) {
turn = 1;
b3.setText("O");
}
}
endGame();
}
});
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b4.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b4.setText("X");
} else if (turn == 2) {
turn = 1;
P a g e | 21 of 33
b4.setText("O");
}
}
endGame();
}
});
b5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b5.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b5.setText("X");
} else if (turn == 2) {
turn = 1;
b5.setText("O");
}
}
endGame();
}
});
P a g e | 22 of 33
b6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b6.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b6.setText("X");
} else if (turn == 2) {
turn = 1;
b6.setText("O");
}
}
endGame();
}
});
b7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b7.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
P a g e | 23 of 33
b7.setText("X");
} else if (turn == 2) {
turn = 1;
b7.setText("O");
}
}
endGame();
}
});
b8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b8.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b8.setText("X");
} else if (turn == 2) {
turn = 1;
b8.setText("O");
}
}
P a g e | 24 of 33
endGame();
}
});
b9.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(b9.getText().toString().equals("")) {
if (turn == 1) {
turn = 2;
b9.setText("X");
} else if (turn == 2) {
turn = 1;
b9.setText("O");
}
}
endGame();
}
});
}
public void endGame(){
P a g e | 25 of 33
String a,b,c,d,e,f,g,h,i;
boolean end=false;
a=b1.getText().toString();
b=b2.getText().toString();
c=b3.getText().toString();
d=b4.getText().toString();
e=b5.getText().toString();
f=b6.getText().toString();
g=b7.getText().toString();
h=b8.getText().toString();
i=b9.getText().toString();
if(a.equals("X") && b.equals("X") && c.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
}
if(a.equals("X") && e.equals("X") && i.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
P a g e | 26 of 33
}
if(a.equals("X") && d.equals("X") && g.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
}
if(b.equals("X") && e.equals("X") && h.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
}
if(c.equals("X") && f.equals("X") && i.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
}
if(d.equals("X") && e.equals("X") && f.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
}
if(g.equals("X") && h.equals("X") && i.equals("X")){
Toast.makeText(MainActivity.this,"Winner Player X",Toast.LENGTH_LONG).show();
end=true;
}
P a g e | 27 of 33
if(a.equals("O") && b.equals("O") && c.equals("O")){
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(a.equals("O") && e.equals("O") && i.equals("O")){
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(a.equals("O") && d.equals("O") && g.equals("O")){
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(b.equals("O") && e.equals("O") && h.equals("O")){
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(c.equals("O") && f.equals("O") && i.equals("O")){
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(d.equals("O") && e.equals("O") && f.equals("O")){
P a g e | 28 of 33
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(g.equals("O") && h.equals("O") && i.equals("O")){
Toast.makeText(MainActivity.this,"Winner Player O",Toast.LENGTH_LONG).show();
end=true;
}
if(end) {
b1.setEnabled(false);
b2.setEnabled(false);
b3.setEnabled(false);
b4.setEnabled(false);
b5.setEnabled(false);
b6.setEnabled(false);
b7.setEnabled(false);
b8.setEnabled(false);
b9.setEnabled(false);
}
}
}
P a g e | 29 of 33
Conclusion
P a g e | 30 of 33
18. Conclusion
The Tic Tac Toe game is most familiar among all the age groups. Intelligence can be a property of
any purpose-driven decision maker. This basic idea has been suggested many times. An algorithm of
playing Tic Tac Toe has been presented and tested that works in efficient way. Overall the system
works without any bugs.
P a g e | 31 of 33
Future Works
P a g e | 32 of 33
References
[
Appendices
P a g e | 33 of 33