Find Jobs
Hire Freelancers

C Programming Text Based Game Assignment

$10-30 CAD

Completed
Posted about 8 years ago

$10-30 CAD

Paid on delivery
Part 1: SPECIFICATIONS Write a program which will act as an overworld for CodeQuest! It will track the number of days remaining (before the destruction of the world) and the player's HP. This program will require the following 3 functions: void rest_at_inn(float* days_remaining, int* hp_remaining, int max): This function takes three arguments a float address (days remaining), an int address (HP remaining), and an int (max HP). This function refills the player's HP to its maximum value and decreases the number of days remaining by one. Print a message indicating what has been done (check output below). void train(float* days_remaining, int* hp_remaining, int* experience): This function takes three arguments a float address (days remaining), an int address (HP remaining), and, an int address (Player Experience). This function increases the player's experience by 10 but reduces HP by 2 and reduces the number of days remaining by 0.5. This function prints a message indicating what has been done (check output below). void battle_demon_lord(int* current_hp): This function takes one arguments an int address (current HP). This function simply outputs "He's too strong!" and sets the player’s current HP to zero. This function will be more correctly filled in later in the semester, it will act as the final battle in the game. Once the above three functions are implemented, write a program that displays the player’s stats and days remaining followed by a menu to the user and prompts them for input. This program will track the number of days remaining (float, initialize to 8), the player's current HP (int, initialize to 10), the player's maximum HP (int, initialize to 10), and the player's experience (int, initialize to 0). The menu will allow the user to select either "1 - Rest at Inn", "2 - Train", "3 -Fight the Demon Lord", "4 - Quit Game". Based on the user's input, call the associated function passing in the required arguments. This program should not exit until either 4 is selected, or if days or the user's HP is less than or equal to zero. If either are zero or below output "game over" before shutting down. The output of a typical run-through of your program should look like this (user’s input highlighted in green). This does not cover all possibilities, ensure you're program follows all paths correctly: Days remaining: 8.0 HP: 10 EXP: 0 1 - Rest at Inn 2 - Train 3 - Fight the Demon Lord 4 - Quit Game Select: 2 You did some training! Days remaining: 7.5 HP: 8 EXP: 10 1 - Rest at Inn 2 - Train 3 - Fight the Demon Lord 4 - Quit Game Select: 2 You did some training! Days remaining: 7.0 HP: 6 EXP: 20 1 - Rest at Inn 2 - Train 3 - Fight the Demon Lord 4 - Quit Game Select: 1 You rested up at the inn Days remaining: 6.0 HP: 10 EXP: 20 1 - Rest at Inn 2 - Train 3 - Fight the Demon Lord 4 - Quit Game Select: 3 He's too strong! Game Over! Be sure to test the quit condition and the day limit condition to ensure they work as well. If your program's output exactly matches the output shown above, given the provided inputs, and meets the day and quit conditions then your lab is complete and ready to be submitted (read below). More in document.
Project ID: 9736332

About the project

6 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I am a computer science student on my last university year. I have experience with C programming and have helped multiple students with assignments. I am on vacation so I can start and finish this project pretty quickly.
$23 CAD in 1 day
5.0 (2 reviews)
0.9
0.9
6 freelancers are bidding on average $23 CAD for this job
User Avatar
Hi! I would like to work on your project. I have been doing quite a lot assignments and have 100% feedback rate. So worry not about marks, i'm here to the rescue ;)
$30 CAD in 1 day
5.0 (5 reviews)
2.8
2.8
User Avatar
Hi, I am Ahsan. I am a Computer Science Student. It's my 5th semester right now. I have studied these courses including Introduction to Computer Science, Computer Programming, Data Structures, Databases I have maintained a very good grade in all above subjects. I have done different projects in c++ from the simplest "Tic Tac Toe" to the toughest "Chess". I have done many other projects including "Paint", "Scheduler" and "Inventory Management System" I have implemented many data structures in c++ including stack, queue, circular queue, singly link list. doubly link list, circular link list, Trees, min heap, max heap I find myself best for your work as I do the c++ practice on the regular basis. Regards
$30 CAD in 1 day
5.0 (6 reviews)
1.7
1.7
User Avatar
I can do it in 3 hours including the bonus part.
$15 CAD in 0 day
0.0 (0 reviews)
0.0
0.0
User Avatar
hi, my proposal is as follow.. I can do this in 3 days in C or C++ the way you think best! or if you want this before (before 3 days) you can let me know! i only have a quest, i ask for this information: Days ramaining, current hp , maximum hp and the player experience in the imput? or assume that always, to Starting Program, days remaining= 8, current hp = 10, maximum hp = 10 and the player experience = 0 I hope you consider my proposal and if you do not like something please let know me!
$25 CAD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of CANADA
Hamilton, Canada
5.0
27
Payment method verified
Member since Feb 22, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.