Ask coding questions

← Back to all posts
Code
JoshuaWilmsen (3)

Each time I run my snake game. it just keeps on saying update your pip installer.... what do the mean by that?

Commentshotnewtop
bion0 (3)

Hi all. am new in coding and just learning to code. can someone please help me with adding adding images in a code please.

Pizzadrengen (0)

@bion0 In HTML ?

Just reply to me if you need help for adding images in HTML ;_)

Mosrod (262)

What language do you want to do this in?

ash15khng (234)

@bion0 Hello, if you want to ask a separate question I suggest you make a new question instead of asking it in the comment section of another question as this may clutter up this question with irrelevant answers.
Also, if you want to do it in HTML, use the <img> tag. To add the source of the image use the attribute 'src="link"'. For example <img src="https://cdn.freebiesupply.com/logos/large/2x/replit-logo-png-transparent.png"/> will display an image of the [repl.it] logo. The reason why there is a / at the end of the tag is because the img tag has nothing within it, so you just close it with that.

Neil_Chaudhury (9)

Ok, so at the moment, pygame is not supported on repl.it. To run your script you will have to use an ide on your computer. I suggest sublime text. Hope this helped.

Neil_Chaudhury (9)

It just says to update pip to 18.0 or something most likely, so you don't have to worry about that.

PYer (2049)

Can i see the repl?

PYer (2049)

@JoshuaWilmsen just comment the link please

PYer (2049)

@JoshuaWilmsen You can't make a new window using pygame. Stuff like that doesn't work. So, you will not be able to run

s = pygame.display.set_mode((ARRAY_SIZE * 10, ARRAY_SIZE * 10))
JoshuaWilmsen (3)

can you help me with coding please. I kinda suck and get made fun of because I like to code
@fullern000

PYer (2049)

@JoshuaWilmsen Just ask me what you need help with

PYer (2049)

I need to leave though

PYer (2049)

@JoshuaWilmsen The game is great already though. I just made some minor changes.

ChristianThone (34)

@JoshuaWilmsen
I changed a few things. First, I changed it so that you can actually end the game if you go through the door with the ghost, before your code looked like this at the beginning.

while feeling_Brave:

I changed this to:

while feeling_Brave == True:

also your variable with feeling_Brave was written wrong as feeling_brave that wouldn't allow the correct boolean to change. I also added it so then you can't choose a Number higher than 3. Last but not least I converted the score in the Game Over Message to a string so you can properly print it.

Here is the source_code for the new project:

from random import randint
print("""
============================================================================================================================================
==      ===  ===============================      ==========================================  ====  =====   ==========      ========      ==
=   ==   ==  ==============================   ==   =========================================  ====  ===   =   =======   ==   ======   ==   =
=  ====  ==  ====================  ========  ====  =========================================  ====  ==   ===   ======  ====  ======  ====  =
=  ========  ======   ====   ===    =======  =========   ===  =  = ====   ==================  ====  =======   =======  ====  ======  ====  =
=  ========    ===     ==  =  ===  ========  ========  =  ==        ==  =  =================   ==   ======   ========  ====  ======  ====  =
=  ===   ==  =  ==  =  ===  =====  ========  ===   =====  ==  =  =  ==     ==================  ==  ======   =========  ====  ======  ====  =
=  ====  ==  =  ==  =  ====  ====  ========  ====  ===    ==  =  =  ==  =====================  ==  =====   ==========  ====  ======  ====  =
=   ==   ==  =  ==  =  ==  =  ===  ========   ==   ==  =  ==  =  =  ==  =  ===================    =====   =======  ==   ==   ==  ==   ==   =
==      ===  =  ===   ====   ====   ========      ====    ==  =  =  ===   =====================  =====        ===  ===      ===  ===      ==
============================================================================================================================================

""")
feeling_Brave = True
score = 0

while feeling_Brave == True:
  ghost_door = randint (1, 3)
  print("")
  print('Three doors ahead...')
  print('A ghost behind one. ')
  print('Which door do you open?')
  door = input('1, 2, 3: ')
  door_num = int(door)
  if door_num > 3:
   print("That number is too high!")
   print("Try Again!")
   print("")
   ghost_door = randint (1, 3)
   print('Three doors ahead...')
   print('A ghost behind one. ')
   print('Which door do you open?')
   door = input('1, 2, 3: ')
   door_num = int(door)
  if door_num == ghost_door:
    print("")
    print ('Ghost!')
    feeling_Brave = False
  else:
    print("")
    print('No ghost!')
    print('You enter the next room.')
    score = score + 1
print("")
print('You Ran Away')
print('Game over! You scored ' + str(score) + ' points.')