Skip to content

Instantly share code, notes, and snippets.

View harbar20's full-sized avatar

Harshith Iyer harbar20

View GitHub Profile

Keybase proof

I hereby claim:

  • I am harbar20 on github.
  • I am harbar20 (https://keybase.io/harbar20) on keybase.
  • I have a public key whose fingerprint is 9565 8F6A 084D D63C 3BE4 8117 D88D 9E99 211F 0746

To claim this, I am signing this object:

@harbar20
harbar20 / Scramblerproject.py
Last active September 8, 2018 17:06
This program is my first ever personal Python project. It randomly provides a scramble for your 3x3 Rubik's Cube which is as long as the user inputs it to be when calling the function. I encourage you to suggest improvements because I am still a beginner. Enjoy!
import random
import kociemba
import copy
class Cube():
# All valid 3x3x3 moves in half-turn metric
notations = {"U", "D",
"R", "L",
"F", "B"}
u_side = [["U", "U", "U"], ["U", "U", "U"], ["U", "U", "U"]]
import string
import copy
### DO NOT MODIFY THIS FUNCTION ###
def load_words(file_name):
'''
file_name (string): the name of the file containing
the list of words to load
Returns: a list of valid words. Words are strings of lowercase letters.
class CiphertextMessage(Message):
def __init__(self, text):
'''
Initializes a CiphertextMessage object
text (string): the message's text
a CiphertextMessage object has two attributes:
self.message_text (string, determined by input text)
self.valid_words (list, determined using helper function load_words)
def genPrimes():
"""
uses a generator to give the next prime number
"""
primes = [2]
primeno = 3
yield primes[-1]
while True: