Find Jobs
Hire Freelancers

C Programming Text Based Game Assignment

$10-30 CAD

Selesai
Dibuat sekitar 8 tahun yang lalu

$10-30 CAD

Dibayar ketika dikirim
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 Proyek: 9736332

Tentang proyek

6 proposal
Proyek remot
Aktif 8 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
Diberikan kepada:
Avatar Pengguna
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 dalam 1 hari
5,0 (2 ulasan)
0,9
0,9
6 freelancer menawar dengan rata-rata $23 CAD untuk pekerjaan ini
Avatar Pengguna
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 dalam 1 hari
5,0 (5 ulasan)
2,8
2,8
Avatar Pengguna
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 dalam 1 hari
5,0 (6 ulasan)
1,7
1,7
Avatar Pengguna
I can do it in 3 hours including the bonus part.
$15 CAD dalam 0 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
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 dalam 1 hari
0,0 (0 ulasan)
0,0
0,0

Tentang klien

Bendera CANADA
Hamilton, Canada
5,0
27
Memverifikasi Metode pembayaran
Anggota sejak Feb 22, 2016

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.