Find Jobs
Hire Freelancers

C Programming Text Based Game Assignment

$10-30 CAD

Terminado
Publicado hace alrededor de 8 años

$10-30 CAD

Pagado a la entrega
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 del proyecto: 9736332

Información sobre el proyecto

6 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
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 en 1 día
5,0 (2 comentarios)
0,9
0,9
6 freelancers están ofertando un promedio de $23 CAD por este trabajo
Avatar del usuario
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 en 1 día
5,0 (5 comentarios)
2,8
2,8
Avatar del usuario
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 en 1 día
5,0 (6 comentarios)
1,7
1,7
Avatar del usuario
I can do it in 3 hours including the bonus part.
$15 CAD en 0 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
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 en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de CANADA
Hamilton, Canada
5,0
27
Forma de pago verificada
Miembro desde feb 22, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.