C
C#5mo 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
leowest5mo ago
would be nice if u quote what language is that from?
HouseAdmin
HouseAdminOP5mo ago
java script
leowest
leowest5mo ago
I would like to say that is just a bool with extra parenthesis
HouseAdmin
HouseAdminOP5mo ago
yes ik wait is that the same syntax for c#?
leowest
leowest5mo ago
so its the same in c# except u dont need the parenthesis
HouseAdmin
HouseAdminOP5mo ago
() this?
leowest
leowest5mo ago
yeah I dont think u need those in javascript either
HouseAdmin
HouseAdminOP5mo 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
leowest5mo ago
should yes
HouseAdmin
HouseAdminOP5mo ago
neat this &&, stands for "and" right
Grimson
Grimson5mo ago
yes
MODiX
MODiX5mo 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
leowest5mo ago
yes && and || or
HouseAdmin
HouseAdminOP5mo ago
sucks i cant use words for the && wait i have an idea
Grimson
Grimson5mo ago
Can you do that in JS?
HouseAdmin
HouseAdminOP5mo ago
i can in c++ would this work in c#?
c#
public string and = &&;
c#
public string and = &&;
Grimson
Grimson5mo ago
not really
HouseAdmin
HouseAdminOP5mo ago
was worth a try haha
Grimson
Grimson5mo ago
You can't really alias &&
HouseAdmin
HouseAdminOP5mo ago
alright thanks be to GOD random person bye
Grimson
Grimson5mo ago
gl
leowest
leowest5mo ago
with pattern matching u can use and is etc but its different then the above
MODiX
MODiX5mo ago
If you have no further questions, please use /close to mark the forum thread as answered
HouseAdmin
HouseAdminOP5mo 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