Hungry Snake

āĻ¸ā§āĻĒāĻžāĻ°āĻŋāĻļāĻ•ā§ƒāĻ¤ āĻ˛ā§‡āĻ­ā§‡āĻ˛āĻ˛ā§‡āĻ­ā§‡āĻ˛
5+
A long serpentine creature slithers across a limited field, obeying the player's orders (moving right, left, down, and up). And there's no way to stop it from moving. Just don't touch the boundaries or you'll die! And don't bite yourself or... well, you get the idea. Along the way, the creature encounters food that makes it even longer. As it grows, it gets more and more cramped... Stop the madness! You probably recognize this comedic storyline from the famous game "Snake". This game originated in the 1970s. That's when it first appeared on arcade machines. In the 21st century, it was popularized by Nokia, which pre-installed Snake on almost all their mobile phones. Between these two milestones, there were versions for the Commodore VIC-20, MS-DOS, ZX Spectrum, Windows, Mac OS? If you go to Google Play or the App Store, you'll probably find a couple dozen different versions of Snake. It's hard to imagine a platform that doesn't have its own version of Snake. Why? On the one hand, it's an interesting game that is perfect for passing the time. On the other hand, Snake is simple enough to create on your own. See for yourself! Use Java to write your own version of this game about the adventures of a growing reptile. On CodeGym, we've already described every step, which will help a novice player handle this task without problems. Carry on!
āĻŽāĻ¨ā§āĻ¤āĻŦā§āĻ¯ (112)
  • āĻœāĻ¨āĻĒā§āĻ°āĻŋā§Ÿ
  • āĻ¨āĻ¤ā§āĻ¨
  • āĻĒā§āĻ°āĻžāĻ¨ā§‹
āĻŽāĻ¨ā§āĻ¤āĻŦā§āĻ¯ āĻ˛ā§‡āĻ–āĻžāĻ° āĻœāĻ¨ā§āĻ¯ āĻ¤ā§‹āĻŽāĻžāĻ•ā§‡ āĻ…āĻŦāĻļā§āĻ¯āĻ‡ āĻ¸āĻžāĻ‡āĻ¨ āĻ‡āĻ¨ āĻ•āĻ°āĻ¤ā§‡ āĻšāĻŦā§‡
Anonymous #11623460
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 0 , Friedrichshafen, Germany
12 āĻĢā§‡āĻŦā§āĻ°ā§ā§ŸāĻžāĻ°āĻŋ, 08:55
😮
Anonymous #11623460
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 0 , Friedrichshafen, Germany
12 āĻĢā§‡āĻŦā§āĻ°ā§ā§ŸāĻžāĻ°āĻŋ, 08:54
😎
Anonymous #11606130
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 0 , Heidelberg, Germany
20 āĻĄāĻŋāĻ¸ā§‡āĻŽā§āĻŦāĻ° 2024, 08:48
O, du FrÃļhliche!
Anonymous #11606130
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 0 , Heidelberg, Germany
20 āĻĄāĻŋāĻ¸ā§‡āĻŽā§āĻŦāĻ° 2024, 08:49
bester mann
Morel
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 0 , France
13 āĻœā§āĻ˛āĻžāĻ‡ 2024, 16:44
tete de neuille frrrrrrrrr
Anonymous #11516985
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 2 , -, France
16 āĻŽā§‡ 2024, 09:28
thanks
Anonymous #11502613
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 1 , Spain
14 āĻāĻĒā§āĻ°āĻŋāĻ˛ 2024, 09:14
🖕
Anonymous #11502613
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 1 , Spain
14 āĻāĻĒā§āĻ°āĻŋāĻ˛ 2024, 09:06
Fuck you
Anonymous #11594043
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 1 , San Antonio, United States
15 āĻ¨āĻ­ā§‡āĻŽā§āĻŦāĻ° 2024, 16:12
you tell em
Fohli
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 2 , Germany, Germany
6 āĻŽāĻžāĻ°ā§āĻš 2024, 10:11
Dauernd 'falsch' weil Rechtschreibung verkehrt xD Und ich noch was aber die Methode hab ich doch đŸ¤Ŗ
Anonymous #11399852
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 0 , Viet Nam
22 āĻ¸ā§‡āĻĒā§āĻŸā§‡āĻŽā§āĻŦāĻ° 2023, 14:54
print("Willkommen zum Elch-Spiel!") print("Dein Ziel ist es, einen Elch in freier Wildbahn zu finden.") print("Du befindest dich auf einem Pfad im Wald.") # Schleife fÃŧr das Spiel while True: # Eingabeaufforderung action = input("Was mÃļchtest du tun? (suchen/nach Norden gehen/nach Osten gehen/nach SÃŧden gehen/nach Westen gehen/beenden)") # Wenn der Spieler den Befehl "suchen" gibt if action == "suchen": print("Du schaust dich um, aber es ist kein Elch in Sicht.") # Wenn der Spieler den Befehl "nach Norden gehen" gibt elif action == "nach Norden gehen": print("Du gehst nach Norden und kommst an einem Fluss vorbei.") # Wenn der Spieler den Befehl "nach Osten gehen" gibt elif action == "nach Osten gehen": print("Du gehst nach Osten und siehst Spuren eines Elchs.") # Wenn der Spieler den Befehl "nach SÃŧden gehen" gibt elif action == "nach SÃŧden gehen": print("Du gehst nach SÃŧden und siehst eine Gruppe von VÃļgeln im Baum.") # Wenn der Spieler den Befehl "nach Westen gehen" gibt elif action == "nach Westen gehen": print("Du gehst nach Westen und kommst an einem Feld vorbei.") # Wenn der Spieler den Befehl "beenden" gibt elif action == "beenden": print("Vielen Dank fÃŧr das Spielen!") break # Wenn der Spieler einen ungÃŧltigen Befehl gibt else: print("Das ist kein gÃŧltiger Befehl. Bitte versuche es erneut.")
Anthony Javier
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 3 , San Salvador, El Salvador
23 āĻĄāĻŋāĻ¸ā§‡āĻŽā§āĻŦāĻ° 2024, 00:56
; ?
æˇ˜æ°”
āĻ˛ā§‡āĻ­ā§‡āĻ˛ 22 , Ottawa, 中å›Ŋ
30 āĻŽā§‡ 2023, 05:52
May I ask Snake (Part 18/20), why do you need to check the coordinates of index 0 and 1, what will happen if there is no such condition