Skip to content
Snippets Groups Projects
Commit 9fe58470 authored by s2299100's avatar s2299100
Browse files

tried to make it into a class

parent c1111ea2
No related branches found
No related tags found
No related merge requests found
...@@ -6,24 +6,23 @@ if __name__ != "__main__": ...@@ -6,24 +6,23 @@ if __name__ != "__main__":
#if this file is run in script mode, it will assign arbitrary testing values in order to check whether the code is running correctly #if this file is run in script mode, it will assign arbitrary testing values in order to check whether the code is running correctly
elif __name__ == "__main__": elif __name__ == "__main__":
i = 2 i = 2
sequence1 = [0, 2, 5] sequencelist = [[0, 2, 5], [2, 3, 1], [0, 2]]
sequence2 = [2, 3, 1]
sequence3 = [0, 2]
sequencelist = [sequence1, sequence2, sequence3]
currentinput = [0, 2] currentinput = [0, 2]
currentinputlength = len(currentinput) currentinputlength = len(currentinput)
currentsequence = sequencelist[i] currentsequence = sequencelist[i]
currentsequencelength= len(currentsequence) currentsequencelength= len(currentsequence)
#function that checks if the input matches the sequence '''this class deals with all the functions for the current sequence'''
def checkcorrect(): class Sequence:
if currentsequencelength != currentinputlength: #function that checks if the input matches the sequence
correct = False def checkcorrect():
else: if currentsequencelength != currentinputlength:
for c in range (len(currentsequence)): correct = False
if currentsequence[c] != currentinput[c]: else:
correct = False for c in range (len(currentsequence)):
else: if currentsequence[c] != currentinput[c]:
correct = True correct = False
print (correct) else:
if __name__ == "__main__": correct = True
checkcorrect() print(correct)
\ No newline at end of file if __name__ == "__main__":
checkcorrect()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment