Important News

We have released Shinobi Life Online Pre-Alpha Version! This update features Earth Release: Earth Dome Jutsu, Aiming Mode and more! Try it out and tell us what you think.


Welcome, Guest.
Please login or register.
Forgot your password?



Total Members: 54131
Latest: Izana
New This Month: 31
New This Week: 1
New Today: 1
Total Posts: 55997
Total Topics: 3365
Most Online Today: 412
Most Online Ever: 4232
(January 14, 2020, 07:47:33)
Users Online
Members: 1
Guests: 304
Total: 309
Google (4)

Author Topic: Recursion Program.  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

Offline Kakashi Natsu

  • Chunin Poster
  • ***
  • Posts: 141
  • Reputation Power: 2
  • Kakashi Natsu has no influence.
  • Gender: Male
  • Give up trying to make me give up.
    • View Profile
  • Clan: Agni
Recursion Program.
« on: March 25, 2017, 02:56:41 »
So a friend asked me to help him with a program using Java. SO being a good friend, i did. Unknowingly i got myself into a heap of trouble... getting into recursion. Now for some of you, you may not know what recursion is in programming. Well here is an example of a factorial.
Code: [Select]

//will return an integer
number = 0;

Integer factorial(integer n){
return number
number = n*factorial(n-1)

//lets call up this routine
//this is 6 btw.

[/size]So This is a simple version of a recursive program, where in the program itself, it calls itself up. Confusing but very helpful when it comes to path finding. For those that have a JDK and can run Java. To see the program i helped my friend with, click on the zip folder-> and run it in netbeans or eclipse. Main program is in

Offline ThatsHawt

  • Academy Student Poster
  • *
  • Posts: 1
  • Reputation Power: 2
  • ThatsHawt has no influence.
  • Gender: Male
  • I'm new around here.
    • View Profile
Re: Recursion Program.
« Reply #1 on: October 01, 2017, 06:22:40 »
in your factorial method, you should return an int instead of an Integer.
Every time you run this method it creates an Integer object which is a waste of space when you can just return an int.
  • Character Name: Hawt


Recent Topics

Limit to Looking up and down bug by ElsieJames
January 25, 2023, 12:48:38

How to Reinstall AOL Desktop Gold for Windows and Mac? by desktopgoldhelpline
January 11, 2023, 10:07:34

OC by caleboftheleafvillage
November 30, 2022, 13:31:47

Shinobi Life Online Pre-Alpha Version by SamuelEpperly
November 17, 2022, 15:48:01

Crashed when I log in by Jamezoar
November 17, 2022, 12:37:45

Uzumaki Clan by Jamezoar
November 17, 2022, 12:36:35

My Computer Freezes While Playing 'Shinobi Life Online' by Jamezoar
March 13, 2022, 17:04:23

The Lie That Never Lived: Shionbi Life Online by Ken
October 26, 2021, 00:28:55

I suggest we can do genjutsus by NinjaMirage
September 28, 2021, 13:01:13

Hug,slap,kiss or kill - Fourm game. by MarkKlaus3
September 17, 2021, 12:59:31

Top Posters

Posts: 2648
Posts: 2246
Posts: 1610
Posts: 1298
Posts: 1271
Posts: 1173
Posts: 1152
Posts: 1099
Posts: 1098
Posts: 1060