Topic Information

Add Print function by Byron_Inc in Suggestions

Posts: 31

1: Byron_Inc wrote at 10:17:14 AM 31/7/20204276281
Note: The word “print” here means showing a box with the result, as if it's in JS. It doesn't mean print it on paper.

A print function will be good when it comes to debugging. It will be in the control blocks, or a new extension called debugging.
print [] :: control stack
print line [] :: control stack // known as print ln in JS.
The print blocks can be used when you want to see if the part of the block is running. Example:
if <([sqrt v] of (5))=[2]> then
move (50) steps // it won't work
print [50 steps] :: control stack
else
move (20) steps
print [20 steps] :: control stack
end
Result:
20 steps
It can also be useful when you are checking your math, especially with complicated calculations.
Example:
set [a v] to (1)
set [b v] to (-8)
set [c v] to (15)
print ((((b) * (-1)) + ([sqrt v] of (((b) * (b)) - (((4) * (a)) * (c))))) / (2)) :: control stack
Result:
5
It can also print if a boolean is true.
print <((1)+(1)) = (2)> :: control stack
Result:
true
The print block will print thing in the same line. Example:
print [18] :: control stack
print [25] :: control stack
Result:
1825
But the print line block print them in different lines.
Example:
print line [18] :: control stack
print line [25] :: control stack
Result:
18
25
I hope you can accept this suggestion.
2: -Zyte- wrote at 10:26:02 AM 31/7/20204276292
*whispers*print is Python, I'm pretty sure it's alert/prompt*whispers*
imaybewrong
3: Byron_Inc wrote at 10:27:36 AM 31/7/20204276296

-Zyte- wrote:

*whispers*print is Python, I'm pretty sure it's alert/prompt*whispers*
imaybewrong
I think it's available in both coding languages.
4: fdreerf wrote at 10:29:57 AM 31/7/20204276299
Workaround:
say []
or ::grey
set [ v] to []
or ::grey
add [] to [list v]
5: Byron_Inc wrote at 10:32:13 AM 31/7/20204276302

fdreerf wrote:

Workaround:
say []
or ::grey
set [ v] to []
or ::grey
add [] to [list v]
Hmm… looks like a good workaround.
6: Maximouse wrote at 11:09:13 AM 31/7/20204276375
In JavaScript the function is called console.log, not print.
7: Byron_Inc wrote at 11:19:37 AM 31/7/20204276392

Maximouse wrote:

In JavaScript the function is called console.log, not print.
Weird. That's what I learnt though.
8: Maximouse wrote at 11:43:02 AM 31/7/20204276442

Byron_Inc wrote:

Maximouse wrote:

In JavaScript the function is called console.log, not print.
Weird. That's what I learnt though.
This means you probably learnt a non-standard version of JavaScript.
9: Byron_Inc wrote at 12:05:31 PM 31/7/20204276479

Maximouse wrote:

Byron_Inc wrote:

Maximouse wrote:

In JavaScript the function is called console.log, not print.
Weird. That's what I learnt though.
This means you probably learnt a non-standard version of JavaScript.
ProcessingJS. In Khan Academy. Probably they modified the programming language.
10: Maximouse wrote at 12:06:32 PM 31/7/20204276482

Byron_Inc wrote:

ProcessingJS. In Khan Academy. Probably they modified the programming language.
Then the function is a part of Processing, not JavaScript itself.
11: Byron_Inc wrote at 12:07:41 PM 31/7/20204276483

Maximouse wrote:

Byron_Inc wrote:

ProcessingJS. In Khan Academy. Probably they modified the programming language.
Then the function is a part of Processing, not JavaScript itself.
Okay, thanks. But do you support the suggestion?
12: skymover1239 wrote at 2:40:30 PM 31/7/20204276897
Support, although I have a question would this be like making text appear across the screen, or
would it be printing a line of text in a console like
print(“Hello, world!”
13: secretagent123 wrote at 3:45:42 PM 31/7/20204277145
You can make text engines like this one.
14: Byron_Inc wrote at 11:25:01 PM 31/7/20204278709

skymover1239 wrote:

Support, although I have a question would this be like making text appear across the screen, or
would it be printing a line of text in a console like
print(“Hello, world!”
Printing at the console, probably a box showing below the stage.
15: Byron_Inc wrote at 11:27:47 PM 31/7/20204278715

secretagent123 wrote:

You can make text engines like this one.
I'm not asking for a text engine. I'm asking for a “print” function that can output results in an extra box.
16: Byron_Inc wrote at 2:39:25 AM 1/8/20204279063
BUMP
17: Maximouse wrote at 7:06:56 AM 1/8/20204279349
Interesting idea, but it would make more sense to be called “debug” because it would only be used for debugging. Also, you could just use a list.
18: Byron_Inc wrote at 10:30:27 AM 1/8/20204279645
La bump
19: Boomer001 wrote at 10:35:00 AM 1/8/20204279652
deleted, the OP was edited
20: Maximouse wrote at 10:36:54 AM 1/8/20204279655

Boomer001 wrote:

JavaScript ‘print’ prints the contents of the window using a printer.
I didn't even know that exists, but seems true.