Author Topic: if _ then _  (Read 3789 times)

If Riddler did nothing wrong, then, Riddler did nothing wrong mtn dew flavour is made.

if john cena then malinov

if you smoke weed then you are high
if you kill someone then you are a murderer
if you are a human thenyou are a mammal

if this is an if then statement, then it is a hypothesis (according to my sophomore bio teacher)

if this statement is true, then it is false

If you are a guy who points everything out all the time, then you are Captain Obvious

if brb i gotta take a piss guys i'll be right back ok then ok guys i'm back from the piss

Lua time!

Code: [Select]
function CheckIfRiddlerIsAlive()

local RiddlerIsAlive = (math.random(0, 1) == 1 and true or false)

if RiddlerIsAlive then
return "o no!"
else
return "o good."
end
end

math.randomseed(12321)
print(CheckIfRiddlerIsAlive())
math.randomseed(5131)
print(CheckIfRiddlerIsAlive())

> o good.
> o no!

Oh hey, someone else tried to do Lua.
Code: [Select]
if i=10e-9 then
     print('Hello world!')
end
Outputs...
Error in script: 'then' expected near '='
So close! Try again.
« Last Edit: October 24, 2015, 07:41:43 AM by Klocko¹ »

If this is a statement, then it is false.

If I use the blockland forums, then I have autism.

if someone writes bad code then whine
Lua time!
Code: [Select]
math.random(0, 1) == 1 and true or false
what is "and true or false" for
because "true or false" will always evaluate to true. so the "or false" is garbage bulk by default
then... "and true" is also garbage bulk, because either way it will have exactly the same output as "math.random(0,1) == 1"
it will not change it one bit
why did you add it?

also why did you change the seed? it won't have any effect, either

edit: I was going to try to rewrite it better, but I seem to be having trouble with lua
so here it is in python

from random import randint

def Riddler_is_alive():
    return randint(0, 1) == 1

if Riddler_is_alive():
    print('Oh no!')
else:
    print('Yay!')
« Last Edit: October 24, 2015, 11:37:59 AM by Foxscotch »

if MoltenKitten posts, then people will complain

if you hate men, then you are a femenist
if you like any fandom(s), then you are gay

If 1=0, then all of my life is a lie.

Code: [Select]
function hedidnothingwrong()
local nothingwrong = math.random(0,1)

if nothingwrong == 1 then
print("he just had the wrong people")
else
print("he did something wrong")
end
end



while wait(.5) do
hedidnothingwrong()
end
--I'm not all that bad am I?