Share your repls and programming experiences

← Back to all posts
Snake
AlexanderTarn (231)

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!

Commentshotnewtop
2009k (11)

doesn't work on chromebook

AlexanderTarn (231)

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

V3rmillionNet (53)

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

V3rmillionNet (53)

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

CalebCarlson (33)

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

CalebCarlson (33)

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

xolyon (333)

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 (333)

This is amazing , great game

AlexanderTarn (231)

@xolyon I already put it in the comments

JamesGregory2 (1)

I mean, its is snake

slickassassin03 (84)

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

list = [0]*amount

Example:

test = [0]*10
print(test)

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
OathOfCode (23)

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 (333)

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

AlexanderTarn (231)

@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 (333)

@AlexanderTarn great but how do you change the lists?

AlexanderTarn (231)

@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 (28)

kind of slow.... but good