SRL Archive - Other Scripts

Chance script


Awkwardsaw

2009-05-22 02:46:04

i made this out of sheer boredom :p

program Chance;

var
h, t, rolled, fliped : integer;
number1, number2, number3, number4, number5, number6 : integer;

const
tries = 10; //how many times would you like to give your shot at chance?
option = 'dice';
{valid options:
dice
coin }

procedure flip;
begin
case random(2) of
0: inc(h);
1: inc(t);
end;
inc(fliped);
wait(1);
end;

procedure coincheck;
begin
while fliped < tries do flip;
writeln('out of ' + inttostr(tries) + ' flips');
writeln(inttostr(h) + ' have been heads');
writeln('and ' + inttostr(t) + ' have been tails');
writeln(' ');
writeln(' ');
end;

function coin : boolean;
begin
if option = 'coin' then
begin
coincheck;
result := true;
end;
end;

procedure roll;
begin
case random(6) of
0: inc(number1);
1: inc(number2);
2: inc(number3);
3: inc(number4);
4: inc(number5);
5: inc(number6);
end;
inc(rolled);
wait(1);
end;

procedure dicecheck;
begin
while rolled < tries do roll;
writeln('out of ' + inttostr(tries) + ' tries');
writeln('you rolled the number 1 ' + inttostr(number1) + ' times');
writeln('you rolled the number 2 ' + inttostr(number2) + ' times');
writeln('you rolled the number 3 ' + inttostr(number3) + ' times');
writeln('you rolled the number 4 ' + inttostr(number4) + ' times');
writeln('you rolled the number 5 ' + inttostr(number5) + ' times');
writeln('you rolled the number 6 ' + inttostr(number6) + ' times');
writeln(' ');
end;

function dice : boolean;
begin
if option = 'dice' then
begin
dicecheck;
result := true;
end;
end;


procedure play;
begin
coin;
dice;
end;

begin
cleardebug;
play;
end.

instructions:
put in how many times you want to roll the dice/ flip the coin
select if you want to roll the dice or flip the coin :p

maybe if i'm really bored later i'll add more to it, like forms and mathematical stuff

mrpickle

2009-05-22 06:34:47

comon… THAT bored? I find being as bored… as bored as you say, is quite hard for me. I just get games (usually not from a store xD) if that ever happens to me… or read SRL tuts =D.

Awkwardsaw

2009-05-22 07:38:15

haha, when im bored i make random scar/ srl stuff, and stop when im not so bored or i think of something to do.

i actually finished this(unlike every other script i try to make :P) and thought it was fun, and said why not post this and get feed back

[Ethan]

2009-05-22 23:21:46

nice. seems like something id be doing though. not you :P

Awkwardsaw

2009-05-22 23:31:23

From: [Ethan]
nice. seems like something id be doing though. not you :P


like i said ethan, i was uber bored :P

and yes, you will be doing something like this later on;)

astondb8

2012-12-18 06:41:50

I have seen about 3 FC's with a bot that randomly rolls a number on a 100 sided dice and it only activates when a rank/person types !Roll in the fc. The bot then says
(Username) Rolled A {number} on a 100 side dice
Now if someone could recreate that bot then i would be so happy!

According to other scripters it would be simple code.