Warship C++: An entity of Battleship

Slides:



Advertisements
Similar presentations
A Case Study  Some Advice on How to Go about Solving Problems in Prolog  A Program to Play Connect-4 Game.
Advertisements

Answer "What If" Questions
Coordinate Plane 3.8 Coordinate Plane Is also referred to as the …. “Cartesian Plane”
Us vs. It. Tanks vs. Robot ● Cooperative “Boss Fight” ● Tank players must destroy the Robot before it reaches the city limits. ● Robot is controlled by.
Conditionals Lab Dan Maselko. Overview  Gain familiarity with working with conditionals  Become familiar with using the modulus operator  Understand.
Portfolio sms-games Take a look at our innovative mobile entertainment content! Version: 14 August, 2002 portfolio SMS-games.
1 CSE1301 Computer Programming: Lecture 23 Algorithm Design (Part 1)
Copyright Notice A Homemade PowerPoint Game by Sarah Grabowski University of Georgia Let’s Play Directions Story Credits Preparation Visible Game Board.
Unit 4: Linear Relations Unit 4: Linear Relations.
Coordinates and Design.  What numbers would you write on this line?  Each space is 1 unit 0.
Strategy Games for Older Students YUMI DEADLY CENTRE School of Curriculum Enquiries: YuMi Deadly.
Us vs. It. Tanks vs. Robot ● Cooperative “Boss Fight” ● Tank players must destroy the Robot before it reaches the city limits. ● Robot is controlled by.
TGI Tic Tac Dough Game READ ME Do NOT delete or add slides in this game. Not all of the slides in this file will play during a slideshow. The first eight.
Representing a Game Board In a game, we represent the action taking place using an array – In a very simple game, we use individual variables to represent.
STRATEGO ® By Kevin Braun & Dylan Brandtner. Game Overview STRATEGO is a grid-based 10 x 10 board game featuring two opposing armies of 40 pieces. STRATEGO.
Game Gallery Project (1) Supervised By: Professor Mona Mursi 2007.
What is AI  An attempt to imitate human reactions by scripting reactions to happen when a certain cause is brought about.
Game Theory 2 Computer solutions.
Excel Battleship.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
1.6 (x, y) x y quadrants first quadrant second quadrant third quadrant fourth quadrant.
1 Copyright (C) 2008 by Dennis A. Fairclough all rights reserved.
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
Lesson 17 Getting Started with Access Essentials
Instructions for using this template. Remember this is Jeopardy, so where I have written “Answer” this is the prompt the students will see, and where.
Connect Four AI Robert Burns and Brett Crawford. Connect Four  A board with at least six rows and seven columns  Two players: one with red discs and.
SuperChair Productions proudly presents… PYGAME © 2006 SuperChair Productions. All rights reserved.
1 Planning and Laying Out Frames Sketch the frame structure on paper before writing the HTML code two rows two columns.
An atom of Chlorine that has a different number of neutrons than another atom of Chlorine is still the same element. True or False BELLWORK 11/11/14.
©2009, Tom McKendree Biplanes ©2009, Tom McKendree.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
SEA-4 Ken Kelley University of Alaska, Anchorage.
Barack Obama vs. the Martians A Lesson in Database Relationships.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
Chess By Kezia Farley.
A game based off of the esteemed classic By: Tadziu Kosiara.
Quoridor and Artificial Intelligence
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
EGR 115 Introduction to Computing for Engineers Designing The Battleship Game in MATLAB Monday 22 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Troops and Flags ITCS /10/07. Graduate Team #1 Daniel – Model (Team Leader) Jonathan –Rule Checker Priyesh – View, Sprites, Foley artist Rob –
Physics Vector Battleship Activity (Also known as the ClassCraft Activity: “Conquest of the Seven Seas”)
Model with Arrays MAFS.3.OA.1.1, MAFS.3.OA.1.3. Model with Arrays How could you model 3 x 4?
Battleship Microsoft Excel. Objective & Performance Outcome Students will follow a series of instructions presented by the teacher. You will need to take.
6.2 Classes “ A class is basically a structure with member functions as well as member data. Classes are central to the programming methodology known as.
Checkers A Matlab Project by Spenser Davison, Edward Dyakiw, Justin Pezzi, and Scott Wu.
Battleships. You need to know How to draw two 11 x 11 grids How to read off names of squares.
2-dimensional Arrays A 2-dimensional array has rows and columns It is actually an “array of arrays” A Tic-Tac-Toe board is an example of a 3 by 3 2-d array.
HTML Comprehensive Concepts and Techniques Second Edition Creating Frames on a Web Page.
Day 10- The Need for Addressing
BATTLESHIP! BATTLESHIP!
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
Lab Instructor: Salem Othman
The students learn to use game coordinates, like 3B.
Home Screen Aircraft Carrier A B C D E F G H
Lesson Plan Title: Sea Battle (Paper-pencil Game) Level: Middle
File Handling Programming Guides.
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
BATTLEBEDROOM! DORMITORIO!
Battleship
The Ultimate PowerPoint Game
When WWII Came to North Carolina
Warm-up Write the electron configuration for F, Cl, and Br
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
We are coming! Can your Star Cruisers stop us? Get ready for the
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
Write your final answers on your warm up sheet. Factor the following:
Six dominoes have been placed in this grid and there is only one way of filing the grid with more dominoes. Try it:
A Homemade PowerPoint Game by Sarah Grabowski University of Georgia
Presentation transcript:

Warship C++: An entity of Battleship Created and Presented by: Quinn Morgan and Raymond Sastraputera

Goal of Warship Warship is a game similar to battleship in which one player and one computer (simulated) compete on two square grids, one for each player. The grides are identified by rows and columns . On one grid the player arranges his own ships and records shots taken by the opponent. On the other grid the opposite way the player records his own shots taken towards his opponent. The player places the ships manually into the grid and the computer automatically assigns the ships positions. Each turn the player attempts to destroy the opponents ship by plotting their attack on the opponents grid. The first player to destroy all his opponents ships wins.

Code Technique Implemented The Warship game was set into a basic header (.h) and two source files for the class and the driver (.cpp). Instead of using an array the warship board is simply entered into columns and rows with the getblock function initializing a x and y variable. This board is finally printed out with the print grid function specified under the warship.h header file displaying the game board. There are also horizontal and vertical direction set to show the navigation of the warships. These coordianates will be manually entered by the selected player also with a flag set to remind the player if the position has been acquired already. Auto shoot and Auto ship placement commands have also been implemented within the game for the computer to predict its movements instead of an onslaught player vs. player game.

More Code techniques….. Several cases are included into the code for x and y grid ship placements and shot predictions by players and computers. These different cases allow the program to identify a direct hit with the grid placement of ships on the board. If the case is true then the program breaks off and displays (cout) a message stating that there has been a direct hit on target. The position of the ships are important to each player to avoid a direct coordinate of enemy fire. Once the game is played and either player or computer has won a message of victory is displayed using the game statues command and get ship functions. This leads to the prompting of the program to display the message of entering another game similar to: “would you like to play another game”? This prompt can either be answered with a y or n for yes or no. If yes is selected another game is prompted if no is selected the program reads this answer as play =false and exits the game.

Code Example Header: Warship\warship.cpp Driver: Warship\game.cpp Warship\warship.h Warship\warship.cpp Driver: Warship\game.cpp

Improvements??? Networking Warship Multiple players instead of computer vs. player mode 3D mode warship Implement save/load game function Add different types of vessels such as submarines, cruisers, destroyers. Add sounds to the program into the MS-Dos prompt.

QUESTIONS??