Victory Road Archive

You are viewing an archive of Victory Road.

Victory Road closed on January 8, 2018. Thank you for making us a part of your lives since 2006! Please read this thread for details if you missed it.

Funny/Interesting Stuff → Lazy Programming

Page 1 of 1

1. SpaceMan++ said on September 28, 2008, 07:29:09 PM (-07:00)

Zoroark
288 posts

let's find and make lazy codes:

Code:
import java.*
import lazy.oop.clone.*
class LazyOOP
{
  void main()
  {
    Person clone = new Person(me);
    clone.doWork();
  }
}
Code:
#include <stdlib.h>
#include <stdio.h>
#include "bed.h"

#define i_am_lazy true
int main()
{
  printf("Im going to bed, I'm lazy.");
  goto bed;
  bed:
  bool I_am_sleeping;
  while (i_am_lazy)
  {
	  I_am_sleeping = true;
  }
  return 0; //never wake up
}
Code:
#include <stdlib.h>
#include <stdio.h>
#include "lazy.h"

#define write_code_for_me() (printf("i'm lazy"))
int main()
{
  write_code_for_me();
  return 0;
}

2. Cat333Pokémon said on September 28, 2008, 08:33:52 PM (-07:00)

Administrator
10,307 posts

The shortest of them all (Java, VB):

Code:
while (true){}
Code:
Do
Loop
*May cause infinite loop

Well, you can also have fun with this one (Java, VB):
Code:
public void stacker(){
stacker();}
Code:
Public Sub Stacker()
Call Stacker
End Sub
*May cause stack overflow

3. SpaceMan++ said on September 28, 2008, 08:50:45 PM (-07:00)

Zoroark
288 posts

It's like that:

Code:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package test;

/**
 *
 * @author jirachifan
 */
public class Main {

    /**
     * @param args the command line arguments
     */
	private static int n = 0;
    public static void main(String[] args) {
		String[] a = args;
		System.out.println(n++);
       main(a);
    }

}
I tired it, it looped 3600 times then it stopped

4. Yoshi648 said on September 29, 2008, 02:58:34 PM (-07:00)

Administrator
3,147 posts

Infinite loops are fun

5. AngrytigerP said on September 29, 2008, 05:30:48 PM (-07:00)

Servine
52 posts

On TI-BASIC:

Code:
:Lbl 1
:Clrhome
:Disp "INFINITE LOOP"
:Goto 1

Page 1 of 1

User List - Contact - Privacy Statement - Lycanroc.Net