Find Jobs
Hire Freelancers

online snake game

$15-25 AUD / hour

Ditutup
Disiarkan lebih dari 1 tahun yang lalu

$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 Projek: 35904958

Tentang projek

16 cadangan
Projek jarak jauh
Aktif 1 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
16 pekerja bebas membida secara purata $23 AUD/jam untuk pekerjaan ini
Avatar Pengguna
Hello... I am interested
$20 AUD dalam 40 hari
5.0 (249 ulasan)
7.1
7.1
Avatar Pengguna
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 dalam 7 hari
4.9 (13 ulasan)
5.0
5.0
Avatar Pengguna
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 dalam 40 hari
5.0 (3 ulasan)
5.2
5.2
Avatar Pengguna
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 dalam 40 hari
5.0 (1 ulasan)
3.4
3.4
Avatar Pengguna
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 dalam 40 hari
5.0 (1 ulasan)
1.0
1.0
Avatar Pengguna
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 dalam 40 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
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 dalam 40 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
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 dalam 40 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera AUSTRALIA
Battery Hill, Australia
5.0
43
Kaedah pembayaran disahkan
Ahli sejak Mei 2, 2011

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.