ready to make my own website

I tried to post some code in here from an app and game I made from a class exercise, but it seems blogger does not have a layout set up for the amount of text space required to place the full code in one post...

I really need to get my own web page set up.  I have the domain name paid for, I just have to allocate the time to set it all up.

I'm going to put a piece up in this post of the app.py & planisphere2.py and links to the full code.

Hopefully soon I can get the ball rolling on my website, and start building.

### app.py ###
https://drive.google.com/open?id=1z-4Zdotc_f_gAGlK3d62m4Gf8IwrJgG2

@app.route("/mygame", methods=['GET', 'POST'])
def mygame():
         # this runs the game
    room_name = session.get('rooms')
  
    phrase = "I was not prepared for that answer."
   
       
    if request.method == "GET":
        session['score'] +=1
        divert = ['past_A', 'future_B', 'present_A', 'dead', 'romulans', 'vulcans', 'klingons', 'future_battle',
       'toga_party', 'venetians', 'brian_intro', 'cottage', 'shrubbery', 'coconut', 'venetians2', 'zombieland']
        print(" 1  if exec. ")
        if room_name not in divert:
            session['score'] += 2
            print(" 2  if exec. ")
            room = planisphere2.load_room(room_name)
            return render_template("show_fan.html", room=room)
        elif room_name in ['past_A', 'future_B', 'present_A', 'zombieland']:
            print(" 2 b if exec")
            session['score'] += 5
            travel = 'carrots'
            room = planisphere2.load_room(room_name)
            return render_template("show_fan.html", room=room, travel=travel)
        elif room_name in ['romulans', 'future_battle', 'cottage', 'double_tap']:
            print(" 3 b if exec")
            session['score'] += 10
            score = session['score']
            room = planisphere2.load_room(room_name)
            return render_template("show_fan.html", room=room, score=score)
        elif room_name in ['vulcans', 'klingons', 'toga_party', 'venetians', 'brian_intro', 'coconut', 'venetians2']:
            session['score'] += 5
            room = planisphere2.load_room(room_name)
            return render_template("continue.html", room=room)

        else:
            return render_template("errorMessage.html")


#####  my game ####
https://drive.google.com/open?id=1Fz01O-Zo7zeCbp-2EQ4W1KuSOaASoDo8


def scifan_else(action):
    action = action.lower()
    some_list = action.split()
    phrase = " I was not prepared for that. Try again."

    nothing = ['stay', 'sleep', 'none', 'nothing', 'sit',

'nap', 'lazy', 'backwards', 'behind']
    nothing_phrase = "If you stay here and don't go forward, what's the point?

Forward is forward."

    doc_who = ['tardis', 'dalek', 'jelly', 'belly', 'sonic', 'screwdriver',
          'river', 'weeping', 'angel']
    doc_who_phrase = """The Dalek's aren't here, and the Tardis is on invisibility mode.
                        The doctor doesn't share his screwdriver,  Maybe River will
                        come along and offer some Jelly Bellies, But I think she's off
                        dealing with the weeping angels at the moment."""

    treky = ['riker', 'phaser', 'spock', 'enterprise', 'khan', 'warf', 'data',
        'captain', 'kirk', 'sulu', 'janeway', 'odo', ]
    treky_phrase = """I don't see Starfleet among this crowd, but it is a rather large assembly,
                      maybe you should check it out? """

    montyish = ['flying', 'circus', 'sperm', 'sacred', 'ni', 'brian', 'nose',
               'rabbit', 'spam', 'eggs', 'python']
    monty_phrase = """Not everything is sacred. But maybe you'll find a cute fluffy
                      rabbit with that crowd.Or a plague, Or a big nose, or a flying circus.
                      Never know with these guys. A large cardboard hand decends from the
                      heavens, artfully decorated and points at the group of motley characters."""

    for words in some_list:
       
        if words in doc_who:
            phrase = doc_who_phrase
           
        elif words in treky:
            phrase = treky_phrase
           
        elif words in montyish:
            phrase = monty_phrase

        elif words in nothing:
            phrase = nothing_phrase
        else:
            phrase = phrase + " (...computing...) "
      
      
    return phrase

Comments

Popular posts from this blog

Statistics, Python, Making a Stem Plot

Pandas Python and a little probability

JavaScript Ascii animation with while loops and console.log