Jump to content

[Logic needed]Snake Game in C


Recommended Posts

Guys i'm trying to make a Snake game in C first when i thought to make it.i thought it would be easy but soon i realised it will be damm dificult programing. I have no idea(very less)how to make it. -firstly we need some(exactly i don't know) variables. -Our snake will be made with ASCII value -Size of the snake will increase automatically after 20 seconds -Snake will automatically move 1 step ahead after 20 sec in its current direction -Full border would be there. -Snake will eat random no.s     Means a full snake game in C                   possible doubts till now How to orientate snake positions? How snake will move by keys?(maybe ASCII value?) How it will end game once it touches itself? And more doubts actual doubts will come when i star actually programming but first i'm not geting the logic to make it possible.If i don't know logic i can't even made it possible.! Please give me logic not the code.

Link to comment
Share on other sites

use delay(20000) to give 20 sec delay.

1 step can also be added in the same delay.

Dude this i knw but major problem is user will define where to move and it will move that way i have 2 ideas for it make it work

# 1 idea--Make each point on the area a variable means i'll store each point data in a array..! and user will make than furthur i'll make if i made like this than program would be like hell never ending coding..

#2 idea make to points @ corner variable 1 st and 2nd using the square area formula make it a whole area and each ponit automatically stored in array

Still i beleive both ideas are fail..! i need some tym to devote it..!

Link to comment
Share on other sites

Dude this i knw but major problem is user will define where to move and it will move that way i have 2 ideas for it make it work

# 1 idea--Make each point on the area a variable means i'll store each point data in a array..! and user will make than furthur i'll make if i made like this than program would be like hell never ending coding..

#2 idea make to points @ corner variable 1 st and 2nd using the square area formula make it a whole area and each ponit automatically stored in array

Still i beleive both ideas are fail..! i need some tym to devote it..!

you will have to run multiple for loops combined with clrscr() to make the snake move.

the code is very complicated. give some days

Link to comment
Share on other sites

you will have to run multiple for loops combined with clrscr() to make the snake move.

the code is very complicated. give some days

hmm that is very imp dude ..! And yeah i thought it would be easy but its indeed very very very complicated program..! but it would be fun doing it.!
Link to comment
Share on other sites

u r saying no? or saying sorry for being impolite?

Check this site out. May help you. {It DOES NOT contain the whole code.}

hmm i saying sorry for impolite..! And that site contains whole code too I'll refer that when i would not be able to make it myself as its really damm complicated..! i have no hurry i have whole summer vacations with me ..! soon for it.! still thanks for site.!
Link to comment
Share on other sites

hmm i saying sorry for impolite..! And that site contains whole code too I'll refer that when i would not be able to make it myself as its really damm complicated..! i have no hurry i have whole summer vacations with me ..! soon for it.! still thanks for site.!

In which standard you are?
Link to comment
Share on other sites

In which standard you are?

doesn it matter here?If i say some small u'll say its expected if i say big u'll say u still kid so it doesn't mater in which standart i am everyone makes mistake.!

And though that site contains a code, Its a step by step tutorial which explains logic too.

yeah dude that why i'll refer that site when i isn't able to create the program.!
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...