Computer Science 25: Introduction to C Programming

Similar documents
Begin this assignment by first creating a new Java Project called Assignment 5.There is only one part to this assignment.

Programming Assignment 4

CS 371M. Homework 2: Risk. All submissions should be done via git. Refer to the git setup, and submission documents for the correct procedure.

CS61B, Fall 2014 Project #2: Jumping Cubes(version 3) P. N. Hilfinger

ECE2049: Foundations of Embedded Systems Lab Exercise #1 C Term 2018 Implementing a Black Jack game

Dungeon Cards. The Catacombs by Jamie Woodhead

Battlefield Academy Template 1 Guide

CIDM 2315 Final Project: Hunt the Wumpus

CMPT 125/128 with Dr. Fraser. Assignment 3

Programming Project 2

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

[Version 2.0; 9/4/2007]

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

Alright! I can feel my limbs again! Magic star web! The Dark Wizard? Who are you again? Nice work! You ve broken the Dark Wizard s spell!

For more information on how you can download and purchase Clickteam Fusion 2.5, check out the website

..\/...\.\../... \/... \ / / C Sc 335 Fall 2010 Final Project

Defenders of the Realm: Battlefields 1. Player seating arrangement -

Beginning Game Programming, COMI 2040 Lab 6

When accessing our class network, you can get there in one of two ways. The easiest is to put this web address directly into your browser.

HERO++ DESIGN DOCUMENT. By Team CreditNoCredit VERSION 6. June 6, Del Davis Evan Harris Peter Luangrath Craig Nishina

Introduction. Contents

Welcome to Storyist. The Novel Template This template provides a starting point for a novel manuscript and includes:

Contribute to CircuitPython with Git and GitHub

KARP: Kids and Adults Role-Playing

CMSC 201 Fall 2018 Project 3 Sudoku

Preparing the Warband for Battle

How to Build a LimeSurvey: The Basics for Beginners

1 Document history Version Date Comments

Begin at the beginning," the King said, very gravely, "and go on till you come to the end

CS Project 1 Fall 2017

SEEM3460/ESTR3504 (2017) Project

ECE 532 Hspice Tutorial

Mine Seeker. Software Requirements Document CMPT 276 Assignment 3 May Team I-M-Assignment by Dr. B. Fraser, Bill Nobody, Patty Noone.

Cato s Hike Quick Start

YEDITEPE UNIVERSITY CSE331 OPERATING SYSTEMS DESIGN FALL2012 ASSIGNMENT III

CSC C85 Embedded Systems Project # 1 Robot Localization

Once this function is called, it repeatedly does several things over and over, several times per second:

ECEN 474/704 Lab 1: Introduction to Cadence & MOS Device Characterization

Unit 6.5 Text Adventures

Assignment 5 due Monday, May 7

Environmental Stochasticity: Roc Flu Macro

ANSYS v14.5. Manager Installation Guide CAE Associates

COMP 9 Lab 3: Blackjack revisited

Scratch for Beginners Workbook

The Arena v1.0 An Unofficial expansion for Talisman by Games Workshop Copyright Alchimera Games 2012

Simulations. 1 The Concept

MMORPG REVIEW! ONLINE MAGAZINE VOLUME: 1 ISSUE: 1 NOVEMBER 2005 TABLE OF CONTENTS TABLE OF CONTENTS KAL-Online First Korean 3D Fantasy...

Autodesk University Project Navigator to the Rescue in AutoCAD Architecture: Fix Standard Mismatches in a Project

HW4: The Game of Pig Due date: Thursday, Oct. 29 th at 9pm. Late turn-in deadline is Tuesday, Nov. 3 rd at 9pm.

CISC 1600 Introduction to Multi-media Computing

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

More Actions: A Galaxy of Possibilities

English as a Second Language Podcast ESL Podcast 295 Playing Video Games

Gnome Wars User Manual

(Children s e-safety advice) Keeping Yourself Safe Online

Final Project: Verify a Sudoku Solution Due Fri Apr 29 (2400 hrs)? Wed May 4 (1200 hrs)? 1

Create a Simple Game in Scratch

far- Play Developers Manual

Story Platforms. A 3d Print and play tabletop game system

TABLE OF CONTENTS. Logging into the Website Homepage and Tab Navigation Setting up Users on the Website Help and Support...

DUNGEONS & DRAGONS. As a Drupal project. Hacking and slashing our way through real-world content management problems

Creating Computer Games

Experiment 02 Interaction Objects

Type pwd on Unix did on Windows (followed by Return) at the Octave prompt to see the full path of Octave's working directory.

