Solved: glitch .....Text Adventure (Python) code works but breaks waayyy too easily???
tech4teachers (1)

SOLVED....looks like this was an autoformatting error, took all of the code and exported it as a zip, opened it in Sublime, added a new print output to line 333 and resaved it/copied/pasted back into ...and it WORKED.... no more unindent error!

Also played around with changing Python 3's use of >input< and using the supposedly still valid >raw_input< compatible with in Sublime and my terminal ....but not in

Old post below>>>>
Need help, I am doing and introductory summer class teaching basic coding concepts and our final project is this Python 3 text adventure "proto-game" that the kids can then adapt and run with as their creativity and comfort with Python expands.
Here is the really weird thing...the code works ....but it breaks ridiculously easily if I try to add an extra >>>print("this is just for debugging")<<< line of code at line 333 before the >>>prompt()<<< **see picture of the [pyflakes] error below...the line I am adding is not necessary, but bizarrely breaks the whole program waayyy too easily.

It's weird that adding anything ...even if I delete it....even if I completely retype lines 329---through---335 from scratch....once something else has been added to line 333 an "unindent" error plagues the code permanently in that location unless I completely crtl or command Z to undo all the way back to the original working original.

I hand coded this entire thing, got it working as a decent template for the kids to replicate themselves ( also from scratch...I am not a copy-paste teacher) and then explore further.

The original code works....I just can't figure out why it breaks sooooo easily.

I have been going back line for line, re-indenting everything, even deleting all comments to get down to 'pure' uncommented code.... but once you mess with that spot it breaks....and refuses to debug matter what I do.

Could it be the mixture of comments using """ and ## or # ?
Could it be some tab or errant spacebar indent elsewhere I can't find?
Could it be just a structural issue with the order and sequence of the functions, when they are created vs when they are called?

Can anyone point us in a useful direction to fix this....even if it means a complete rewrite??

You are viewing a single comment. View All
Answered by Edgod (58) [earned 5 cycles]
View Answer
tech4teachers (1)

@Edgod ....SOLVED.... I just amended the original post...took it into sublime and it worked just fine....reimported into now it works!!!

Ridiculous waste of time, but glad it works.