Oh found it!
printf("\n\nSnake!\n\n");
snakeBattle(bonus);
bonus=snakeBattle(bonus);
...
Type: Posts; User: edsoneicc
Oh found it!
printf("\n\nSnake!\n\n");
snakeBattle(bonus);
bonus=snakeBattle(bonus);
...
"You won/lost the battle". I want the loop to end when "You won/lost the battle" appears. That would happen if the HP<0, which is working well in my program. The problem is, after the "You won/lost...
No. It will just appear after the battle.
Yes, it's within a loop. Also, I placed getchar() to give me time before it will loop again. Here's the part of it.
if(b==6)
{
This a part of a battle simulation of my game. Why does this loop never ends? How do I fix it? I already placed a break after every return statement but it would just start over from 50 HP. Thanks...
Oh I see. Thanks. I think I should just call the function again to 'break out'.
Hi. I am getting the 'break not working in a function within a switch or loop' error under someFunction(). My code looks something like this
do
{
switch(choice)
{
case 1:...
I made a dice program using
dice=rand()%6 + 1;It gives random values from 1 to 6 but every time I run the program, it just gives me the same set of random values.I tried using ...
#include <stdio.h>
#include <string.h>
void setMap(int map[100][100], int num_row, int num_col); /*prototype*/
void printMap(int map[100][100], int num_row, int num_col);
void playGame(int...
You, sir, are a genius. Thank you. Now, I just need to do the 'move' codes. I'll give you an update later.
Thank you everyone. I did really forget how big the internet is. I realized some would not bother searching in forums as they would just start another thread. Ironically, this thread I started is an...
This code works well but I made it as a chain reaction functions by calling the next function inside the setMap function and so on(function in a function in a function--FUNCTIONCEPTION!). I want the...
I see. But this specific part is based on 3 chain-reaction functions I made, might be very difficult to explain. Thanks for that, I would really use that in the future.
Oh, I see your point there. That hit the spot. But the problem is, we could both fail if we had the same codes. It's not that I want him to fail, that's why I had the initiative to delete my codes(a...
I can't see any delete post in the thread. There's no deactivate account in settings too. It's just I'm being paranoid that someone in my class might see my codes. Thanks.
Hello, I am making a program that lets you "walk" you character by entering the coordinates. The map's border would be the number 8 and the path would be the number 0 and my character would be the...
#include<stdio.h>#include<string.h>
#define size 50
void count(char s[size]);
main(){
char str[size];
int num = 7;
Whoa! Thanks guys! It works now!
Okay so first of all I'm a beginner. This code took me like 3 days. My professor only allows me to use basic functions like if-else, loops(do-while, while and for). This code works perfectly but when...