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-09-2013

InvisibleGrammaNazi Wrote:
(08-09-2013, 08:34 PM)Chibill Wrote: I will I have to decompile my old old version and hope its not obsfated.<<Obsufacated.



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

SpellingNazi Wrote:
InvisibleGrammaNazi Wrote:
(08-09-2013, 08:34 PM)Chibill Wrote: I will I have to decompile my old old version and hope its not obsfated.<<Obsufacated.
**Obfuscated

Grammar Nazi's should NEVER try to correct spelling.

OT: I would post something of mine here, but I'm not really sure what of mine would be considered bad. I mean sure, I've got old programs that could have been written better, but I wrote them with what I knew at the time.


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

Code:
        try {
            URL url = new URL("https://raw.github.com/chibill/AdditionalCrafting/master/Version_Control/1.5.txt");


            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            int str;
            int str1;
            int str2;
            int str3;




              str = in.read();
              str1 = in.read();
              str2 = in.read();
              str1 = in.read();
              str3 = in.read();
              System.out.println(in);
              System.out.println(str);
              if(in != null){
                  No_Internet = false;
              if(str == 49 && str2 == 48 && str3 == 48){
                  Up_to_Date = true;
                System.out.println("[AdditionalCrafting] Additional Crafting up to date!");
              }else
              {
                System.out.println("[AdditionalCrafting] Additional Crafting is out of date for this verison of Minecraft!");
              }
              }
           in.close();
      } catch (MalformedURLException e) {
          } catch (IOException e) {
              No_Internet = true;
              System.out.println("[AdditionalCrafting] Additional Crafting has no internet conection!");
          }



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

No one cares about my worst code. :-C


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

(08-07-2013, 12:43 AM)Thor23 Wrote:
(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.

I mean I know why it does that, I just don't know why I have that code


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

Why has xeo not come a rages about my worest java code I have?


RE: Everyone's worst code! - Neogreenyew - 09-05-2013

Step aside noobs. Let me tell you about Apocalyptic Minefield. Let the pro at bad coding step forward and teach you all a few things.

https://docs.google.com/file/d/0B1Iapcb8FjwcR0hWLXFGZUJOeTg/edit?usp=sharing

It's a GDocs zipped file with a single .exe in it.

This is my first ever coding project that I made back in high school. Not only does it not work for shit, but every single action loads a different form. At the time, I had no idea how to code or use arrays, so it's pretty brutal.
I'd also like to point out that the minefield part is incredibly horrible. There are red squares with one blue one mixed in. Click on a red and you lose, click on blue and you win.


Oh and one last thing...

GET ON MY LEVEL, NOOBS


RE: Everyone's worst code! - EDevil - 09-05-2013

Hoeraay For self expression @Neo. And, i don't program (Yet), So im one of the few peeps who doesn't have bad code. Ha!


RE: Everyone's worst code! - Iceglade - 09-15-2013

This topic cannot die!

... i tried to code an mcedit filter
Code:
#Generate redstone wiring
                    level.setBlockAt(pos[0], pos[1], pos[2], 137)
                    level.setBlockAt(pos[0], pos[1] + 1, pos[2], 55)
                    level.setBlockAt(pos[0], pos[1] - 1, pos[2] - 1, wirBlk.ID)
                    level.setBlockDataAt(pos[0], pos[1] - 1, pos[2] - 1, wirBlk.blockData)
                    level.setBlockAt(pos[0], pos[1], pos[2] - 1, 149)
                    level.setBlockAt(pos[0], pos[1], pos[2] - 2, wirBlk.ID)
                    level.setBlockDataAt(pos[0], pos[1], pos[2] - 2, wirBlk.blockData)
                    level.setBlockAt(pos[0], pos[1] + 1, pos[2] - 2, 75)
                    level.setBlockAt(pos[0], pos[1] + 2, pos[2] - 2, wirBlk.ID)
                    level.setBlockDataAt(pos[0], pos[1] + 2, pos[2] - 2, wirBlk.blockData)
                    level.setBlockAt(pos[0], pos[1] + 3, pos[2] - 2, 55)



RE: Everyone's worst code! - Xeomorpher - 09-15-2013

list(str(list(X)))

Yeaaaa