What is wrong?
I'm not getting an error, just a blank console.
Code: Select all
function love.main()
while total < 100 do
while rand[1] == rand[2]
do
rand[1] = math.random(60)
rand[2] = math.random(60)
rand[3] = math.random(60)
rand[4] = math.random(60)
rand[5] = math.random(60)
rand[6] = math.random(60)
rand[7] = math.random(60)
end
if Deck[rand[1]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if Deck[rand[2]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if Deck[rand[3]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if Deck[rand[4]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if Deck[rand[5]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if Deck[rand[6]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if Deck[rand[7]] == 'A' or 'B' or 'C' or 'D' then
points = points + 1
end
if points > 2 then
for x = 1, 7, 1 do
hand[x] = Deck[rand[x]]
end
for a = 1, 7, 1 do
if hand[a] == 'A' then
thereisana = true
end
if hand[a] == 'B' then
thereisab = true
end
if hand[a] == 'C' then
thereisac = true
end
if hand[a] == 'D' then
thereisad = true
end
end
if (thereisana and thereisab and thereisac) or (thereisad and thereisab and thereisac) or (thereisana and thereisad and thereisac) or (thereisana and thereisab and thereisad) then
wins = wins + 1
else
fail = fail + 1
end
end
total = total + 1
rand[1] = 0
rand[2] = 0
rand[3] = 0
rand[4] = 0
rand[5] = 0
rand[6] = 0
rand[7] = 0
thereisana = false
thereisab = false
thereisac = false
thereisad = false
a = 0
x = 0
points = 0
print(wins)
print(total)
print(wins/total*100)
print(hand[1])
print(rand[1])
end
end
function love.load()
math.randomseed(os.time())
math.random()
math.random()
math.random()
thereisana = false
thereisab = false
thereisac = false
thereisad = false
points = 0
rand = {}
rand[1] = 0
rand[2] = 0
rand[3] = 0
rand[4] = 0
rand[5] = 0
rand[6] = 0
rand[7] = 0
wins = 0
fail = 0
total = 0
hand = {}
Deck = {}
Deck[20] = 'A'
Deck[40] = 'A'
Deck[60] = 'A'
Deck[9] = 'B'
Deck[17] = 'B'
Deck[25] = 'B'
Deck[33] = 'B'
Deck[39] = 'B'
Deck[49] = 'B'
Deck[56] = 'B'
Deck[11] = 'C'
Deck[23] = 'C'
Deck[35] = 'C'
Deck[47] = 'C'
Deck[59] = 'C'
Deck[5] = 'D'
Deck[12] = 'D'
Deck[19] = 'D'
Deck[26] = 'D'
Deck[34] = 'D'
Deck[39] = 'D'
Deck[48] = 'D'
Deck[55] = 'D'
end
function love.draw()
end