Find Jobs
Hire Freelancers

online snake game

$15-25 AUD / hour

Cerrado
Publicado hace alrededor de 1 año

$15-25 AUD / hour

ok so I am learning to code some old school C code to make a game that is cross platform and can be played over the network I am trying to split the game up into header files and functions and definitions into other c files snake.c game.c game.h I have come across these errors and it will not compile but the issue here is the issues are not correct. snake.c:16:1: warning: '/*' within block comment [-Wcomment] /* ^ snake.c:100:61: error: use of undeclared identifier 'ROWS'; did you mean 'COLS'? if (next.x < 0 || next.x >= COLS || next.y < 0 || next.y >= ROWS) { ^~~~ COLS /Library/Developer/CommandLineTools/SDKs/[login to view URL]:1208:32: note: 'COLS' declared here extern NCURSES_EXPORT_VAR(int) COLS; ^ snake.c:105:21: warning: ordered comparison between pointer and integer ('int' and 'int *') for (int i = 1; i < length; i++) { ~ ^ ~~~~~~ snake.c:155:1: error: unterminated function-like macro invocation getmaxyx(stdscr, ^ /Library/Developer/CommandLineTools/SDKs/[login to view URL]:913:9: note: macro 'getmaxyx' defined here #define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win)) ^ snake.c:215:1: error: expected '}' ^ snake.c:153:12: note: to match this '{' int main() { ^ 2 warnings and 3 errors generated. game.c:15:1: warning: '/*' within block comment [-Wcomment] /* ^ game.c:51:18: error: implicit declaration of function 'getNextPosition' is invalid in C99 [-Werror,-Wimplicit-function-declaration] Point next = getNextPosition(snake[0], direction); ^ game.c:51:11: error: initializing 'Point' with an expression of incompatible type 'int' Point next = getNextPosition(snake[0], direction); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ game.c:52:9: error: implicit declaration of function 'checkCollision' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (checkCollision(next, rows, cols)) { ^ game.c:52:9: note: did you mean 'check_collision'? ./game.h:19:5: note: 'check_collision' declared here int check_collision(Point next, Point *snake, int length, int rows, int cols); ^ game.c:57:11: error: implicit declaration of function 'checkCollisionWithSnake' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (checkCollisionWithSnake(next, snake[i])) { ^ game.c:63:9: error: implicit declaration of function 'checkFoodCollision' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (checkFoodCollision(next, food)) { ^ game.c:63:9: note: did you mean 'checkCollision'? game.c:52:9: note: 'checkCollision' declared here if (checkCollision(next, rows, cols)) { ^ game.c:65:14: error: implicit declaration of function 'generateFood' is invalid in C99 [-Werror,-Wimplicit-function-declaration] food = generateFood(rows, cols); ^ game.c:65:12: error: assigning to 'Point' from incompatible type 'int' food = generateFood(rows, cols); ^ ~~~~~~~~~~~~~~~~~~~~~~~~ game.c:71:5: error: implicit declaration of function 'updateSnake' is invalid in C99 [-Werror,-Wimplicit-function-declaration] updateSnake(snake, next, length); ^ 1 warning and 8 errors generated. for example chatGPT reveals this issue: It seems that you have used the incorrect name for the number of columns in the terminal window. The correct name is COLS instead of ROWS. You can resolve the error by changing the following line: Copy code if (next.x < 0 || next.x >= COLS || next.y < 0 || next.y >= ROWS) { to Copy code if (next.x < 0 || next.x >= COLS || next.y < 0 || next.y >= ROWS) {
ID del proyecto: 35904958

Información sobre el proyecto

16 propuestas
Proyecto remoto
Activo hace 1 año

¿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
16 freelancers están ofertando un promedio de $23 AUD /hora por este trabajo
Avatar del usuario
Hello... I am interested
$20 AUD en 40 días
5,0 (249 comentarios)
7,1
7,1
Avatar del usuario
Hello Chelson A., We would like to grab this opportunity and will work till you get 100% satisfied with our work. We are an expert team which have many years of experience on C Programming, C# Programming, Software Architecture, Objective C, C++ Programming Lets connect in chat so that We discuss further. Thank You
$20 AUD en 7 días
4,9 (13 comentarios)
5,0
5,0
Avatar del usuario
Hello sir I have done lot of games in unity game engine and I have more then 7 years experience in unity game engine and I can do any type of games so please send me more details about your game project and I will give you daily updates well but I need daily communication if possible so I can do fast and good as you require.
$20 AUD en 40 días
5,0 (3 comentarios)
5,2
5,2
Avatar del usuario
Hi! How are you? My main skill is the powerful reversing & the powerful debugging & Customizing opensource & the optimized System Design & the code based optimization . Skill Set: • C/C++/Delphi/C#/Qt/Golang: for 12+ years • Python/PyQt/PyTorch/appium/web scrapping for 6+ years • OpenGL/OpenCL/Cuda/Cmake for(6+ years) • well versed with RDP/RTSP/RTP for(6+ years) • typescript/webwasm/ffmpeg/webcodec: for 4+ years • the powerful 3D rendering based opengl/gles/webgl Recently, I have developed the 3D Medical Viewer like Syngo, Philise Viewer & deployed in hospitals using C++/Qt/OpenCL/Cmake/VTK/ITK Please contact me
$25 AUD en 40 días
5,0 (1 comentario)
3,4
3,4
Avatar del usuario
Hello, How are you ? I have rich experience while I had worked as C developer. To discuss about this task, please contact me.
$20 AUD en 40 días
5,0 (1 comentario)
1,0
1,0
Avatar del usuario
Hello sir I am a Senior Developer specialized in desktop application development having an experience of more than 8+ years. I am very excited to see your job posting as I am confident that I am a perfect fit for what you are looking for, as I have worked on many similar projects. I can build your project by using C/C++, C#/.NET(Winform, WPF, DevExpress), VB.NET Python We can discuss your project via chatting in detail thanks
$20 AUD en 40 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Hi, we have experienced team for game applications like your requirement and we are expert in the same field. We also have ready games available for your satisfaction. Let's have a quick chat to discuss and process further.
$20 AUD en 40 días
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
Your code is a mess, you put two main() in snake.c and another one in game.c, for instance. Also, be careful about cols and COLS, they're different variables (or constants) so be careful! That said, if you want i can rule out some of the worst errors, explaining where and why.
$15 AUD en 40 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de AUSTRALIA
Battery Hill, Australia
5,0
43
Forma de pago verificada
Miembro desde may 2, 2011

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.