SRL Archive - Other Scripts

Awesome Coin Flipper!


Tazzie 02

2007-12-07 02:48:09

UPDATED TO VERSION 2.5: NOW HAS SMALL ANIMATION IF YOU USE THE SLOW PROCEDURE!

This is pretty much my first script. You may be wondering, 'Why would anyone make a coin flipper?' Well… Here's the story. We're doing probability in maths which involved flipping a coin 200 times. I though, 'Why the hell am I bothering with this :f: ?! I'll make an AUTOMATIC coin flipper! ;)' It turned out that I was missing a few things so i got help from Fr0zN_S0uL mainly. In the end, it turned out pretty good (for a basic first script). So.. here it is. (Down there vv)


Another Coin Flipper that I found after I finished was one by Jacobdm.
http://www.villavu.com/forum/showthread.php?t=15032

IEatJ00erBaybees

2007-12-09 10:49:48

|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 20
Amount of flips done is 20
Tails amount was 10
Heads amount was 10
|——————-|

Woo! I predicted 11-9 Heads. I was close.

Rs-Gp-4U

2007-12-09 13:02:39

Is there a [TUT] for making non rs scripts?
I want to make a coin flipper but with random what coin to use
eg. (im from uk) 1p, 2p, 5p, 10p, 20p, 50p, £1, £2

Tazzie 02

2007-12-10 00:07:06

No sorry.. I didn't use any non-rs script tuts. I only used beginner tuts and read all of what I could. After a while, I found that I could make a coin flipper because of the anti-ban use. It randomly selects. Try to make the script from tuts and do yur best. If it doesn't work and oyu don't know how to fix it, ask someone! Most people are glad to help others.

Rs-Gp-4U

2007-12-10 11:47:24

Thanks ;) Im guna try to make one but then maybe use forms =).

natinsatin1

2007-12-10 18:54:32

Tazzie Coin Flipper
——————-
Flip amount was 100000
Amount of flips done is 100000
Tails amount was 49979
Heads amount was 50021
|——————-|

Tazzie 02

2007-12-10 19:05:52

From: Rs-Gp-4U
Thanks ;) Im guna try to make one but then maybe use forms =).

Cool.. I will try forms in my next update. I did try making a form but I was reading a tutorial that showed forms in RS so it had username and password.. I ended up getting a bit :confused: I will try again though and I will hopefully understand it better.

Rs-Gp-4U

2007-12-12 04:25:18

Gl, im on making dice roller now =).
Keep me informed on your good work :D

Is It Ok If I Use This In My Script;
 .Script Info:
# ScriptName =
# Author =
# Description =
# Version =
# Date =
# Comments =
/Script Info

osmm

2007-12-12 17:52:58

Nice Nice, I could have used this last year and this year in science, but its a little late =P.

Jacobdm0

2007-12-13 16:29:49

Lol, thanks for credit, I assume you got the Idea from my coin flipper?

Didn't look like you took anything from my script, just the Idea.

Nice job.

Tazzie 02

2007-12-13 22:26:55

Thanks for your replies guys.

@Rs-Gp-4U: That bit comes up when you press some sbutton in scar. It comes up when you click SCRIPTS -> SCRIPT PROPERTIES. I have made a dice roller also but I am trying to work out better ways to set it out and get it to run.

@osmm: This is pretty much while a made this script. I got really annoyed at having to flip a coin 200 times in Maths as I mentioned in my original post.

@Jacobdm0: I made mine first then I found yours. I compared both of ours and improved mine more and more :p

Tazzie

ducels

2007-12-14 17:58:52

|-------------------|
Tazzie Coin Flipper
-------------------
Flip amount was 100000
Amount of flips done is 100000
Tails amount was 49995
Heads amount was 50005
|-------------------|

Pretty damn close to exactly 50/50.

Tazzie 02

2007-12-17 03:07:37

Nice.. Thankyou everyone for testing it. Any suggestions for next update other than forms?

Rs-Gp-4U

2007-12-17 13:28:28

Maybe have a picture of a flipping coin?
And have random coin, like 5 cent or w.e you use.

~ Keep me informed!

Tazzie 02

2008-01-02 02:56:39

UPDATED TO VERSION 2.5!

Now has small animation of a coin flipping if you use the slow procedure. The animation isn't much, but I needed some update. Hope you like it :)

Tazzie

Rs-Gp-4U

2008-01-02 14:38:23

Wow, this is like 10X better than last one , well done!
Simple but effictive coin!
Im starting to stick in learning scar nd i think i will have to make a dice roller to beat you :D jk jk. Im still making one *Thumbz Up.. Keep in touch m8.. Please?

jhildy

2008-01-02 20:17:29

you want some help with a form if you are trying to learn add my msn
[email]jhildz737@aim.com[/email]

Tazzie 02

2008-01-02 20:51:29

OK thanks for your replies.

Rs-Gp-4U: I will definatelly keep you in touch and also, good luck on the dice roller. Let me know when its done.

jhildy: I will have one more try at forms. If I have trouble, I will let you know.

Thanks,
Tazzie

Rs-Gp-4U

