psychoflea
Programmer
I'm writing a Javascript slotmachine and was have become a bit stuck. I have 3 reels that display 4 images, I want to compare the images and if they match add a value to total amount won, but I am unsure how to do this correctly
function spinem() {
turns1=10+Math.floor((Math.random() * 10))
for (a=0;a<turns1;a++)
{document.slots.slot1.src=slotitem[a % 4]+".gif";}
turns2=10+Math.floor((Math.random() * 10))
for (b=0;b<turns2;b++)
{document.slots.slot2.src=slotitem[b % 4]+".gif"; }";}
function checkmatch() {
if ((document.slots.slot1.src == "1.gif") && (document.slots.slot2.src == "1.gif"))
{document.slots.tokens.value=20+Math.floor{document.slots.tokens.value); }
function spinem() {
turns1=10+Math.floor((Math.random() * 10))
for (a=0;a<turns1;a++)
{document.slots.slot1.src=slotitem[a % 4]+".gif";}
turns2=10+Math.floor((Math.random() * 10))
for (b=0;b<turns2;b++)
{document.slots.slot2.src=slotitem[b % 4]+".gif"; }";}
function checkmatch() {
if ((document.slots.slot1.src == "1.gif") && (document.slots.slot2.src == "1.gif"))
{document.slots.tokens.value=20+Math.floor{document.slots.tokens.value); }