Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Xiija
Beginner


Joined: 24 Apr 2018
Posts: 10

PostPosted: Tue Apr 24, 2018 3:52 am   

logical not syntax
 
cast bloodsong
{@bsong = !(@bsong)}
#echo Bloodsong: @bsong

also tried
@bsong = !(@bsong)
@bsong = !@bsong

none of these work,
can i use a not operator in zmud?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Tue Apr 24, 2018 5:20 am   
 
The issue is with your parenthesis I believe

#IF (@bsong = !@bsong) {#echo Bloodsong: @bsong}

Of course, a given variable will always be equal to itself.
_________________
Discord: Shalimarwildcat
Reply with quote
Xiija
Beginner


Joined: 24 Apr 2018
Posts: 10

PostPosted: Tue Apr 24, 2018 5:40 am   .
 
( tried your idea, didn't work :( ... )
was just trying to do a basic math thing like in most programming languages...

var a = 0
a = !a
( now a is equal to 1 )
a = !a
( now a is equal to 0 again )
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Apr 25, 2018 2:55 pm   
 
Ah, silly me.
We are notting the variable instead of the equal sign.

#IF (@bsong!=@bsong) {will never be true}
_________________
Discord: Shalimarwildcat
Reply with quote
Xiija
Beginner


Joined: 24 Apr 2018
Posts: 10

PostPosted: Wed Apr 25, 2018 6:31 pm   
 
tried that, no go :(
i guess it's not possible in zmud?

i just did this...

#IF (@bsong = 1) {@bsong = 0} {@bsong = 1}
#ECHO Bloodsong: @bsong
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Apr 25, 2018 7:04 pm   
 
you define it as:
bsong=0
bsong=1
you only use the @ symbol when you want to reference the current value of bsong
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Apr 25, 2018 7:11 pm   
 
further testing shows that (!0) and (!1) do return the boolean reciprocals as well

#IF (!@bsong) {bsong=0} {bsong=1}
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net