Skip to content

Instantly share code, notes, and snippets.

@vsinha
Created April 14, 2022 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsinha/aac4aab4ca4be758f8a6de9709d1dd61 to your computer and use it in GitHub Desktop.
Save vsinha/aac4aab4ca4be758f8a6de9709d1dd61 to your computer and use it in GitHub Desktop.
for memorizing notes on the guitar fretboard
import random
import time
sleep_sec = 1
natural_notes = ["A", "B", "C", "D", "E", "F", "G"]
prev = None
def print_randomly():
global prev
curr = random.choice(natural_notes)
if prev == curr:
curr = random.choice(natural_notes)
prev = curr
print(curr)
while True:
print_randomly()
time.sleep(sleep_sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment