ITT: Nerd Jokes

Started by tSwitch, May 03, 2009, 09:41:43 pm

Previous topic - Next topic

G_G

Quote from: Rival Blizzard on May 09, 2009, 04:14:51 pm
Don't be mean, he doesn't know better. He probably thought that $game_variables had to initialized since it contains variables. ._.

Spoiler: ShowHide
var = 0
loop do
  print "I will not throw paper airplanes in class."
  var += 1
  if var == 500
    break
  end
end



Blizzard I tried that and it didnt work. The only different is that I had this

Spoiler: ShowHide

printed = 0
loop do
  print "I will not throw paper airplanes in class."
  printed += 1
  if printed == 500
    break
  end
end


But it didnt work.

Blizzard

Because "print" doesn't work that well in RGSS. Use "p" instead.

@WcW: Not really. Getting 500 times a pop up screen owns the same text on one window. Also, it won't work properly in RGSS.

In your face:

p "I will not throw paper airplanes in class.\n" * 500


:D
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

fugibo

May 09, 2009, 06:36:39 pm #62 Last Edit: May 09, 2009, 06:56:41 pm by Biker WcW
Oh, I assumed we were talking Ruby, not RGSS, which sucks a billion times more. Do you have any experience with plain ruby/standard library? Just wondering.

EDIT:
I just tested it, and even the top speed of your method was 3ms slower that the worst speed of my method; I got up to 8-10ms faster than you at times, and other times it was up to 20ms.

EDIT2:
After changing 500 to 1,000,000 in both of our implementations, blizzard, mine beat yours by a whopping 6 seconds, mine taking 76ms and yours taking ~6.6 each time. (I piped output from both to /dev/null to eliminate the time it took to print it out to the shell, for a better comparison ;)

Scripts: ShowHide

Blizzard's method:

#! /usr/bin/ruby

1000000.times { p "I will not throw paper airplanes.\n" }


My method:

#! /usr/bin/ruby

print "I will not throw paper airplanes.\n" * 1000000


Using this code to test from bash, after chmod'ing both files:

time ./blizz-method.rb >> /dev/null
time ./wcw-method.rb >> /dev/null


Of course, I tested both multiple times to ensure accuracy ;)



Sally

why are the code boxes only 1line long?!!?!~

G_G

Use Opera. I.E. isnt good when displaying Code Boxes.

fugibo

Or Safari 3/4. Fx works well though. Blizz is just too lazy to fix Safari (and presumably Chrome, since they both use WebKit)

Sally


tSwitch

Quote from: Biker WcW on May 09, 2009, 05:12:08 pm

#include <iostream>

int main () {
  for (int n = 0; n < 500; ++n)
    std::cout << "I will not throw paper airplanes in class" << [b](n == 499 ? "." : ";")[/b] << std::endl;
}


C++ makes short code shorter


the bolded part seems like a pointless check, tbh.
you also forgot to return 0 from main, even though you used int main ;)

#include <iostream>

void main () {
 for (int n = 0; n < 500; n++)
   std::cout << "I will not throw paper airplanes in class.\n";
}


I think that's as short as it gets.


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: tSwitch.us | Twitter | Tumblr

fugibo

Argh! G++ never gives me errors when I don't return, so I hadn't thought about it. The only reason I even use "int" usually is because SDL requires it.

G_G

Quote from: Biker WcW on May 09, 2009, 11:03:01 pm
Argh! G++ never gives me errors when I don't return, so I hadn't thought about it. The only reason I even use "int" usually is because SDL requires it.


G++ or C++? Is there a program called G++? O.o

fugibo

G++ (or gpp) is the GNU C++ Compiler. I use it OSX, 'cuz it's what comes with OSX, and it works well.
Anyway...

I vote that we make a new nerd forum that only nerds can join, and we post this crap there. Or maybe I need to sleep. I like cheese, we need our cheese emoticon back.

Vell

I SAY - HECK NO! leave the nerds to post here. we ALL are nerds anyway.

Blizzard

Quote from: Biker WcW on May 09, 2009, 06:36:39 pm
Oh, I assumed we were talking Ruby, not RGSS, which sucks a billion times more. Do you have any experience with plain ruby/standard library? Just wondering.

EDIT:
I just tested it, and even the top speed of your method was 3ms slower that the worst speed of my method; I got up to 8-10ms faster than you at times, and other times it was up to 20ms.

EDIT2:
After changing 500 to 1,000,000 in both of our implementations, blizzard, mine beat yours by a whopping 6 seconds, mine taking 76ms and yours taking ~6.6 each time. (I piped output from both to /dev/null to eliminate the time it took to print it out to the shell, for a better comparison ;)

Scripts: ShowHide

Blizzard's method:

#! /usr/bin/ruby

1000000.times { p "I will not throw paper airplanes.\n" }


My method:

#! /usr/bin/ruby

print "I will not throw paper airplanes.\n" * 1000000


Using this code to test from bash, after chmod'ing both files:

time ./blizz-method.rb >> /dev/null
time ./wcw-method.rb >> /dev/null


Of course, I tested both multiple times to ensure accuracy ;)



Doesn't surprise me. "p" is a built-in method in RGSS that extends "print" hence it's slower. There's also "puts" in Ruby. Also, obviously sending stuff to the I/O 1000000 times is slower than concatening a string 1000000 times. And you never said the code is supposed to be fastest. I thought we were just messing around with shortness. :P

Quote from: Lass Sally on May 09, 2009, 09:49:23 pm
why are the code boxes only 1line long?!!?!~


IDK, they worked fine for me in Chrome and IE while others were reporting the same problem.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Sally


Gabbergon

Quote from: Elite Four NAMKCOR on May 06, 2009, 10:55:47 am
Spoiler: ShowHide
10
11
12
13
14
15
16
17
20
22
24
31
100
[ ? ]
10000

find ?



finally I found ?
I know for sure it is what i think

fugibo

I had to google it.

Gabber, I highly doubt you got it if it's what I think it is, unless you learned a lot from a certain post by a certain annoying preteen >_<



And that's just more of a noticing problem, you only have to know some basic parts of math to get it, it's just noticing it (and I feel like an idiot for not, I thought it was a totally different type of problem)

Gabbergon

google it... crap that i didnt thought bout that

indeed it seems i wasn't correct :(

fugibo

I don't blame you, I didn't think of it either. I doubt almost anybody would.