So basically I have this function compare_arrays. For my assingment and almost as soon as it gets called make code arcade gives this error that I’m guessing is an internal error.
“e.findIdx is not a function” no line number since it does not exist in my code. Here is my function:
def compare_arrays(arr1, arr2):
feedback = [0, 0, 0, 0] # Initialize feedback array with zeros
for i in range(3):
print(arr1)
print(i)
if arr1[i] == arr2[i]:
print("set to 1")
feedback[i] = 1
print(arr1 + ", " + arr2 + ", " + feedback)
elif isin(arr1[i], arr2):
print("set to 2")
feedback[i] = 2
print(arr1 + ", " + arr2 + ", " + feedback)
else:
print("set to 0")
feedback[i] = 0
print(arr1 + ", " + arr2 + ", " + feedback)
return [feedback[0],feedback[1],feedback[2],feedback[3]]
def isin(val, arr):
for i in range(4):
if arr[i] == val:
return True
return False
Here is the link to my project: https://arcade.makecode.com/S04313-39937-09651-25135
the controls are:
left arrow: move selector left
right arrow: move selector right
up arrow: submit guess
down arrow: select
B Button: open the color picker menu
The project is based off of the game master mind. It would help anyone to understand this project and how it works if they understand how to play master mind.