Forums - Open Redstone Engineers
Everyone's worst code! - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html)
+--- Forum: Programming (https://forum.openredstone.org/forum-8.html)
+--- Thread: Everyone's worst code! (/thread-685.html)

Pages: 1 2 3 4


RE: Everyone's worst code! - Billman555555 - 08-04-2013

^ yea it is
Anywho: 250gb is over exaggerated, more like 100gbs and half of that is deleted.
So 50gbs is about it.


RE: Everyone's worst code! - mort96 - 08-04-2013

ASCII text is 1 byte per char. In Unicode, the amount of bits per char isn't specified AFAIK, but it's often set to 16 bits per char.
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)


RE: Everyone's worst code! - Billman555555 - 08-04-2013

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnddddddddddddddddddddddddddddddddddddd........................ He is gone. Dingding.


RE: Everyone's worst code! - Iceglade - 08-05-2013

Code:
#Bounce off paddles with VERY sucky collision detection
        if self.pos[0] <= PADDLE_WIDTH + BALL_RAD:
            if (self.pos[1] >= playerPaddle.pos[1]) and (self.pos[1] <= playerPaddle.pos[1] + PADDLE_HEIGHT):
                self.velocity = (-(self.velocity[0] + angle_mod), self.velocity[1] + angle_mod)        
                self.pos = (PADDLE_WIDTH + BALL_RAD + 1, self.pos[1])
        if (self.pos[0] >= screen.get_size()[0] - (PADDLE_WIDTH + BALL_RAD)):
            if (self.pos[1] >= aiPaddle.pos[1]) and (self.pos[1] <= aiPaddle.pos[1] + PADDLE_HEIGHT):
                self.velocity = (-(self.velocity[0] + angle_mod), self.velocity[1] + angle_mod)
                self.pos = (screen.get_size()[0] - (PADDLE_WIDTH + BALL_RAD + 1), self.pos[1])

Whut.


RE: Everyone's worst code! - JeremyG - 08-05-2013

Code:
a=[1,2,3,4,5]
print([a[i+1] for i in range(len(a)-1)])

I honestly have no clue. This outputs [2,3,4,5]


RE: Everyone's worst code! - Billman555555 - 08-05-2013

(08-05-2013, 09:16 PM)JeremyG Wrote:
Code:
a=[1,2,3,4,5]
print([a[i+1] for i in range(len(a)-1)])

I honestly have no clue. This outputs [2,3,4,5]

hmmmmmm.......
Code:
a=[1,2,3,4,5]
println.(a[i+1] for i in range(len(a)-1))

?? that did 1,2,3,4,5??????????

I failed Sad Sad Meh ive all ways been crappy at Java>>V
Code:
println.(a[i-2])
See ^


RE: Everyone's worst code! - Thor23 - 08-07-2013

(08-05-2013, 09:16 PM)JeremyG Wrote:
Code:
a=[1,2,3,4,5]
print([a[i+1] for i in range(len(a)-1)])

I honestly have no clue. This outputs [2,3,4,5]

It's because the a array is zero indexed. The i value itself starts at zero, but because of this bit here:
a=[1,2,3,4,5]
print([a[i+1] for i in range(len(a)-1)])
it starts the array's index at 1 instead of zero. Lucky that the range comes out to 4, otherwise you might end up trying to access a nonexistent element.


RE: Everyone's worst code! - Chibill - 08-07-2013

I will post my java code from my mod that was derpy.


RE: Everyone's worst code! - VirtualPineapple - 08-09-2013

Then why not post it q_q


RE: Everyone's worst code! - Chibill - 08-09-2013

I will I have to decompile my old old version and hope its not obsfated.