Line 13: |
Line 13: |
|
Parameters ([[values]] that are sent to the paragraph) follow the return type and the word "{{code|keyword|using}}" and are separated from each other with "{{code|keyword|and}}". |
|
Parameters ([[values]] that are sent to the paragraph) follow the return type and the word "{{code|keyword|using}}" and are separated from each other with "{{code|keyword|and}}". |
|
|
|
|
− |
* {{codeblock|{{code|keyword|I learned}}{{tag|whitespace}}{{tag|paragraph|paragraph name}}{{tag|whitespace}}{{tag|keyword|using}}{{tag|whitespace}}{{tag|type}}{{tag|whitespace}}{{tag|value}}{{tag|punctuation}}}} |
+ |
* {{codeblock|{{code|keyword|I learned}}{{tag|whitespace}}{{tag|paragraph|paragraph name}}{{tag|whitespace}}{{tag|keyword|using}}{{tag|whitespace}}{{tag|type}}{{tag|whitespace}}{{tag|variable}}{{tag|punctuation}}}} |
− |
* {{codeblock|{{code|keyword|<strong>Today</strong> I learned}}{{tag|whitespace}}{{tag|paragraph|paragraph name}}{{tag|whitespace}}{{tag|keyword|using}}{{tag|whitespace}}{{tag|type}}{{tag|punctuation}}}} |
+ |
* {{codeblock|{{code|keyword|<strong>Today</strong> I learned}}{{tag|whitespace}}{{tag|paragraph|paragraph name}}{{tag|whitespace}}{{tag|keyword|using}}{{tag|whitespace}}{{tag|type}}{{tag|whitespace}}{{tag|variable}}{{tag|punctuation}}}} |
|
|
|
|
|
=== Examples === |
|
=== Examples === |
|
Plain declaration (no return, no parameters): |
|
Plain declaration (no return, no parameters): |
− |
: {{codeblock|{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|how to multiply}}{{code|punctuation|.}}}} |
+ |
: {{codeblock|{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|how to greet you}}{{code|punctuation|.}}}} |
|
|
|
|
|
Declaration for a paragraph which returns a [[number]]: |
|
Declaration for a paragraph which returns a [[number]]: |
− |
: {{codeblock|{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|how to multiply}}{{code|whitespace| }}{{code|keyword|with}}{{code|whitespace| }}{{code|type|a number}}{{code|punctuation|.}}}} |
+ |
: {{codeblock|{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|to randomize}}{{code|whitespace| }}{{code|keyword|with}}{{code|whitespace| }}{{code|type|a number}}{{code|punctuation|.}}}} |
|
|
|
|
|
Declaration for a paragraph which takes in an [[arrays|array]] of numbers called "{{code|variable|Fibonacci}}": |
|
Declaration for a paragraph which takes in an [[arrays|array]] of numbers called "{{code|variable|Fibonacci}}": |
Paragraphs are declared with the text "I learned
", followed by the name of the paragraph and a punctuation. Mane paragraphs start with "Today I learned
".
Return types can be left blank for a void return type, or will follow the paragraph name and the word "with
" or "as
.
Parameters (values that are sent to the paragraph) follow the return type and the word "using
" and are separated from each other with "and
".
Examples
Edit
Plain declaration (no return, no parameters):
-
I learned
how to greet you
.
Declaration for a paragraph which returns a number:
-
I learned
to randomize
with
a number
.
Declaration for a paragraph which takes in an array of numbers called "Fibonacci
":
-
I learned
how to multiply
as
a number
using
the numbers
Fibonacci
.