Link Bar

Home | Games | Programming | Tutorials | Donate | Legal (These are mostly empty right now. Placeholders!)

warning code

This website contains adult content.

Friday, February 24, 2012

Day 10: FETRIS (work in progress)

I went through Evil_Greven's tutorial on how to build a Tetris clone in an hour with C++.  I followed his instructions using Microsoft Visual Studio 2008 Express.  I'm much less intimidated by C++ now than I was two days ago, but I feel like I'm back in the 5th grade again, learning Spanish for the first time.  "Yeah, I know what 'buenos días' means.  'Pantalones?'  Oh, man, this is gonna be easy.  Wait, why is N-yay a totally different letter from N-eh?"  Seriously, you guys, for the longest time I thought that "vedevaca" was the name of the letter, not just "veh" - I didn't learn about "b de burro" until I was in freakin' high school.  Same with "y griega," I didn't know it was as opposed to "i latina" until I dated a girl from Uruguay and she told me.

I guess what I'm saying is, I need to date a programmer now.  No, that is not the most cynical use of dating ever.  But, uhh... I can't come up with a more cynical one.  Because I'm so totally not cynical.  Double-promise.

Anyway, I got through with no problem, except that VC was telling me that I hadn't declared shit which I had so too declared, just look.  But whatever, I didn't let it bother me, and I kept on chugging through.  I would highlight everything that turned blue and hit F1 to bring up the help, and read through those articles.  This made it take like three hours instead of one, but that's OK.  Then I went to compile it at the end, and that's when shit hit the fan.

As my grandma would say, "Errors out the yin-yang."  Yes, my grandma talks like that.  No, it's not cool if you say that while being under 70 years old.  Yes, that's a moving target; it won't be cool for 70-year-olds to talk like that when you're 70.  Modern medicine has made it culturally impossible for us to be ironic by speaking in the fashion of young people when we are in fact old people.  And no, current old people do not suffer from this flaw in our age-based system of behavioral standards.  But hey, that's what you get for longevity.  Stupid double-standards.

ANYWAY.

I dutifully read the errors and went to the lines of code where they allegedly occurred.  Ahh, shit, I forgot a "( )".  Oh, damn, a legit typo; must'a fat-fingered it.  Whoops, left out a semicolon!  And... that... I can't...
fetris\main.cpp(187): error C2440: '=' : cannot convert from 'const char [7]' to 'LPCWSTR'
What the blue fuck does that mean?  OK, let's go to line 187:
wcx.lpszClassName=WINDOWCLASS;
Right.  And what did Evil_Greven say to do here?
wcx.lpszClassName=WINDOWCLASS;
All right.  Double-check each and every character, and... yup, that's exactly the same.  And what other sage advice does VC have to give me on this?
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Ohhhhh-kayyyyy... I know what that means and everything.  And I've got 21 more errors to go.  That's not bad, for over 600 lines of code on my first day.  Wait.  Hold on.  Remember Alexander the Great.


This tutorial was written in 2003.  This might be nobody's mistake, just a case of mismatched standards.  Maybe.  But if it is Evil_Greven's mistake, it's almost certainly beyond my ken to fix it now.  Dammit.  I really wanted to play my very own Fetris.  I even made the bitmap for the blocks!

Whatever, I'm putting this aside for now.  I'll come back to it over the weekend and see what else I can learn.  It's not like those errors are going anywhere, right?  Besides, there's nothing like fixing a broke-ass machine to get you familiar with its workings.  But for now, I'm done with this.  You get the Tetris God:


Also, you should check out Hatetris.  Because I just bet you're a masochist.

No comments:

Post a Comment