what is going on with the vexcode translation of printing to the brain screen in block code??? I know my way around python pretty well, but I’ve never seen this before.
brain.screen.print(intake.temperature(PERCENT), precision=6 if vexcode_brain_precision is None else vexcode_brain_precision)
I’m trying to make a brain simulator, and I’m almost done, but this is one of the last things that I am struggling with. My function right now looks like this, but its only taking the precision=6
part, and not the if statement.
def print(self, *text, sep=" ", precision=2):
printme = ''
for arg in text:
if (type(arg) is float) or (type(arg) is int):
printme += str(f"{arg:.{precision}f}")
else:
printme += arg
printme += sep
printme = printme.rstrip(sep)
How do i have my code accept this, or can I take a peek into how the vex brain does it?