Macdara’s Typing Simulator

For my first Fusion project of the 25/26 school year, I attempted to create a typing simulator that tracks your wpm (words per minute) and typing accuracy. In this blog post, I will review the process behind this project, provide a flow chart, and how I, as a beginner coder, was able to use online resources to my advantage.

Before joining Fusion, I had very little coding experience, which was obviously a worry when this project was announced. After brainstorming multiple ideas for things I could create, I decided to attempt making a Typing Simulator. As a child, I was fond of these simulators, merely due to the thought of becoming a faster typer. However, based on my past experiences, the simulator would never provide any analysis of my typing capabilities (wpm, accuracy), which led to no typing improvement whatsoever. My goal for this project was to create a typing simulator that would track your wpm and accuracy while simultaneously providing advice on how to improve.

Here is a flowchart I used throughout my project (steps, what to do when encountering roadblocks, etc).

Below this text is the code I created for my game. Feel free to try it out (copy and paste) using Python, Google Colab, or any other coding website that uses Python. Note – This doesn’t work on Java.

If you’re too lazy to copy and paste, here is the link: https://colab.research.google.com/drive/1LJ7V-yN-vXBBUnIRGA4r9W4vkBlIINKm

—- —- —- —- —- —- —- —- —- —- —- —- —- —- —- —

import random
import time

sentences = [
“Beethoven, Bach, Haydn, Mozart, Tchaikovsky, and Schubert were all classical composers.”,
“The Flappy Fellow From Fusion Flies Free Forever Flourishing.”,
“Open The Doors, close the doors, OPEN the DOORS, close THE doors.”,
“Real Madrid is a Spanish professional football club based in Madrid.”,
“Chemistry, Biology, Earth Science, and Physics are all topics covered in science.”,
“The Canucks will win the 2026 Stanley Cup.”,
“The Fish and Chips in Ireland sure are the best.”,
“Abra-Cadabra Alakazam, Bing Bong Boom, Eenie Meenie Minie Moe.”,
“Dog goes woof, cat goes meow, cow goes moo, sheep goes baa.”,
“Vancouver is among Canada’s densest and most ethnically diverse cities.”,
“If you want to play soccer, you must play with passion.”,
“Tomatoes are considered fruits, not vegetables.”,
“My name is Darren Entwistle and I am the founder of Telus.”,
“What a beautiful day it is on the beach, here in beautiful and sunny Hawaii.”,
“Peter Piper picked a peck of pickled peppers”,
“The quick brown fox jumps over the lazy dog.”,

]

while True:

print("Welcome to Macdara's Typing Simulator!")
print("You will be asked to type a sentence. Your goal is to type as accurately and quickly as you possibly can.")
print("There are over 15 different possible sentences that can be generated, each ranging in difficulty.")
print("\nType the following sentence as quickly and accurately as you can:")


sentence_to_type = random.choice(sentences)
print(f"\n{sentence_to_type}\n")


input("Press Enter when ready...")

start_time = time.time()

user_input = input("Type the sentence above: ")

end_time = time.time()

time_taken = end_time - start_time

word_count = len(sentence_to_type.split())
wpm = (word_count / time_taken) * 60

correct_chars = 0

for i in range(min(len(user_input), len(sentence_to_type))):
    if user_input[i] == sentence_to_type[i]:
        correct_chars += 1

accuracy = (correct_chars / len(sentence_to_type)) * 100

print("\n--- Results ---")
print(f"Time taken: {time_taken:.2f} seconds")
print(f"Words per minute: {wpm:.2f} WPM")
print(f"Accuracy: {accuracy:.2f}%")



if accuracy == 100:
    print("Congrats on perfect accuracy!")
if 70 <= accuracy <= 99.9:
    print("Great accuracy, but aim for perfection on your next attempt.")
if 40 <= accuracy <= 66.9:
    print("Please consider practicing your accuracy.")
if 67 <= accuracy <= 67.9:
  print("67 67 67 67 67 67 67 67")
if 0 <= accuracy <= 39.9:
    print("Your accuracy is unacceptable.")


if 10 <= wpm <= 20.9:
    print("No offence, but you could type a teeny bit quicker.")
if 21 <= wpm <= 40.9:
    print("Your typing speed is pretty average... work could be done.")
