What a mean spirited response. The proper way to do this is (and help the person learn in the process) is to let them give a it a try, then let them post updated code, when give hints, let them try...
Type: Posts; User: LightYear
What a mean spirited response. The proper way to do this is (and help the person learn in the process) is to let them give a it a try, then let them post updated code, when give hints, let them try...
Coffee that sounds good I think I'll make some.
Working on chem right now...need a 5 minute breather.
Wont change code yet.
Thanks for the help Adak this ones been a bear, fun though so far. Programming is now starting to become interesting to me. I can begin to see applications to my own field, a little bit...
I'm having trouble with this as well, I dont get it :(
Option 1- play game
Option 2-Quit game
enter your choice: 3
enter your choice: 3
Invalid choice, enter 1 to play, 2 to quit.
enter...
with any function the type comes first. the parameter/s go inside the brackets.
void main(void)
type main(parameter)
function name= main
int main(void)
type=integer
Hi guys!
So much work this week, finals this week and next!
I had some more questions since I'm back on this again (its late, but the grade will be the grade of the project that I demo...
Ah yes! But mine had the failsafe (when that return read_hit() is written correctly and it works, at least)
the failsafe was that if the user entered data that wasn't between 1 and N then it would...
If anyone gets a chance, plz can you explain one more thing.
The problem with the read_hit() function:
Here is the version adak recommended, I know its better than mine, I just don't see how,...
Hey why don't you give it a try!
The only problem I'm having now is that, for some reason, it looks like its only displaying a 1 dimensional array somehow, which is odd.
That, and don't...
Wow something that simple, you've got the eyes of a hawk.
Well I think now would be a good time for me to check all the functions and function calls for consistency.
Update: Okay I got it...
#include <stdio.h>
#include <stdlib.h>
//#include <stdbool.h>
#define N 8
void displayBoard(char board[N][N]); //Displays the board
int readMenu(void); //Reads a 1 or a 2
int...
Yes one sec will edit this post and add code one sec
Sorry had to do chemistry and calc II homework. Okay back on now....
Claudiu: when I compiled I got the errors listed before, these ones:
Undefined first referenced
...
Yeah the read_hit() function seems like its always going to print invalid data,
because while(i) is always going to be true...
I'm definitely confused now :(
I don't usually use do loops, but...
int i= 0, temp;
do {
/* 888888888888 prompt needed here! 88888888888 */
scanf("%d", &temp);
if(i)
Thanks adak.
What do you mean by the //prompt needed here?
I'm going to try and modify this to randomize, but before I do, I was wondering what these compiler errors mean, if anyone could...
so I need to change the while loop then, because I can't make it while(0), it literally is ALWAYS going to be while(1)
could I do while(user!=2)
or would that not work since readmenu(), which...
while(0) then will be the case when return 0 occurs, as when the user enters 2?
So its going to read the whole "welcome to a battleship like...etc" after each entry of a row and column?
If...
Made a bunch of corrections, the only problem now is visualizing how to exit that while loop.
Question: when the user enters a 2, return 0 is executed, terminating the while loop right?
If...
Thanks guys will do. Have to go make dinner (my night to cook) then will be back on for as long as it takes.
Will try not to overpost also.
I know row and col are int! *hmph* jk I just missed...
sure thing one sec sorry! I was going to post it
battleshipv2.c:10: error: syntax error before numeric constant
battleshipv2.c: In function `main':
battleshipv2.c:21: error: conflicting...
I was looking at the eclipse tutorials....
is there an easy way to import the battleshipv2.c i created on SSH (I am accessing school server remotely) and I want to mount it/load it onto the...
Ok I cleaned it up, but still won't compile.
Improved I think though yea? maybe? :( I don't know, I feel good now. For like 2 weeks this project looked impossible, but at least now I understand it...
thanks claudiu, made some corrections.
If you get a chance to breeze by here again, I really appreciate your help.
New version:
compiler said error before the #define (that was first error...
Okay I think I almost have the basic program now, could someone plz look it over for me. What does this first compiler error mean?
Do I at least have the semantics right now?
...