Find Jobs
Hire Freelancers

C Programming Text Based Game Assignment

$10-30 CAD

已完成
已发布大约 8 年前

$10-30 CAD

货到付款
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.
项目 ID: 9736332

关于此项目

6提案
远程项目
活跃8 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
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 在1天之内
5.0 (2条评论)
0.9
0.9
6威客以平均价$23 CAD来参与此工作竞价
用户头像
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 在1天之内
5.0 (5条评论)
2.8
2.8
用户头像
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 在1天之内
5.0 (6条评论)
1.7
1.7
用户头像
I can do it in 3 hours including the bonus part.
$15 CAD 在0天之内
0.0 (0条评论)
0.0
0.0
用户头像
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 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

CANADA的国旗
Hamilton, Canada
5.0
27
付款方式已验证
会员自2月 22, 2016起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。