[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Programming newfag here, using Python 2.7 and libtcod 1.5.1

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 7
Thread images: 1

File: maxresdefault.jpg (105KB, 1920x1080px) Image search: [Google]
maxresdefault.jpg
105KB, 1920x1080px
Programming newfag here, using Python 2.7 and libtcod 1.5.1

what in the fuck is wrong with my code, i can't for the life of me understand what's wrong

http://pastebin.com/phuML5Ej
>>
i'm making a RogueLike, sorry for not specifying
>>
>>281106

Well can you at least post what error you're getting? I can't be bothered to install 2.7 (using 3.x since I can remember).
>>
>>281126
Not sure, it won't say. I ran it with the command prompt and it just goes to the next line and blinks.
>>
>>281106
Your core loop doesn't call handle_keys and doesn't in fact do anything other than print a character over and over.
>>
>>281132
How do I fix that, exactly?
>>
>>281145
It's your program. As far as we know it might be supposed to be declaring a function that never gets called, then spinning in a loop that does nothing.

Perhaps you should work through an introductory book on Python (or procedural languages in general), then come back to your project once you're a bit more familiar with programming?

What you're trying to do would seem to be an ideal fit for OO, but you don't seem to be using OO techniques at all; maybe read a good book on OO as well.

Head-first Java and Head-first Design Patterns is a really good introduction to procedural and OO languages. Yes, you have to use Java, but it'll build a solid foundation for other languages, both higher-level languages like Python, and lower-level languages like C++. Once you know a programming paradigm, it's easy to use any language from that paradigm; almost all the "X language is better than Y language" shitposting you see is produced by people who only know one language, don't understand the underlying paradigms, usually aren't formally trained, and insist that their language is the very best there is because they haven't used anything else, haven't learned the underlying skills, and aren't actually capable of using anything else. Don't be that guy. Learn to learn languages.

Given the scale of what you're doing, you'll do way better if you learn all this stuff first then apply what you've learned to your big project than if you learn as you go and end up producing a whole pile of unmaintainable spaghetti and having to throw it out and start over.
Thread posts: 7
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.