Anyone have any scripts for stargazing?

Tirian

Member
I think this might work. I'd be happy to fix it if it doesn't work, but I'm not quite into adventure sinks today. :)

edit: just updated it, as it struck me that the first "random" number generated was between 0 and 99, and the altitude only goes up to 89.
 

Attachments

  • stargaze.ash
    1.2 KB · Views: 92

Veracity

Developer
Staff member
Just for giggles, I whipped up a build-in random() function for ASH. It takes an integer as argument (the range, which must be 2 or greater) and returns an integer from 0 to range-1.

Code:
int x = 0;
while ( x != 11 )
{
    x = random( 17 );
    print( x );
}
yields:
>random.ash
4
6
5
0
6
9
12
8
7
3
8
11
Script succeeded!
I make no claims for the quality of Java's built-in random number generator.
And this function won't be available until the next daily build.
 

Kunundrum

New member
No closing '"' found at line 8 in file C:\Documents and Settings\Lethal\Desktop\stargaze.ash. Debug log printed.
 
[quote author=Kunundrum link=topic=172.msg929#msg929 date=1148975968]
No closing '"' found at line 8 in file C:\Documents and Settings\Lethal\Desktop\stargaze.ash. Debug log printed.
[/quote]
Not my script, but here is the same script with the typo fixed.
 

Attachments

  • stargaze.ash
    1.3 KB · Views: 61
Top