-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boolean variable should be made consistent in look and behaviour #2451
Labels
Comments
All variables are circular today. This requires some type analysis on the variable to show the type. @riknoll |
As I’ve illustrated, type analysis is already undertaken e.g. a boolean cannot be shown as a number, set to a number or used in a maths calculation, so it should not be a problem to change the shape.
… On 29 Sep 2019, at 18:59, Abhijith Chatra ***@***.***> wrote:
All variables are circular today. This requires some type analysis on the variable to show the type. @riknoll
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Variable needs to change shape after they are created. As all the variables are created as number type first. |
I did consider having a way to create a boolean variable, such as a checkbox in the create variable dialogue or a separate ‘create boolean variable’ button in variables. This would be preferable but extra effort to implement. One might go on to argue that strings needs to be represented differently, as they cannot be used in a calculation (and vv. with text manipulation statements) but I wouldn’t go that far. I do think that boolean is a special case worthy of consistent representation due to it’s use in condition statements.
… On 29 Sep 2019, at 20:09, Abhijith Chatra ***@***.***> wrote:
Variable needs to change shape after they are created. As all the variables are created as number type first.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
** Is your feature request related to a problem? Please describe.
The look of boolean variables are not consistent. For example condition fields are pointy ended boxes which fit the defined 'true' and 'false' constants. This can be confusing to the user. The current situation and a proposed solution is outlined below.
**The problem and a possible solution

When a variable is assigned to a boolean value, as in the 'on start' function, the editor clearly knows that it is a boolean. This is reflected (as illustrated below) in the errors given when trying to set it to a number or as a parameter in the 'show number' function. However, the user is not given this feedback. For example, the boolean variable (roundy ends) can be inserted as a condition in the 'if statement' despite the fact that a boolean value (and corresponding field) is shown as a pointy ended box (see next image).
Pointy condition field.

The solution is to make boolean variables the correct shape to fit the boolean field, as below

The make variable panel needs changing otherwise it is inconsistent (as below). If 'bouncing' is a boolean then obviously it cannot be set to a number or changed by 1.

The revised (and consistent) variables panel would look like this.

Boolean variable are now consistent in 'fitting' boolean fields and not fitting non-boolean fields. As shown below, the user can easily see that the boolean variable 'bouncing' can be used as a condition.

The text was updated successfully, but these errors were encountered: