Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[GBDK] GAMEBOY [C]

Name: !MILKRIBS4k 2009-06-16 17:13

Anyone on here use the gameboy c compiler gbdk? http://gbdk.sourceforge.net/ There doesn't seem to be much documentation on it! Most of the code I find on google is designed for an older version of the compiler! How would I go about displaying a simple sprite! Someone help MILKRIBS4k!

Name: Anonymous 2009-06-17 13:59

>>40
Stuff like 5. makes no sense!
Let's just look at an example;

[~] echo 'I can ensure you I an no anus!' > milkribs1
[~] echo 'I can ensure you I an no anus!                 ' > milkribs2
[~] du -b milkribs1 milkribs2
31      milkribs1
48      milkribs2

Oh no, the second file, with superfluous whitespace, is bigger! By 17 bytes, which looks like the number of added trailing spaces.
Now let's look at some actual code.


[~] cat milk
{
  int i, j;

  for(i = 0; i < BOARD_ROW; i++)
    for(j = 0; j < BOARD_COL; j++)
    {
      move(i, j);
      addch(board[i][j]);
    }
  move(row, col);
}
[~] cat milk | sed -s 's/ //g' > milk2
[~] cat milk2
{
inti,j;

for(i=0;i<BOARD_ROW;i++)
for(j=0;j<BOARD_COL;j++)
{
move(i,j);
addch(board[i][j]);
}
move(row,col);
}
[~] du -b milk milk2
159     milk
113     milk2
[~]


Did I just make the file ~75% of its original size?

Also, about the speed; the compiler has to strip down the input file to pure code. Whitespace is not pure code, it is discarded before compiling the file. There is no whitespace in pure C. And the more whitespace there is, the longer will the discarding take. Granted, it won't make a difference in a 100-LOC file, but when you're writing a big project, it matters. It's about 20 seconds additional compile time for a 5-kLOC program (here, you just have to believe me, because I no longer have the source file; I don't keep four-year old stuff on my machine. But it makes sense, doesn't it?)

Seriously, are you trolling me?

Name: Anonymous 2009-06-17 14:01

Again, whoops, there has to be some whitespace, namely between type and declared variables. So that's one more byte in the stripped code. But the point still stands.
>>40
Read K&K, it's all explained there.

Name: Anonymous 2009-06-17 14:06

>>42
FUCK I meant K&R. Obviously.

Name: !MILKRIBS4k 2009-06-17 14:18

>>41
OK I see what you are saying here!
>>43
What the fuck is K&R, link perhaps!

Name: Anonymous 2009-06-17 14:18

I have to admit I find MILKRIBS midly entertaining, not just a stupid idiot like FV.
Also >>41
[~] cat milk
I kind of giggled.

Name: Anonymous 2009-06-17 14:19

>>41
Seriously, are you trolling me?
You couldn't tell?

Name: !MILKRIBS4k 2009-06-17 14:22

>>46
I am not a troll! I am just new to programing! I am not that informed on a lot of topics! GIVE ME TIME

Name: Anonymous 2009-06-17 14:32

>>41
See, it wasn't that hard. Take your time, don't act like you know everything, and it will be easy to be a good programmer.
                                              ***
K&R is an *excellent* book on the C language; the best perhaps, maybe inferior only to the SICP;

http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)

Name: Anonymous 2009-06-17 15:00

Name: Anonymous 2009-06-17 15:52

Jesus christ.. Print out a copy of the Yoshi docs and program in assembler, that will be a lot easier than dicking around with an obsolete unsupported environment.

Name: !MILKRIBS4k 2009-06-17 16:00

>>50
Link to Yoshi docs please!
>>49
back to /b/, plz

Name: Anonymous 2009-06-17 16:31

>>51
Seems I misremembered the name, it's the Pan docs you want. Ordinarily I'd just tell you to fucking Google them yourself, but as you're too fucking stupid to even manage something so simple I'll just give a link directly:
http://nocash.emubase.de/pandocs.txt

Name: !MILKRIBS4k 2009-06-17 16:40

>>52
I did google Yoshi docs but noting relevant came up!

Name: Anonymous 2009-06-17 20:25

>>53
Can you please stop using exclamation marks all the time? :(

Name: !MILKRIBS4k 2009-06-17 20:31

>>54
NO! I already went over why on /lounge/!

Name: Anonymous 2009-06-17 20:45

>>55
[citation needed] or you're an anus!

Name: !MILKRIBS4k 2009-06-17 21:09

>>56
I don't know what thread it was now! You do the research!

Name: Anonymous 2009-06-17 21:27

Someone needs to write a greasemonkey script to change the exclamation marks in the milkribs post into full stops.

Name: Anonymous 2009-06-17 21:49

>>41
This is honestly the most stupid thing I've seen in my entire life. Please tell me you're just trolling milkribs here.

Name: Anonymous 2009-06-17 22:25

>>58
They're called periods, you anus.

>>1,4,7,9,11,14,16,18,20,23,28-29,33,40,44,47,51,53,55,57
Back to /lounge/, MILKRIBS,you anus.

Name: Anonymous 2009-06-17 22:34

>>55
So a ran a /lounge/ scrape query...
I can't! I am just always so pumped![1]
That's your grand explanation? Just stop being such an idiot and type like a normal person.

1. http://dis.4chan.org/read/lounge/1245089309/24

Name: Anonymous 2009-06-17 23:13

>>59
What's wrong? It makes perfect sense to me.

Name: Anonymous 2009-06-18 0:42

>>62
It makes perfect sense because IT'S OBVIOUS THAT MORE CHARACTERS WILL EQUAL MORE ROOM BUT IT'S NOT A REASON NOT TO INDENT.

Who gives a shit about a .c/.h that takes 60kb instead of 50? Especially at the cost of readability. If it affected the performance once it's compiled, I would maybe agree (actually no, I wouldn't anyway) but this is just fucking stupid.

Name: Anonymous 2009-06-18 1:05

>>63
s/MORE ROOM/MORE SPACE TAKEN/

or something like that.

Name: Anonymous 2009-06-18 1:39

>>63
Please play along.

Name: Anonymous 2009-06-18 1:40

MILKRIBS are you there? I gotta talk to you about something important.

Name: Anonymous 2009-06-18 1:42

(  ≖‿≖) けいかくどおり

Name: Anonymous 2009-06-18 2:10

>>34
I've argued against a number of these in the past.
To make this quick,
4. Swapping with exclusive-or (a^=b^=a^=b swaps a and b) is faster than using a temporary. This works for all types (including structures), but not on all compilers. Some compilers may also give you a harmless warning.
Reasons for avoidance in practice
Most modern compilers can optimize away the temporary variable in the naive swap, in which case the naive swap uses the same amount of memory and the same number of registers as the XOR swap and is at least as fast, and often faster. As a general rule, you should never use the XOR swap unless you know for a fact that the naive swap will not suit your application (which is very rare in this day and age). The XOR swap is also much less readable, and can be completely opaque to anyone who isn't already familiar with the technique.1
__________________
1. http://en.wikipedia.org/wiki/XOR_swap_algorithm#Reasons_for_avoidance_in_practice

Name: Anonymous 2009-06-18 3:17

>>68
YHBT

that list is compiled by an idiot on some site

Name: Anonymous 2009-06-18 5:49

>>68

that's right >>69-san. pp macroes can make hacks like this readable without a performance hit

Name: Anonymous 2009-06-18 5:57

>>69
I searched for the source but the only thing that came up was /prog/. Was this, the site you referred to?

Name: Anonymous 2009-06-18 6:10

>>71
0/10

Name: Anonymous 2009-06-18 6:22

>>68
Ha ha.  Do YOU, Anonymous@Sage, think your smarter than Brian Kernighan??  Why don't you pipe down and leave theory tot he professionals.

Name: Anonymous 2009-06-18 6:23

>>30
>How about *YOU* are full of bullshit?
It's juhannus now, Linus, just grab a beer and chill.

Name: Anonymous 2009-06-18 6:28

>>73
Do YOU Anonymous, think your (sic) smarter than Leonardo da Vinci?? Why don't you pipe down and leave perpetual motion machines to the professionals.

Name: !MILKRIBS4k 2009-06-18 7:45

>>66
I am here now!

Name: Anonymous 2009-06-18 7:52

>>76
You're an Anus!

Name: !MILKRIBS4k 2009-06-18 7:55

>>77
I can insure you I am no anus!

Name: Anonymous 2009-06-18 10:54

>>76
You should collaborate with FrozenVoid and help him on his encryption project! He's also learning C, it'd be good for you two! Everything's better when you're doing it with someone!

Name: !MILKRIBS4k 2009-06-18 11:38

>>79
Do you have this "FrozenVoid"'s e-mail, or anyway I can get in contact with him!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List