Post Reply 
Fifteen puzzle solvability, Numworks Python
04-09-2020, 01:24 AM (This post was last modified: 04-09-2020 01:31 AM by Don Shepherd.)
Post: #2
RE: Fifteen puzzle solvability, Numworks Python
I finally figured out how to pass a list into the program at execution time.

Rather than hard code the 17 values in the program itself, you can instead pass the values when you execute the program like this:

fifteen([99,5,15,8,12,13,1,4,10,2,7,14,11,9,3,6,0])

Thus, the program need not change for a new set of data. Remove the list assignment (a = [...]) from the program to do this, and change the def fifteen(): to def fifteen(a):
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Fifteen puzzle solvability, Numworks Python - Don Shepherd - 04-09-2020 01:24 AM



User(s) browsing this thread: 1 Guest(s)