Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

you have a spaceship to explore those planets to find habitable life. If you find a habitable planet you can choose to live there and

you have a spaceship to explore those planets to find habitable life. If you find a habitable planet you can choose to live there and let the humankind die in earth or you can return to earth if you have enough fuel. All humankinds fate is up to you, spend your resources wisely. Also calculate the passed time on earth with respect to planets time constraints.

Habitable life assignment:

At the start of the game habitable life must be assigned to random planet.

Time pass circumstances

There two type of time pass circumstances.

  1. Travelling time between planets

It depends on the distance between planets. All planets on a linear platform and they have their coordinates on this linear platform. Every light year distance between planets are counted as 1 Earth day.

Earth

Planet

1

Planet

2

Planet

3

Planet

4

Planet

5

Planet

6

Planet

7

Planet

8

1

30

210

270

72O

610

580

790

X

  1. Time spent in planets

In every planet you have a different quest. Depending on your answer time/repetition you will spend time in that planet. Generally every repetition

counted as hour on that planet (Further information is on Quest title). Also every planet has different time factor.

Planet

Time Factor (Hour Based)

Earth

1

Planet

60000

Planet 2

20000

Planet

12OOOOO

Planet z

35000

Planet

100000

Planet 6

X

Planet 7

Y

Planet 8

Z

For Example. 1 hour in XPLANET can be equal to 5 year in earth. Therefore if you spend 10 day in x planet your son will be older than your dad.

For guests:

Planet 1: Guess a number game: user selects a number between1and 10 until he find the selected number from computer at random. Also computer helps user by saying whether selected number is higher or lower. Each guess will be counted as one hour in that planet.

Planet 2: Evil Guess a number game: Like first planet user selects a number but this time, its between and zo and computer is evil. At a chance of 50 % computer helps user wrongly. For example. Selected number: 15;

User guess: 10;

Computer may say Guess lower number with a 0/oso chance.

Like first example each guess will be counted as one hour in that planet.

Planet 3: Cumulative Addition: Computer selects a number between 7 and 23at random. User will only add 2, 3 or 5 numbers to reach that num.

For example: To reach 14:

User will enter 5 5 2 2 (2 input).

Also he can entCF 2 2 2 2 2 2 2 (7 input) Or 3 3 3 3 2 (5 input)

lf use passes the selected number computer will select another number and game will continue. If user reaches the selected number, like other planets inputs will be counted as one hour in that planet.

Planet 4: Super Duper Master Dice Roll Championship: For this game, computer will challenge user with Best of 3 dice roll match. Dice has 6 face, 1 from 6 and every dice roll will be decided randomly. For each match computer and user roll the dice for 1 time and the highest value wins the game. If computer wins 2 times in best of 3 series, user lose and rematch will be made..(Draws does not count)If user wins 2 times in best of 3 series match ends. Each roll of dice will be counted as one hour in that planet. (Yes draws also counts as a hour)

For example. User rolled 2 computer rolled 1 user won first game.

User rolled 2 computer rolled 2 draw nothing happened.

User rolled 4 computer rolle d 5 computer won second game.

User rolled 3 computer rolled 2 user won third game.

User win the match total dice roll is 4.

Planet 5: Rock&Paper&Scissor (Roshambo): For this game, computer will challenge user with Best of 3 Roshambo match. There is 3 possibility for this game and Computers selections will be decided randomly. For each match computer and user select a move and the superior one wins the gam(Draws does not count paper -paper, scissor-scissor, rock rock). If computer wins 2 times in best of 3 series , user lose and rematch will be made. If user wins 2 times in best of 3 series match ends and each move of user will be counted as one hour in that planet. (Yes draws also counts)

For example: Rock: 1; Paper: 2; Scissor:3

User selected 1 computer Selected 1 Draw User selected 1 computer Selected 3 User Won

User selected 2 computer Selected 3 Computer Won

User selected 2 computer Selected 1 User Won User win the match total move is 4.

Fuel Consumption:

You will burn fuel with respect to distances between planets. You have fuel enough to go 50000 light year distance. If you are out of your fuel the game ends.

Game ending:

Game will be finished if you find a habitable planet or you are out of fuel. In both cases you have to prompt to screen how much the time passed on earth in years

#include #include

int calculateDistance(int firstPlanet, int secondPlanet) { int distance = firstPlanet - secondPlanet; if (distance < 0) { distance = -distance; } return distance; }

bool canTravel(int fuel, int distance) { return (fuel >= distance); }

int planet1() { int planetHour = 0; int number; int computerNumber = 8; do { printf("Select a number between 1-10"); scanf("%d", &number); if(computerNumber > number){ printf("Guess a higher number "); }else{ printf("Guess a lower number "); } planetHour++; } while (number != computerNumber);

//Find the equivalence of planet hour in earth hour

return planetHour; }

void main() { int distances[] = {1, 30, 210, 270, 720, 610, 580, 790}; int fuel = 50000; /* Complete main by adding other missing variables and functionalities such as assignment of life , initialization of randomness , a decision mechanism to stop the execution of program etc.*/

}

Continue other planet game write C program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Why Royalties are recognized on an accrual basis?

Answered: 1 week ago