2008-01-03 04:59:44

I'm just finishing reading nearly all the tuts :D.

Then ill make dice roller i get SCAR so much better now!!!

Btw love the coin xD

—————————————————————————————–

Did you make the sig in the script 'Tazzie' or did you use a other program/website if so please tell me the adress

Tazzie 02

2008-01-03 22:01:44

Thanks. That was the best I could do. I did want to make it more 3D so that you can see a sliver of the top or bottom, but I couldn't get it. I might try again and make it more "coin like" other than like a toothpick spinning around.

I also did make that sig myself. It took quite a while but I got it eventually. I have made one for a friend too. I didn't know there are websites that can do it for you.

Tazzie

gamer 5

2008-01-03 22:05:28

weird!

|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 20
Tails amount was 9
Heads amount was 11
|——————-|

footballjds

2008-01-04 12:41:22

|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 1000000
Tails amount was 498937
Heads amount was 501063
|——————-|

=p…. oh. and you don't use the var "TAILS" or "HEADS" so delete em?

EDIT: i set it to do '10000000' so its still running =p. JAVA is SOOO much faster. it'd do 10000000 almost instantly. =p il post back the results for its when its done

here you be:
[PHP]|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 10000000
Tails amount was 5000355
Heads amount was 4999645
|——————-|
[/PHP]

JAD

2008-01-04 13:03:17


|-------------------|
Tazzie Coin Flipper
-------------------
Flip amount was 1000000
Tails amount was 499912
Heads amount was 500088
|-------------------|

Nice :)

Tazzie 02

2008-01-04 18:59:08

Thanks guys. Anyone have any suggestions about an update of anything?

JAD

2008-01-04 20:17:33

From: Tazzie 02
Thanks guys. Anyone have any suggestions about an update of anything?


Not much to be updated on a coin flipper ;)

But it is awesome!

Maybe make some more animation? That's about all I can think of.

chrsk13

2008-01-04 22:16:34

I really like the animation. The only thing is though, it's almost too perfect.

|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 100000
Tails amount was 49954
Heads amount was 50046
|——————-|

100,000 flips and it was 46 from exactly half and half.

Tazzie 02

2008-01-04 23:39:16

Thanks. No one has got any problems or suggestions yet. Post what you think!

Lalaji

2008-01-05 15:53:03

Love the animation.!

Richard

2008-01-05 17:08:40

Wow, this is a great lil script

I like how imaginative it was. What gave you the idea for it?

btw, this is what mine did after 100 flips:
|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 100
Tails amount was 53
Heads amount was 47
|——————-|

Ultra

2008-01-05 17:13:25

Looks good, but easy script, still nice job starting scripting :).

Tazzie 02

2008-01-05 19:18:49

Thanks again.

dude_richard: At school. Boring math lesson. Made even boringer by making us flip a coin 300 or so times and record what it landed on.

Tazzie

Rs-Gp-4U

2008-01-06 11:40:46

I think i'll make that dice roller later.

- Could you make it so if no "1" comes out it shows a dice with one dot on?

the flea

2008-01-07 12:47:37

From: Rs-Gp-4U
I think i'll make that dice roller later.

- Could you make it so if no "1" comes out it shows a dice with one dot on?


its possible just may take you a while when your making them all :P

_

nice script but it would be nice to have a timer in it since for larger numbers it takes a while would be intresting to see how fast scar can do this

Tazzie 02

2008-01-07 18:37:59

OK. I will try and add a timer.

Rs-Gp-4u: Look in this script that i've made. It has the same basic things needed for a dice roller. In my procedure "WhatWasIt" it records what the flip landed on. You can make a small picture in another procedure by using writeln. In the procedure "WhatWasIt" you just need to add that procedure name into there. Let me know if you have any troubles.

Tazzie

Gu3st...

2008-01-10 08:03:38

lol test this out:

program CoinFlipper;
{ _ _ _ _ ___ _ _ _ _ _ _ _ _ __ _ _ _ _
| | / \ | _ | | _ | | | | _ _ _/
|/| |\| / \ |/ / / |/ / / | | | |_ _ _
| | / /_\ \ / / / / | | | _ _ _|
| | / _ _ _ \ / /_ /| / /_ /|| | | |_ _ _
|_ _|/__/ \__\|_ _ _ _| |_ _ _ _||__| |_ _ _ _\
AUTOMATIC COIN FLIPPER

Feel free to use parts of this although you MUST credit me.
Do NOT post this anywhere without my permission.

.Script Info:
# ScriptName = Tazzie Coin Flipper
# Author = Tazzie 02
# Description = Flips a coin and counts amount of heads and tails
# Version = 2.5, Includes flipping animation!
# Date = 1/1/08 (dd/mm/yy)
# Comments = Thanks for your help Fr0zN_S0uL and people who made suggestions!
/Script Info}

var HeadsNumber, Tails, Heads, TailsNumber : Integer;
FlipCount: extended;

const
FlipAmount = 200000000.0;
UseFastProcedure = False; //True for near instant results
TimeBetweenFlips = 200; //If False above ^^ set the amount of miliseconds between flips
//A small amount of time will be added ^^
function Flip : integer;
begin
case Random(2) of
0: Result := 0;
1: Result := 1;
end;
FlipCount := FlipCount+(0.01);
end;

