Hi guys, I’ve been trying to make a language based on Python called Pulse (please tell me if this name is taken). I’ve done a number of commands but I’m stuck at the
if statement, I just can’t get it to work.
If you guys want to collaborate with me, privately message me.
What do you expect as the parameters to you functions? Are they callable, if so, you’ll need to actually call them with
Soo… what do you suggest I do?
I tried it and it would ignore the condition, it would go on to the code that would run.
Please give some context as to how you are trying to use this function and what it is supposed to do. At the moment it appears to do nothing.
It is supposed to run an if statement.
conif is the condition for the if statement
runif is the code that will be run if the condition is met
coneif is like conif, but for elif
runelif is like conif, but for elif
runelse islike runif, but for else
The second version is an altered version of the first.
so is the code passed in lambdas? Please show an example your function being used.
@NateDhaliwal I know this is off topic but how will you release the project later, will it have the
Pulse.py for everyone to see or not? Will it be a template? I would like to know for possible future reference.
I will be changing a few things. I’m still sorting that bit.
If you want @SalladShooter , you can collab with me.
@NateDhaliwal sure, invite me to the Repl and I’ll help out.
I have invited you already.
Hmm… it was not very clear. I would only like to know, can my code work?
@NateDhaliwal open the chat in the Repl I’ll talk to you there.
@NateDhaliwal was my solution the solution to the problem (inviting me and helping you) the full solution, or do you need more help?
@NateDhaliwal I got it working. When you are using the function in front of the code you want to run if the conditions are correct you’ll put
ifconelse(x == 5, lambda: display("It is 5"), x == 7,lambda: display("It is 7"), lambda: display("It is not 5 or 7"))
This is the updated code in pulse:
if conif == True:
elif conelif == True:
Edit: I also made the colors better using a dictionary (you now use all caps color names and quotes, ex: ‘BLUE’ or “BLUE”)
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.