Problem A To and Fro (Problem appeared in the 2004/2005 Regional Competition in North America East Central.)

Roll 4d6, six times Note results on scrap paper. Drop lowest score and add up the three highest scores.

15 TUBE CLEANER: A SIMPLE SHOOTING GAME

CONTENTS. 1. Number of Players. 2. General. 3. Ending the Game. FF-TCG Comprehensive Rules ver.1.0 Last Update: 22/11/2017

Your First Game: Devilishly Easy

CISC 1600, Lab 2.2: More games in Scratch

Era of Mages User Manual

CSE 231 Spring 2013 Programming Project 03

Mmorpg unblocked free

A Few House Rules for Arkham Horror by Richard Launius

The VBA will have such a set of files available on the VBA Bridge Resource CD for some major systems. Guess where you can get a copy

Spellodrome Student Console

A digital story is a short digital video that combines your voiceover, photos, video clips, and music to tell a true story from your own life.

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py.

HW4: The Game of Pig Due date: Tuesday, Mar 15 th at 9pm. Late turn-in deadline is Thursday, Mar 17th at 9pm.

Smyth County Public Schools 2017 Computer Science Competition Coding Problems

While there are lots of different kinds of pitches, there are two that are especially useful for young designers:

Table of Contents. How does this game work? What do I need to play? What kind of character can I play? What are stats? What is proficiency?

CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class

G51PGP: Software Paradigms. Object Oriented Coursework 4

How to set up a Wordpress blog

Installation Instructions

Candidate Instructions

2D Platform. Table of Contents

Tutorial: Creating maze games

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

CS Programming Project 1

Taffy Tangle. cpsc 231 assignment #5. Due Dates

Choose one person to be the immune system (IM player). All the other players are pathogens (P players).

Steamalot: Epoch s Journey

Instructions [CT+PT Treatment]

G52CPP Lab Exercise: Hangman Requirements (v1.0)

How to import and sync your Scrivener projects from your computer via Dropbox?

CPSC 217 Assignment 3 Due Date: Friday March 30, 2018 at 11:59pm

PLASMA goes ROGUE Introduction

BIEB 143 Spring 2018 Weeks 8-10 Game Theory Lab

Transcription:

California State University, Sacramento College of Engineering and Computer Science Computer Science 25: Introduction to C Programming Fall 2018 Project Dungeon Battle Overview Time to make a game a game that will fully show of your knowledge of assembly and your immersion into nerd culture! Okay, the second part might not be true, but you are going to use your skills to make a game similar to Advanced Dungeon and Dragons. Way before World of Warcraft and other MMORPGs, players would sit around a board and play the game in person. The game itself is rather simple. Each player has a number of attributes that affect how strong, intelligent, lucky, etc they are. They game uses dice and probability to determine if something happens. Players use their knowledge and skill to increase them in their favor. Add to the mix a fantasy world, dungeons, dragons, and gnomes and you have a fun adventure! Fortunately, you don't have to implement the whole complexity of the game. You will only write a small subset of what the real game had. Gameplay The game is a "free-for-all" between different players. Each player takes turns attacking other players. The last surviving player wins! The following is the basic logic of the game: 1. Input the number of players 2. The game loops until only one player survives a. Player selects a target player b. The game rolls "dice" and deducts the points from the target's health c. Go to the next player Due Date The assignment is due in three weeks. I strongly suggest that you get to work on this assignment as early as possible. If you did well on your labs, it shouldn't take more than 2 hours.

2 Sample Output Your solution doesn't have to look exactly like this. However, this should show you the basic gameplay. For readability, the user's input is displayed in blue and the random number is displayed in red. You don't have to use color (unless you are going for extra credit). As always, please feel free to change the wording of the text. Welcome to the Wizard Battle! How many players? 3 PLAYER 0 Health: 100 Your target: 1 Spell blasts them for 13 points PLAYER 1 Health: 87 Your target: 0 Spell blasts them for 2 points PLAYER 2 Health: 100 Your target: 0 Spell blasts them for 7 points... Have Fun Use your imagination. Your game doesn't have to be Dungeons and Dragons related. You can base your game on a fun theme that you want. For example, here are some possible battle scenarios: Kittens Cartoon: Spongebob Squarepants, Rick and Morty, Archer, etc. Politics Movie: comedy, sci-fi, horror, etc A video game Television program Characters from a book etc

