0

New upload. Opinions?

I just uploaded the biggest code project in python I've ever made. Opinions?

4th Mar 2017, 6:11 AM
Swyftwulf
Swyftwulf - avatar
8 odpowiedzi
+ 7
Put comments to demonstrate how to input. I don't know what to input :/
4th Mar 2017, 6:14 AM
Mr.Robot
Mr.Robot - avatar
+ 7
It works okay and does its job, so that's the most important :) But it could use a serious code optimization: a for loop and/or list element addressing. There seems to be a lot of code multiplication to perform similar tasks.
4th Mar 2017, 10:56 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 7
I made a DRY version of it too: https://code.sololearn.com/cLhUVjq0OwV0
4th Mar 2017, 10:02 PM
LayB
LayB - avatar
4th Mar 2017, 3:38 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
Hmm... why don't you use one, two-dimensional list instead of four? Also, there is no point in making all those conditionals separately. Instead, think of a formula that would update the relevant cell based on the input. If you want and allow me, I can take tour code, optimize it and show you what I mean :)
4th Mar 2017, 2:37 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
It runs best on a third party app like qpython3. It asks you basically "Read or Edit"(first letter must be capitalized), then row (1-4), then column (1-4), then if you selected Edit it asks for the new value. Either way it will then ask if u want to continue (y/n). For sake of simplicity I would pick N. An example input stack for this app would be: Read 1 1 N
4th Mar 2017, 6:20 AM
Swyftwulf
Swyftwulf - avatar
0
Thank you kuba. my difficulty in using the loops is that it uses 4 different lists so each must be addressed separately
4th Mar 2017, 2:02 PM
Swyftwulf
Swyftwulf - avatar
0
Please do. It would be a good learning experience for me and I may learn some tricks
4th Mar 2017, 2:45 PM
Swyftwulf
Swyftwulf - avatar