C
C#4mo ago
HouseAdmin

✅ What syntax for c#?

What is the syntax for this code? in c#
c#
return (
a.minX <= b.maxX &&
a.maxX >= b.minX &&
a.minY <= b.maxY &&
a.maxY >= b.minY &&
a.minZ <= b.maxZ &&
a.maxZ >= b.minZ
);
c#
return (
a.minX <= b.maxX &&
a.maxX >= b.minX &&
a.minY <= b.maxY &&
a.maxY >= b.minY &&
a.minZ <= b.maxZ &&
a.maxZ >= b.minZ
);
25 Replies
leowest
leowest4mo ago
would be nice if u quote what language is that from?
HouseAdmin
HouseAdmin4mo ago
java script
leowest
leowest4mo ago
I would like to say that is just a bool with extra parenthesis
HouseAdmin
HouseAdmin4mo ago
yes ik wait is that the same syntax for c#?
leowest
leowest4mo ago
so its the same in c# except u dont need the parenthesis
HouseAdmin
HouseAdmin4mo ago
() this?
leowest
leowest4mo ago
yeah I dont think u need those in javascript either
HouseAdmin
HouseAdmin4mo ago
return
a.minX <= b.maxX &&
a.maxX >= b.minX &&
a.minY <= b.maxY &&
a.maxY >= b.minY &&
a.minZ <= b.maxZ &&
a.maxZ >= b.minZ;
return
a.minX <= b.maxX &&
a.maxX >= b.minX &&
a.minY <= b.maxY &&
a.maxY >= b.minY &&
a.minZ <= b.maxZ &&
a.maxZ >= b.minZ;
so this would work
leowest
leowest4mo ago
should yes
HouseAdmin
HouseAdmin4mo ago
neat this &&, stands for "and" right
Grimson
Grimson4mo ago
yes
MODiX
MODiX4mo ago
leowest
REPL Result: Success
var a = 10;
var b = 11;
var c = 20;
var d = 40;

return a <= b && c <=d;
var a = 10;
var b = 11;
var c = 20;
var d = 40;

return a <= b && c <=d;
Result: bool
True
True
Quoted by
<@1102729783969861782> from #bot-spam (click here)
Compile: 265.147ms | Execution: 24.516ms | React with ❌ to remove this embed.
leowest
leowest4mo ago
yes && and || or
HouseAdmin
HouseAdmin4mo ago
sucks i cant use words for the && wait i have an idea
Grimson
Grimson4mo ago
Can you do that in JS?
HouseAdmin
HouseAdmin4mo ago
i can in c++ would this work in c#?
c#
public string and = &&;
c#
public string and = &&;
Grimson
Grimson4mo ago
not really
HouseAdmin
HouseAdmin4mo ago
was worth a try haha
Grimson
Grimson4mo ago
You can't really alias &&
HouseAdmin
HouseAdmin4mo ago
alright thanks be to GOD random person bye
Grimson
Grimson4mo ago
gl
leowest
leowest4mo ago
with pattern matching u can use and is etc but its different then the above
MODiX
MODiX4mo ago
If you have no further questions, please use /close to mark the forum thread as answered
HouseAdmin
HouseAdmin4mo ago
Thanks be to GOD brotha Oh yeah i remember thid This*, i used it to check if something is null
Want results from more Discord servers?
Add your server