aspose file tools*
The moose likes Programming Diversions and the fly likes not using any loops Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "not using any loops" Watch "not using any loops" New topic
Author

not using any loops

Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
I don't know whether I should ask this question here or in some other forum. One day me and my friend were thinking as to whether there is any way we can have the loop effect(doing things continously till a point) without using loops. One solution we came up with was the use of goto but that's not won't do the trick incase of java. Other solution that we thought was using recursive methods. I wonder is there any other way to achieve the same result. The method need not be efficent. But no importing of any classes is allowed except those implictly imported. Or would importing classes really make any difference if the imported classes also don't use loops for doing things repeatedly. The use of native methods is also not allowed. I guess that may also work. I am not sure about it never used them fully. Please do also comment whether importing classes make any difference and using native methods.
[ June 27, 2003: Message edited by: Anupam Sinha ]
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
You mean something like this?


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
Thnaks Michael for the link. Yes this is what I actually wanted.
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
With lambda calculus you can do anything a Turing machine can even though there's no concept of a loop. Unfortunately it can cause your brain to hurt at times. I'm not sure what it would take to simulate lambda calculus in Java (perhaps just some really clever use of anonymous inner classes?).
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Here's a perverse little class that will do the HelloWorld100 deal. I'm not sure if anyone posted something similar.
NoLoopLooper.java

HelloWorld100.java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not using any loops