procedure WhatWasIt;
begin
if Flip = 0 then
TailsNumber := TailsNumber+(1)
else
HeadsNumber := Headsnumber+(1);
end;

procedure FlipAnimation1;
begin
writeln(' FLIPS DONE');
writeln(' ');
writeln(' ');
writeln(' ______________ ');
writeln(' |______________| ');
writeln(' ');
writeln(' ');
writeln('TAILS AMOUNT IS '+IntToStr(TailsNumber));
writeln('HEADS AMOUNT IS '+IntToStr(HeadsNumber));
end;

procedure FlipAnimation2;
begin
writeln(' FLIPS DONE');
writeln(' |\');
writeln(' \ \');
writeln(' \ \');
writeln(' \ \');
writeln(' \ \');
writeln(' \/');
writeln('TAILS AMOUNT IS '+IntToStr(TailsNumber));
writeln('HEADS AMOUNT IS '+IntToStr(HeadsNumber));
end;

procedure FlipAnimation3;
begin
writeln(' FLIPS DONE');
writeln(' _ ');
writeln(' | |');
writeln(' | |');
writeln(' | |');
writeln(' | |');
writeln(' | |');
writeln(' |_|');
writeln('TAILS AMOUNT IS '+IntToStr(TailsNumber));
writeln('HEADS AMOUNT IS '+IntToStr(HeadsNumber));
end;

procedure FlipAnimation4;
begin
writeln(' FLIPS DONE');
writeln(' /|');
writeln(' / /');
writeln(' / /');
writeln(' / /');
writeln(' / /');
writeln(' |/');
writeln('TAILS AMOUNT IS '+IntToStr(TailsNumber));
writeln('HEADS AMOUNT IS '+IntToStr(HeadsNumber));
end;

procedure Animation;
begin
ClearDebug;
FlipAnimation1;
Wait(100);
ClearDebug;
FlipAnimation2;
Wait(100);
ClearDebug;
FlipAnimation3;
Wait(100);
ClearDebug;
FlipAnimation4;
Wait(100);
ClearDebug;
FlipAnimation1;
end;

Procedure Proggy;
begin
Writeln('|-------------------|');
Writeln(' Tazzie Coin Flipper');
Writeln(' -------------------');
Writeln(' Tails amount was ' +IntToStr(TailsNumber));
Writeln(' Heads amount was ' +IntToStr(HeadsNumber));
Writeln('|-------------------|');
Writeln(' ');
end;

begin
if UseFastProcedure = False then
repeat
Animation;
Wait(TimeBetweenFlips);
WhatWasIt;
until FlipCount=(FlipAmount)
else
repeat
WhatWasIt;
until FlipCount=(FlipAmount);
Proggy;
end.

EDIT: Now this was close!
|-------------------|
Tazzie Coin Flipper
-------------------
Flip amount was 10000
Tails amount was 5001
Heads amount was 4999
|-------------------|

red eyes 20

2008-01-14 19:29:36

haha that was awesome man =p
i got 11/9. worked perfectly.

Tazzie 02

2008-01-31 00:33:47

OK, I'm back from holiday. Still post any small updates because there isn't muchto do with a coin flipper. I will attemt forms and add time running.

Tazzie

Dynamite

2008-01-31 17:22:15

here a proggy:

4070/10000 FLIPS DONE
| |
| |
| |
| |
| |
|_|
TAILS AMOUNT IS 1981
HEADS AMOUNT IS 2089

just left it to run while i update my forum

T ~ M

coo too

2008-02-03 12:08:51

worked well

19/20 FLIPS DONE


______________
|______________|


TAILS AMOUNT IS 11
HEADS AMOUNT IS 8
|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 20
Tails amount was 11
Heads amount was 9
|——————-|

Tazzie 02

2008-02-27 00:29:23

Yeah, it looks neater if you use a normal sized window. That's what I designed it on.

jakeyboy29

2008-06-05 12:06:40

nice 1 mate lol

jakeyboy29

2008-06-05 12:19:45

1224/1316134911 Flips Done


______________
|______________|


Tails Amount Is 633
Heads Amount Is 591

Laur€ns

2008-07-04 06:31:00

^^^^
Double post
^^^^

W/E, I beat you :)

Put off the coin-animation:

Tazzie Coin Flipper
——————-
Flip amount was 100000000
Amount of flips done is 498210
Tails amount was 248776
Heads amount was 249434

insanomano

2008-07-23 18:43:52

haha this is great im gonna post a proggy for you, you have inspired me to make a dice roller because I am quite bored atm !!!! :D

EDIT: k heres the proggy and it worked pretty well lol, this wouldve been useful in like gr 8 math lol.

|——————-|
Tazzie Coin Flipper
——————-
Flip amount was 200
Tails amount was 106
Heads amount was 94
|——————-|

pure pk l t

2008-07-24 10:35:58

Flip amount was 99999
Tails amount was 49972
Heads amount was 50027