0 Members and 1 Guest are viewing this topic.
procedure AppOnIdle(Ticks: integer);begin WriteConsole(0,inttostr(random(1,2)),$EE81FAA1);end;
procedure AppOnIdle(Ticks: integer);begin WriteConsole(0,inttostr(random(1,3)),$EE81FAA1);end;
its maximum exclusive I guess. just add 1 to whatever you want it to be and you'llbe fine.
Imho script language have to has clear documentation and every thing have to be done right
Learn pascal then?
function rnd( min, max: integer ): integer;begin result := random( min, max+1 );end;
The Random command will give you a random number from 0 to the number you give it - 1. The Random command generates the same random numbers every time you run a program so the Randomize command is used to make them more random by using the system clock.
Quote from: Neosano on July 24, 2008, 04:54:54 amLearn pascal then?god damn you? Learn pascal yourself... I was writing in pascal for 5 years(now im writing mostly in C++, im using pascal now in soldat scripting and writing my own game in Delphi), and there was a random() function only with one parameter. It is: random(range:integer) and it returns numbers from 0 to range-1But probably EnEsCe overloaded that random with his own one, and probably as chutem said he made an error. Idk that rly why he changed that, old random was quiet good.
2Lewymatihttp://www.learn-programming.za.net/programming_pascal_learn04.htmlScroll down - EXTRAS:QuoteThe Random command will give you a random number from 0 to the number you give it - 1. The Random command generates the same random numbers every time you run a program so the Randomize command is used to make them more random by using the system clock.
Code: [Select]function rnd( min, max: integer ): integer;begin result := random( min, max+1 );end;Use that. Problem solved. If they ever change the random command, you just change the routine and everything is changed appropriately.