Share your repls and programming experiences

← Back to all posts
Snake
AlexanderTarn

Spoiler Alert: terrible graphics
I made a snake game in the terminal, it's not very good because it's laggy, but I think this is one of the most hardest programs I made, mainly because I had to ask for help a lot. Hope you enjoy!

Voters
omkarbhalsing
DeanSmith1
DanielSchwab
donkey2
CodeSalvageON
MilesMiller
19awassan
Deacon_Cronin
Kai_Justice
xolyon
Comments
hotnewtop
2009k

doesn't work on chromebook

AlexanderTarn

@2009k why not? What errors are you getting?

V3rmillionNet

@AlexanderTarn It does, i am testing right now, but after 1 movement the game completely stops working. Not output errors. just that.

V3rmillionNet

@AlexanderTarn It works on embed terminal the best, not on full terminal

bramley

@2009k same issue here

CalebCarlson

@2009k It does, Its just super slow, you press a button and it just sits there for 5 minuets and then goes

CalebCarlson

@V3rmillionNet it doesn't stop working, if you wait a while it goes

V3rmillionNet

Well nice game then! @CalebCarlson

xolyon

Can you tell me how you made your mapping/printing/moving system as I have been struggling for ages to make such a system

xolyon

This is amazing , great game

AlexanderTarn

@xolyon I already put it in the comments

JamesGregory2

I mean, its is snake

LittleNomster

works fine then freezes when i hit an arrow key

AlexanderTarn

@LittleNomster It uses wasd

LittleNomster
LittleNomster

thats so coool

slickassassin03

Quick little tip, when adding long lists with the same value, use a multiplier:

Example:

AlexanderTarn
OathOfCode

This is one of the better versions of snake I've seen without using Python Turtle or Pygame! Also, to reduce some of the lag when you clear the screen, import replit and use replit.clear(). It clears the screen much faster with much less lag!

Hope To see more of your projects soon!

  • Sincerely OathofCode
xolyon

Great , I always wondered how you make GUI in text based console (please explain I always wanted to know)

AlexanderTarn

@xolyon you first create a map with lists, then create another list that has all the lists, after that you print it (I used a range loop to create a string and print it). Then you do whatever and based on the outcome of whatever you change the lists. clear the terminal and repeat.

xolyon

@AlexanderTarn great but how do you change the lists?

AlexanderTarn

@xolyon you get the spot you want to change and make it equal to something else
((List with all lists)[index for y])[index for x]

xie21

kind of slow.... but good