Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-04-2003, 03:47 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Exclamation Stop The Presses!

I just went to use this, and to my horror, graal returned an error when i hit the test button. Stefan P L E A S E put in a greatest common divisor function into gscript. For those of you who don't know, here are some examples:

gcd(1,500)=1
gcd(12,21)=3
gcd(11,101)=1
gcd(4,16)=4
__________________


Help me keep scripting
Reply With Quote
  #2  
Old 08-04-2003, 04:41 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Why on Earth would we need something like that? You may as well just code your own.
__________________
Reply With Quote
  #3  
Old 08-04-2003, 04:43 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Yeah, I could but it would be a pain to put in an NPC every time I need it.


I need it for recursive scripting.
__________________


Help me keep scripting
Reply With Quote
  #4  
Old 08-04-2003, 05:29 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
I need it for recursive scripting.
Elaborate, please.
__________________
Reply With Quote
  #5  
Old 08-04-2003, 05:48 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
In the case I have in mind, I want to do something by a method of halving, which means I need to work in iterations, and I don't want to overwrite the old steps, so I have configured my for loops such that with a gcd I could do that easily.

Other uses include finding the relative primacy, another way to determine parity, and there are countless recursive formulae which include a gcd.
__________________


Help me keep scripting
Reply With Quote
  #6  
Old 08-04-2003, 05:58 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
*shrugs*

I'll wager there are usually other ways.
__________________
Reply With Quote
  #7  
Old 08-06-2003, 10:59 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
An ugly For loop will do if nothing else.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.