Tuesday, August 11, 2020

The problem with IDEs

In my last post, I said I got an IDE.  I also said I thought it would make my work easier.  This was not to be.  I have spent probably about an hour now trying to figure out how to use it.  I started out by downloading a package that should have made it so I could use Python with the IDE.  But nooooooo, I had to download about a million other packages to go along with the one I got.  Not that I could figure out how to run the code anyway.  So that is my experience with IDEs. they are hard to use.

    Also, starting with this post, I am going to give you a sample of code to try.  If you have Python already, just try it on that.  If not, you can get Python at Python.org or try it out on an online IDE.



#This game created by yahoo0406 (Cedric Rundle)

import time

import random

e = ''

while e != 'e':

    print('Welcome to Rock, paper and scissors created by yahoo0406!')

    print('In this game, you try and outguess the computer by selecting rock paper or scissors.')

    time.sleep(0.5)

    names = ['George', 'Clare', 'Daryn', 'Cedric', 'Penny', 'Ben', 'Jess', 'Jack', 'Billybob']

    print('Your opponent is', random.choice(names))

    time.sleep(0.5)

    rpsc = input('Rock, Paper or scissors?')

    print('Rock,')

    time.sleep(0.5)

    print('Paper,')

    time.sleep(0.5)

    print('Scissors,')

    time.sleep(0.5)

    print('SHOOT!')

    time.sleep(0.5)

    comchoice = random.randint(1,3)

    if comchoice == 1:

        print('Your opponent chose rock.')

        time.sleep(0.5)

        if rpsc == 'rock':

            print('It\'s a tie!')

        elif rpsc == 'paper':

            print('You win!')

        elif rpsc == 'scissors':

            print('You lose.')

        else:

            print('...')

            time.sleep(0.5)

            print('What was that for!?!')

    elif comchoice == 2:

        print('Your opponent chose paper.')

        time.sleep(0.5)

        if rpsc == 'rock':

            print('You lose.')

        elif rpsc == 'scissors':

            print('You win!')

        elif rpsc == 'paper':

            print('It\'s a tie!')

        else:

            print(';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;')

            print('YOOOOOUUUUU LLLLLLLOOOOOOSSSSSEEEEEE')

    elif comchoice == 3:

        print('Your opponent chose scissors')

        time.sleep(0.5)

        if rpsc == 'rock':

            print('You win!')

        elif rpsc == 'paper':

            print('You lose.')

        elif rpsc == 'scissors':

            print('It\'s a tie!')

        else:

            print('YOU CHEATED!')

    e = input('Press enter to play again or type e to leave.')

#VERSION 1.0



  

Note: Online IDEs are not as hard to use as IDEs that you download.

No comments:

Post a Comment

Correction

 This is just a correction saying that the link in Suggestions and ideas (not IDEs) should have been  https://www.tutorialspoint.com/codingg...