✅ If statement.
Hi, im creating a program that takes users commands and executes them (it draws shapes lol). basically, my 'case: "if", doesnt recognise the comparison expressions. so for example, if user types in.
if 10 == 20,
rectangle 100 150 (this draws a rectangle with specified size)
endif.
because 10 doesnt equal to 20, it should not draw. it is not recognising the ifchecker.
https://hastebin.com/obemigutud.swift
Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
2 Replies
I'll take a look real quick.
Have you debugged and checked if your values actually are what you think they are?
You can remove the entire
else
when parsing your left and right input. You are already using TryParse
in the if, so the parsing and assignment (if it was possible) has already happened.
"not recognising" is a bit vague.
You already print out the values, so what are they in the case you are showing here?Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.