You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language idea incl level
My goal was to write a multiplication table!
To make it appear nice we need to pad the shorter numbers so everything aligns.
I got it to work, but the code is a bit convoluted!
Need some sort of language function like this - which I know is way too complex for children, but maybe we can come up with a syntax?
Another concept that could help would be a print without a newline.
Ideas for hedy (I am a very poor language designer!)
print myvalue with 4 positions align left # adds crazy verbose syntax to the language :-(
print xxxx without newline # more verbose ugly syntax
print myvalue picture "ZZZ9" # this is supported by COBOL !!!! Zero suppression
print format(myvalue, "{:4d}") # allow any Python format to be used
or support tab stops and automatically right justify the columns) # need a directive in the language to declare the tab width(s)
set tabwidths = {5,10,10,10,10} # introduces a special variable in hedy and support for escaped \t
Language idea incl level
My goal was to write a multiplication table!
To make it appear nice we need to pad the shorter numbers so everything aligns.
I got it to work, but the code is a bit convoluted!
Need some sort of language function like this - which I know is way too complex for children, but maybe we can come up with a syntax?
Another concept that could help would be a print without a newline.
Ideas for hedy (I am a very poor language designer!)
Example in Python
print("{:4d}".format(val) , end =" ")
Additional context
The text was updated successfully, but these errors were encountered: