There are some things in the formula editor which would come in handy that I would like to see.
For loops.
From the C++ documentation ( https://cplusplus.com/doc/tutorial/control/ ) :
The for loop is designed to iterate a number of times. Its syntax is:
for (initialization; condition; increase) statement;
Like the while-loop, this loop repeats statement
while condition
is true. But, in addition, the for loop provides specific locations to contain an
initialization
and an increase
expression, executed before the loop begins the first time, and after each iteration, respectively. Therefore, it is especially useful to use counter variables as condition
.
It works in the following way:
initialization
is executed. Generally, this declares a counter variable, and sets it to some initial value. This is executed a single time, at the beginning of the loop.
condition
is checked. If it is true, the loop continues; otherwise, the loop ends, and statement
is skipped, going directly to step 5.
statement
is executed. As usual, it can be either a single statement or a block enclosed in curly braces {}.
increase
is executed, and the loop goes back to step 2.
- the loop ends: execution continues by the next statement after it.
Boolean operators are already in Ultra Fractal, but I think there is one that is not in Ultra Fractal: the exclusive or operator, the XOR operator. Speaking of the devil, bitwise operators are probably going to help too:
&, AND, bitwise AND
|, OR, bitwise inclusive OR
^, XOR, bitwise exclusive OR
~, NOT, unary complement, or bit inversion
<<
, SHL, shift bits left
>>
, SHR, shift bits right
Then, what about function templates? Why not have them the same syntax as in C++, or maybe as something different and more simplified? This is because overloaded functions may have the same definition (I am not sure if operator overloading is a thing in Ultra Fractal).
The do-while loop, which would be preferred over a while-loop.
Data structures would also be of use in the formula editor, because we can group data elements together under a single name. These elements are known as members, and they can have different types and different lengths.
What else are we missing? Compound assignments, of course! (+=, -=, *=, /=, %=, >>=, <<= &=, ^=, |=)
They modify the current value of a variable by performing an operation on it. In fact, it is the same as assigning the result of an operation to the first operand:
y += x
is equivalent to y = y + x
, for example.
Increment and decrement operators (++ and --) would shorten our expressions even more: ++x
is equivalent to x+=1
and x = x + 1
.
More info here: https://cplusplus.com/doc/tutorial/operators/
Conditional ternary operators ( ? ) would also be considered.
An explicit type casting operator would help in coloring algorithms in the final section of the algorithm, in the #index assignment predefined symbol. But it could do more than that: it would explicitly convert a value of a given type to another type.
This is just what I am suggesting to improve the formula editor.
There are some things in the formula editor which would come in handy that I would like to see.
For loops.
From the C++ documentation ( https://cplusplus.com/doc/tutorial/control/ ) :
> The for loop is designed to iterate a number of times. Its syntax is:
`for (initialization; condition; increase) statement;`
Like the while-loop, this loop repeats `statement` while `condition` is true. But, in addition, the for loop provides specific locations to contain an
`initialization` and an `increase` expression, executed before the loop begins the first time, and after each iteration, respectively. Therefore, it is especially useful to use counter variables as `condition`.
It works in the following way:
1. `initialization` is executed. Generally, this declares a counter variable, and sets it to some initial value. This is executed a single time, at the beginning of the loop.
2. `condition` is checked. If it is true, the loop continues; otherwise, the loop ends, and `statement` is skipped, going directly to step 5.
3. `statement` is executed. As usual, it can be either a single statement or a block enclosed in curly braces {}.
4. `increase` is executed, and the loop goes back to step 2.
5. the loop ends: execution continues by the next statement after it.
Boolean operators are already in Ultra Fractal, but I think there is one that is not in Ultra Fractal: the exclusive or operator, the XOR operator. Speaking of the devil, bitwise operators are probably going to help too:
&, AND, bitwise AND
|, OR, bitwise inclusive OR
^, XOR, bitwise exclusive OR
~, NOT, unary complement, or bit inversion
`<<`, SHL, shift bits left
`>>`, SHR, shift bits right
Then, what about function templates? Why not have them the same syntax as in C++, or maybe as something different and more simplified? This is because overloaded functions may have the same definition (I am not sure if operator overloading is a thing in Ultra Fractal).
The do-while loop, which would be preferred over a while-loop.
Data structures would also be of use in the formula editor, because we can group data elements together under a single name. These elements are known as members, and they can have different types and different lengths.
What else are we missing? Compound assignments, of course! (+=, -=, *=, /=, %=, >>=, <<= &=, ^=, |=)
They modify the current value of a variable by performing an operation on it. In fact, it is the same as assigning the result of an operation to the first operand:
`y += x` is equivalent to `y = y + x`, for example.
Increment and decrement operators (++ and --) would shorten our expressions even more: `++x` is equivalent to `x+=1` and `x = x + 1`.
More info here: https://cplusplus.com/doc/tutorial/operators/
Conditional ternary operators ( ? ) would also be considered.
An explicit type casting operator would help in coloring algorithms in the final section of the algorithm, in the #index assignment predefined symbol. But it could do more than that: it would explicitly convert a value of a given type to another type.
This is just what I am suggesting to improve the formula editor.
edited Jul 19 at 9:19 pm