NEWTON
Asked
5 months ago
5
views
0
How do you write the pseudocode:
if x == 1 and y == 1, then return 1.
Else return 0.
ㅤ This question was originally posted on Triality
0
You can also do nested and statements like this as well
func main{output_ptr : felt*}():
let (res) = andFunc()
serialize_word(res)
return ()
end
func andFunc() -> (res : felt):
let x = 1
let y = 1
if x == 1:
if y == 1:
return (1)
end
end
return (0)
end
ㅤ This answer was originally posted on Triality
answered
5 months ago
Cairo: Else if statement
Cairo: Using less than or greater than in conditional
Writing a "not" operation in Cairo
Cairo: How to return true from a function?
Cairo: How do I initialize an array in cairo
How to make conditional expressions if..then..else in Cairo lang?
How do you check if a number is even in Cairo?
How can i learn Cairo with Python base?
why does keccak256 replace sha256 in warp?
Does anyone know how to print a uint256 in protostar tests?
A plan to get better visibility when a transaction got received but not placed into a block?
how to return struct
What's the best advanced StarkNet guide?
An error “AssertionError: Sender must be passed explicitly when making a direct declaration using —no_wallet.” using the new nile?