1 страниц (8 вхождений)
Compacting syntax? - Сообщения
#1 Опубликовано: 10.07.2018 18:59:22
I have an include file with a bunch of functions and variable definitions in it. Within one of my functions is a 'cases' and a bunch of if/thens that makes it REALLY long.
Are better ways to script or format the syntax for something like this? The sheer vertical size of this trips me up sometimes and I need to get my bearigns to navigate it.
Thanks
Dennis

Are better ways to script or format the syntax for something like this? The sheer vertical size of this trips me up sometimes and I need to get my bearigns to navigate it.
Thanks
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#2 Опубликовано: 10.07.2018 21:13:29
WroteAre better ways to script or format the syntax for something like this ?
For horizontal, use if/otherwise instead of if/else
Open the collapsed area [mapR(x), mapG(x),mapB(x)].
Image Rainbow Colormap [Electron].sm (252 КиБ) скачан 36 раз(а).
#3 Опубликовано: 10.07.2018 22:09:10
Jean Giraud-
THANK YOU! that will help me make things so much cleaner. I need to take some time to get my head around the way I have it now to clean up.
Question- at the value of say 64, do the sucessive (32≤x)&(x≤64) and (64≤x)&(x≤96) have a conclict? should one of those terms be a less than instead of a less than or equal too operator?
Dennis
THANK YOU! that will help me make things so much cleaner. I need to take some time to get my head around the way I have it now to clean up.
Question- at the value of say 64, do the sucessive (32≤x)&(x≤64) and (64≤x)&(x≤96) have a conclict? should one of those terms be a less than instead of a less than or equal too operator?
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#4 Опубликовано: 10.07.2018 23:22:22
WroteQuestion- at the value of say 64, do the sucessive (32â¤x)
... can't tell w/o the document. On top, you complicate matters
Can't you mange f(x) ... linterp(X,Y,x)
... or part of the document that produces something.
#5 Опубликовано: 11.07.2018 11:19:35
Jean Giraud-
My question is about the bolean expressions in your example, within the mapR(x) section. Two sucessive expressions have a common intersection point throughout.
1. The upper limit of the first expression is a less than or equal evaluation of a number.
2. The lower limit of the next expression is a greater than or equal to the same number.
What happens when the value for the expression is exactly equal to the number?
I thought only one of the two expressions could be an 'equal to' statement at the same limit point.
Dennis
My question is about the bolean expressions in your example, within the mapR(x) section. Two sucessive expressions have a common intersection point throughout.
1. The upper limit of the first expression is a less than or equal evaluation of a number.
2. The lower limit of the next expression is a greater than or equal to the same number.
What happens when the value for the expression is exactly equal to the number?
I thought only one of the two expressions could be an 'equal to' statement at the same limit point.
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#6 Опубликовано: 11.07.2018 13:14:55
... mistakes in the last two posts, deleted.
The two segments for interpolation.
Dennis.sm (11 КиБ) скачан 30 раз(а).
The two segments for interpolation.
Dennis.sm (11 КиБ) скачан 30 раз(а).
#7 Опубликовано: 13.07.2018 21:44:53
Jean Giraud-
Thanks for that explanation. I actually learned a whole bunch more functions from that too!
Dennis
Thanks for that explanation. I actually learned a whole bunch more functions from that too!
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#8 Опубликовано: 14.07.2018 01:54:32
WroteI have an include file with a bunch of functions and variable definitions in it. Within one of my functions is a 'cases' and a bunch of if/thens that makes it REALLY long.
Are better ways to script or format the syntax for something like this? The sheer vertical size of this trips me up sometimes and I need to get my bearigns to navigate it.
You can use areas to separate portions of code.
As an example, please, look this game that I developed and has a lot of lines of code
Regards!
1 страниц (8 вхождений)
-
Новые сообщения
-
Нет новых сообщений