Requirements 3 YOU MUST DO YOUR OWN WORK. DO NOT ASK OTHER STUDENTS FOR HELP. If you ask for help, both you and the student who helped you will receive a 0. Based on the severity, I might have to go to the University. 1. Create a nice name for your game. (5 points) 2. Display your name on the screen when the program starts. You are the author - you should get credit! (5 points) 3. Ask the number of players as the game begins. (10 points) 4. Ask each player for a target. Randomly damage the target player. Display now many points they lost. The exact numbers are up to you. (30 points) 5. Cycle through the players (10 points) 6. Loop until only one player remains. (20 points) 7. Comment your code! (10 points) 8. Proper formatting: Labels are never indented. Instructions are indented. Add blank lines for readability. (10 points) Pseudocode The following is the basic logic of the game in Visual Basic-like pseudocode. Display the title of your program Input the number of players Ask how many players. Set the current player to 0 Loop while the surviving players >= 2 If the current player is alive (health[current player] >= 1) Display the player # and their health Ask them for their target Compute the points to subtract (use a random value). Display a message to the screen telling the user they hit for # points Update the target's health End If Set the current player to the next one. Make sure to go back to zero if needed. End Loop

Tips 4 1. Write you program in parts DON'T attempt to write the entire program at one time. If you do, you won't be able to debug it. Experienced programmers use incremental design. Make a basic program and, very slowly, add the features you need. For example, in this project, don t initially worry about exiting the loop (if the number of surviving players is 1). You can code this last. First, try to cycle through the players in an infinite loop. You can press Control+C to exit any UNIX program. 2. Values you need to save You need to store the following values (at a minimum) to get your project to work. You can store this information in either other registers or memory. Total number of players Array that stores the health of each player Current player Selected target Something to hold the points you randomly create for damage (for healing if you do extra credit)). Use this to display to the screen and change the health. Some integers that count the surviving characters, 3. Random Numbers The library has a built-in subroutine called "Random" that you must use to make your project work. Please read the documentation on how to use it. Cycling Players

5 Extra Credit 1. Who won? 5 points When the program is complete, display to the screen which player won the battle. 2. Color 5 points Make use of color to enhance your game. The color must be meaningful don't just set the color at the beginning of the program. 3. The attack can miss 10 points Not every attack whether it is a sword swung, a spell cast, a cat's claw, etc - will necessary hit the target. For this extra credit, make it possible that an attack will fail. This is the equivalent of rolling dice. 4. Player has multiple "spells" 10 points Create at least three spells/moves. To make the game more exciting, each player could have an assortment of spells and attacks available. Naturally, the attacks that do the most damage should be more difficult to land. Use your imagination. Have fun! Here is one possible example: PLAYER 1 Health: 88 Your target: 0 1. Cast spell 2. Swing sword 3. Sneeze Your choice: 2... 5. ASCII Art 5 points Use ASCII-art to make your program exciting. The ASCII-art must be meaningful and not something overly simple like: ==========:) It's a happy worm!

6 Submitting Your Project Run Alpine by typing the following and, then, enter your username and password. alpine To submit your lab, send the source file (not a.out or the object file) to: dcook@csus.edu How to Connect from Home Step 1 Windows The three servers that we use to do our labs cannot be accessed from off campus at least directly. To connect these computers, first connect to Athena using Putty. athena.csus.edu Step 1 Macintosh Open the Terminal program. This is the same UNIX prompt that you get when you connect to Athena. Mac-OS X is a version of UNIX. Neat! Once at the prompt, type the following where username is your ECS username. ssh username@athena.csus.edu Step 2 Secure Shell to SP1, SP2, or SP3 Once you are connected, you need to Secure Shell (SSH) to the SP computers. Basically, you will connect to Athena and it will connect you to the SP computer. Type the following at the UNIX prompt (this example uses SP2). ssh sp2 You will have to enter your password again and (maybe) have to manually type "yes".

7 UNIX Commands Editing Action Command Notes Edit File nano filename "Nano" is an easy to use text editor. E-Mail alpine "Alpine" is text-based e-mail application. You will e-mail your assignments it. Assemble File as -o objectfile asmfile Don t mix up the objectfile and asmfile fields. It will destroy your program! Link File ld -o exefile objectfiles Link and create an executable file from one (or more) object files Folder Navigation Action Command Description Change current folder cd foldername "Changes Directory" Go to parent folder cd.. Think of it as the "back button". Show current folder pwd Gives a file path List files ls Lists the files in current directory. File Organization Action Command Description Create folder mkdir foldername Folders are called directories in UNIX. Copy file cp oldfile newfile Make a copy of an existing file Move file mv filename foldername Moves a file to a destination folder Rename file mv oldname newname Note: same command as "move". Delete file rm filename Remove (delete) a file. There is no undo.