Lotto Number Generator: About The Web App

Lotto Number Generator: About The Web App

I wrote a web app in 2021 called Lotto Number Generator. You can visit it here. This post explains my inspiration behind the app and what language it’s written in.

My Inspiration For Lotto Number Generator

Last year I decided to improve my programming skills by learning JavaScript again. I learned the language in 2016 when I was totally new to Web Development. Back then I didn’t really understand it because Object Orientated Programming was hard for me to grasp. After learning Python in 2018 (I think) I understood that concept better. So in 2021 during my self-employment I decided to finish a Web Development course I purchased from Udemy a long time ago but never finished. In that course was a long span of learning JavaScript.

When I learn a new language I like to make projects so I can use the concepts I learn. That was one of the major reasons I created Lotto Number Generator. The other reason is that my mom loves to play the Georgia Lottery and I wrote her a program in a long, long time ago. That program ran locally on her computer. This time I wanted to create a website she could use anywhere, including her phone.

Programming Languages Used In The Site

I used Python and Flask in the web app because I’m familiar with the code. Yes, I got this idea while taking my JavaScript section of the course but I used Python instead. You can view the code in my Github repo here. Or you can view some of the main bit of code tying everything together below:

def index():
    :return: This function loads the index.html page.
    return render_template("index.html")

@app.route("/games/cash_three.html", methods=["GET", "POST"])
def cash_three_game():
    :return: This function returns the three random numbers to be displayed on the Cash 3/Pick 3 page.
    num1, num2, num3 = cash_three()
    return render_template("/games/cash_three.html", num1=num1, num2=num2, num3=num3)

@app.route("/games/cash_four.html", methods=["GET", "POST"])
def cash_four_game():
    :return: This function returns the four random numbers to be displayed on the Cash 4/Pick 4 page.
    num1, num2, num3, num4 = cash_four()
    return render_template("/games/cash_four.html", num1=num1, num2=num2, num3=num3, num4=num4)

@app.route("/games/fantasy_five.html", methods=["GET", "POST"])
def fantasy_five_game():
    :return: This function returns the five random numbers to be displayed on the Fantasy 5 page.
    num1, num2, num3, num4, num5 = fantasy_five()
    return render_template("/games/fantasy_five.html", num1=num1, num2=num2, num3=num3, num4=num4, num5=num5)

Can I make a JavaScript and Node/Express/EJS version of the app? Yes I can! However, I haven’t done it and maybe I would translate my code one day. As of now, I rather not.

Finally, I use Heroku to deploy my web apps now after using PythonAnywhere for years. I recommend both for anyone wanting to deploy their web apps.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x