Chaosforge Forum

  • August 13, 2020, 03:02
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Feel the Power of Random!  (Read 1359 times)

Shoop da Whoop

  • First Sergeant
  • *
  • Offline Offline
  • Posts: 126
  • Personal Text
    • View Profile
Feel the Power of Random!
« on: January 02, 2010, 16:09 »

Just run this:

Code: [Select]
program mtrx;
uses CRT;
var x, y: shortint;

procedure thr_x;
begin
  x:=trunc(Random*79.79);
end;

procedure thr_y;
begin
  y:=trunc(Random*25.25);
end;

procedure rnbw;
begin
  TextColor(trunc(Random*15.15));
end;

BEGIN
  ClrScr;
  Randomize;
  x:=1;
  y:=1;
  repeat
    thr_x;
    thr_y;
    rnbw;
    gotoxy(x, y);
    write(round(Random*10))
  until KeyPressed;
END.

in Pascal compiler.
Logged
Code: [Select]
He had posted some posts.
He waited enough for new version of DoomRL.
He played classic Doom but not passed. He also played rogulikes. And once he found the intersection of these sets...

ZZ

  • AliensRL Beta Tester
  • Lieutenant Colonel
  • *
  • Offline Offline
  • Posts: 469
    • View Profile
Re: Feel the Power of Random!
« Reply #1 on: January 08, 2010, 05:43 »

Feel the stronger and easier power:
uses crt;
begin
 repeat
  gotoxy(random(80)+1,random(24)+1);
  textcolor(random(31));
  textbackground(random(8));
  write(chr(random(256-7)+8));
 until keypressed
end.

In Pascal Compiler too, run in fullscreen, it's better in it.
« Last Edit: January 08, 2010, 05:51 by ZZ »
Logged
Put a chainsaw in my coffin. If I go to Hell, I'll need to do some cleaning there.

Shoop da Whoop

  • First Sergeant
  • *
  • Offline Offline
  • Posts: 126
  • Personal Text
    • View Profile
Re: Feel the Power of Random!
« Reply #2 on: January 09, 2010, 08:31 »

Th Matrix has us!
Logged
Code: [Select]
He had posted some posts.
He waited enough for new version of DoomRL.
He played classic Doom but not passed. He also played rogulikes. And once he found the intersection of these sets...
Pages: [1]