if 41 <= wpm <= 55.9:
    print("Your typing speed is not too bad, but still consider practicing.")
if 56 <= wpm <= 66.9:
    print("Your typing speed is good. If you can, try typing even FASTER.")
if 67 <= wpm <= 67.9:
    print("67 67 67 67 67 67 67 67 67 67")

if 68 <= wpm <= 80.9:
  print("Your typing speed is excellent. Well done.")

if 81 <= wpm <= 100.9:
    print("Now this is elite typing speed. Only a small percentage of the world's population can type this fast!")
if 101 <= wpm <= 140.9:
    print("Unbelievable typing speed. If you haven't already, you should really considering going professional.")

if 141 <= wpm <= 100001:
    print("Your typing speed is inhumane. Focus on Accuracy.")


play_again_input = input("\nPress '1' to play again or any other key to exit: ")


if play_again_input != '1':
    print("Thanks for playing! Goodbye.")


    break
Sentences

The code below include the sentences that I used for my typing simulator. Every time you run the simulator, the computer will give you one of the following sentences to complete. I made these specific sentences, but any other creative sentences can also work.

import random
import time

sentences = [
“Beethoven, Bach, Haydn, Mozart, Tchaikovsky, and Schubert were all classical composers.”,
“The Flappy Fellow From Fusion Flies Free Forever Flourishing.”,
“Open The Doors, close the doors, OPEN the DOORS, close THE doors.”,
“Real Madrid is a Spanish professional football club based in Madrid.”,
“Chemistry, Biology, Earth Science, and Physics are all topics covered in science.”,
“The Canucks will win the 2026 Stanley Cup.”,
“The Fish and Chips in Ireland sure are the best.”,
“Abra-Cadabra Alakazam, Bing Bong Boom, Eenie Meenie Minie Moe.”,
“Dog goes woof, cat goes meow, cow goes moo, sheep goes baa.”,
“Vancouver is among Canada’s densest and most ethnically diverse cities.”,
“If you want to play soccer, you must play with passion.”,
“Tomatoes are considered fruits, not vegetables.”,
“My name is Darren Entwistle and I am the founder of Telus.”,
“What a beautiful day it is on the beach, here in beautiful and sunny Hawaii.”,
“Peter Piper picked a peck of pickled peppers”,
“The quick brown fox jumps over the lazy dog.”,

The “While True” Code

When you use “while True:” and then “break” at the start and end of your code (not including the sentences), it initially creates a loop that immediately exits it because of the break statement. This part of my code helps create the “play again” statement. If the user types “yes” when play again appears, the while true will apply, but when the user types no, the “while true” isn’t true anymore, which allows the “break” to take control.

Printing Sentences

The code below includes the welcoming sentences that guide you through the simulator. This part was the easiest to understand; all I had to do was type – print: (“blah blah blah”) – Then, the sentence in the brackets would appear in the code.

print(“Welcome to Macdara’s Typing Simulator!”)
print(“You will be asked to type a sentence. Your goal is to type as accurately and quickly as you possibly can.”)
print(“There are over 15 different possible sentences that can be generated, each ranging in difficulty.”)
print(“\nType the following sentence as quickly and accurately as you can:”)

Generating Random Sentences

This part of my code helped the system choose a random sentence to generate:

sentence_to_type = random.choice(sentences)
print(f”\n{sentence_to_type}\n”)

Printing WPM, accuracy, and time

The code below asks the user to press “Enter” when they’re ready to start typing. It then starts a timer and waits for the user to type a specific sentence – (sentence_to_type, which should be defined earlier in the code) – . After the user finishes typing, it stops the timer, calculates how long they took, how fast they typed in WPM, and how accurate their typing was by comparing it to the original sentence. Then, it prints the results, time taken, WPM, and accuracy percentage:

input(“Press Enter when ready…”)

start_time = time.time()

user_input = input(“Type the sentence above: “)

end_time = time.time()

time_taken = end_time – start_time

word_count = len(sentence_to_type.split())
wpm = (word_count / time_taken) * 60

correct_chars = 0

for i in range(min(len(user_input), len(sentence_to_type))):
if user_input[i] == sentence_to_type[i]:
correct_chars += 1

accuracy = (correct_chars / len(sentence_to_type)) * 100

print(“\n— Results —“)
print(f”Time taken: {time_taken:.2f} seconds”)
print(f”Words per minute: {wpm:.2f} WPM”)
print(f”Accuracy: {accuracy:.2f}%”)

Fun Feedback

This part of my code was my favourite. Depending on how well the user typed (accuracy, time, WPM), specific sentences (made by yours truly) would generate. I made sure that these comments were appropriate and positive, hoping to encourage the user to practice typing more:

if accuracy == 100:
print(“Congrats on perfect accuracy!”)
if 70 <= accuracy <= 99.9:
print(“Great accuracy, but aim for perfection on your next attempt.”)
if 40 <= accuracy <= 66.9:
print(“Please consider practicing your accuracy.”)
if 67 <= accuracy <= 67.9:
print(“67 67 67 67 67 67 67 67”)
if 0 <= accuracy <= 39.9:
print(“Your accuracy is unacceptable.”)


if 10 <= wpm <= 20.9:
print(“No offence, but you could type a teeny bit quicker.”)
if 21 <= wpm <= 40.9:
print(“Your typing speed is pretty average… work could be done.”)
if 41 <= wpm <= 55.9:
print(“Your typing speed is not too bad, but still consider practicing.”)
if 56 <= wpm <= 66.9:
print(“Your typing speed is good. If you can, try typing even FASTER.”)
if 67 <= wpm <= 67.9:
print(“67 67 67 67 67 67 67 67 67 67”)

if 68 <= wpm <= 80.9:
print(“Your typing speed is excellent. Well done.”)

if 81 <= wpm <= 100.9:
print(“Now this is elite typing speed. Only a small percentage of the world’s population can type this fast!”)
if 101 <= wpm <= 140.9:
print(“Unbelievable typing speed. If you haven’t already, you should really considering going professional.”)

if 141 <= wpm <= 100001:
print(“Your typing speed is inhumane. Focus on Accuracy.”)

As previously mentioned, I am a beginner coder and have no past experience using code. If you are in the same position as me, the one thing I would highly encourage is experimenting with code before immediately relying on AI. This was the first thing I did, as it helped me gain an understanding of what I would be working with.

I spent around 5-10 minutes typing in random words, numbers, letters, and even punctuations. I learned that “!”, “print”, and “if” did something, but I wasn’t sure what its purpose was.

Additionally, I learned that in coding, we use functions; self-contained blocks of code primarily designed to perform specific tasks. They are used multiple times in almost all programming languages and serve purposes such as reusability, modularity, and organization. Although I didn’t use any functions, I intend to use some in future projects.

After this short period of time, I asked AI what these specific words and letters were typically used for. This is when I learned that “print” printed out messages, which is what I used for the sentences the user was meant to type.

In terms of my interactions with AI, I attempted to use it as minimally as possible. I would use AI for educational purposes, not asking for it to write my entire code, but rather write portions I didn’t understand and explain them thoroughly. This way I learned how and what to do rather than mindlessly copying and pasting the code provided by AI.

Some questions I asked AI include:

“How can I track an individuals typing accuracy on a typing simulator using Python code? Explain each step in this process, talking about the terminology you use.”

Link to discussion: https://chatgpt.com/c/68f1c174-97c8-8333-a14c-be19508833b2

“What does _____ mean in coding language? In what ways can it be used?”

Link to discussion: https://chatgpt.com/c/68f1c216-8380-832c-8802-b7b600bf6c16

I think that’s everything to know about my project. Thank you for listening.

Comments

One response to “Macdara’s Typing Simulator”

  1. mcrompton Avatar
    mcrompton

    Hi Macdara. Good start! I love the discussion of your use of AI in this project. I appreciate your insistence on learning these skills for yourself rather than having AI do the work for you. Can I ask that you include a link to the full transcript of that discussion, please. This is part of the assignment. Also, we need to see an explanation of how your code works. I like that we can see that it works with the inclusion of the colab link, but I we need to know how. Finally, you were asked to define and use a function. Can you please edit your code so that it meets this requirement? Resubmit when you are done. Thank you.

Leave a Reply to mcrompton Cancel reply

Your email address will not be published. Required fields are marked *