SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 5 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 08 Nov 2017 My Price 10.00

I need some help modifying my existing code in main with functions.

Main.cpp// GSP115_Course_Project.cpp : Defnes the entry point For the console application.////// GSP115 TREASURE CAVE// Week 5#pragmaonce#include"GSP115_Course_Project.h"#include"stdaFx.h"#include"String.h"#include<iostream>#include<array>#include<string>#include<time.h>// Global ConstantsconstintMAX_ROWS = 7;constintMIN_ROWS = 0;constintMAX_COLS = 7;constintMIN_COLS = 0;constintTOTAL_ROWS = MAX_ROWS + 1;constintTOTAL_COLS = MAX_COLS + 1;//Display ConstantsconstcharULC = 201;//Upper leFt cornerconstcharHB = 205;//Horizontal borderconstcharURC = 187;//Upper right cornerconstcharVB = 186;//Vertical borderconstcharLRC = 188;//Lower right cornerconstcharLLC = 200;//Lower leFt cornerconstcharMT =' ';//Empty locationconstcharPSymbol ='P';//Player symbolconstcharTOSymbol ='T';//Torch symbolconstcharWSymbol ='W';//Weapon symbolconstcharTRSymbol ='$';//Treasure symbolconstcharMSymbol ='M';//Monster symbolconstcharNSymbol ='N';//Noisemaker symbolconstcharXSymbol ='X';//Cave exit symbolusingnamespacestd;#include"GSP115_Course_Project.h"#include<string.h>// Function prototypesgameObjectplaceInCave(gameObjectTypearray[TOTAL_ROWS][TOTAL_COLS]);//void playercommand(&row, &col);//CAN THIS BE EXLPAINED?voidsetPosition(gameObject&object,intrangeX,intrangeY,into±setX,into±setY,gameObjectTypetype,gameObjectTypecave[][TOTAL_COLS]);chargetUserCommand(string&msg);voidmovePlayerLeFt(int&column,gameObjectobject,string&msg);voidmovePlayerRight(int&column,gameObjectobject,string&msg);voidmovePlayerUp(int&row,gameObjectobject,string&msg);voidmovePlayerDown(int&row,gameObjectobject,string&msg);voidplayerNoise(string&msg,playerObjectplayer,bool&monsterPause);voidsaveMovement(introw,intcol,playerObject&player);
Background image of page 01
// <WK4 status=permanent>boolcheckVisible(gameObjectx,gameObjecty,intdist );// </WK4>boolshowOnBoard(gameObjectx);intmain(){//**Initialize Variables**srand(int(time(NULL)));// Seed the random number functiongameObjectTypecave[TOTAL_ROWS][TOTAL_COLS];// the cave--a two dimensional arraycharboard[TOTAL_ROWS+3][TOTAL_COLS+3]=// the game board--a two dimensional array{{MT,MT,'0','1','2','3','4','5','6','7',MT},{MT,ULC,HB,HB,HB,HB,HB,HB,HB,HB,URC},{'A',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'B',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'C',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'D',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'E',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'F',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'G',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{'H',VB,MT,MT,MT,MT,MT,MT,MT,MT,VB},{MT,LLC,HB,HB,HB,HB,HB,HB,HB,HB,LRC}};playerObjectplayer ={true,false,false,false,false,{-1, -1,false,true}};// playergameObjecttreasure = {-1, -1,false,true};// the treasuregameObjectmonster = {-1, -1,false,true};// the monstergameObjectweapon = {-1, -1,false,true};// the weapon// <WK4 status=permanent>gameObjecttorch = {-1, -1,false,true};// the torchgameObjectnoisemaker = {-1, -1,false,true};// the noisemaker// </WK4>introw, column;// temporarily hold the new player positionintMonsterMoveCounter = 6;// track and control monster movement around treasurestringmsg;// status message variablecharcommand;// player input// <WK4 status=permanent>boolmonsterPause =false;// ±ag to indicate the monster has stopped moving// </WK4>boolmovePlayer =true;// ±ag to indicate the player position can be updatedboolgameOver =false;// status ±ag//**Prepare Cave***********//...Initialize an empty cavefor(gameObjectType(&R)[TOTAL_COLS] : cave){for(auto&C : R) C =EMPTY;}//...Add player in rows 0-2, columns 0-2//…IS THERE ANOTHER WAY TO WRITE THIS? for instance, instead of3,3,0,0,PLAYER,cavesetPosition(player.position,3,3,0,0,PLAYER,cave);setPosition(player.oneBackPosition,3,3,0,0,PLAYER,cave);setPosition(player.twoBackPosition,3,3,0,0,PLAYER,cave);
Background image of page 02

Attachments:

Answers

(5)
Status NEW Posted 08 Nov 2017 08:11 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)