Files

262 lines
6.5 KiB
Markdown
Raw Permalink Normal View History

<el-card class="box-card" style="margin-bottom:20px">
<div slot="header" class="clearfix">
<span>Contents</span>
<i class="el-icon-s-management" style="float: right;"></i>
</div>
<div style="margin: 0px 10px 10px 0px ;display:inline-block;">
<el-tag onclick="page_move('variables')">variables</el-tag>
<el-tag onclick="page_move('operation')">operation</el-tag>
<el-tag onclick="page_move('random')">Random</el-tag>
<el-tag onclick="page_move('map')">map</el-tag>
<el-tag onclick="page_move('array')">array</el-tag>
<el-tag onclick="page_move('json')">JSON</el-tag>
<el-tag onclick="page_move('text')">TEXT</el-tag>
</div>
</el-card>
2020-08-06 14:32:55 +08:00
## variables
#### What is a variable?
>A variable is like a container. We can give the variable a name, use it to store the data, read it, or change it. It is often used in actual programming.
#### Create variable
>Click the Create variable option, enter the name of the variable, click OK to create
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/Variables_user1.webp" width="50%">
#### Using variables
>For example: assign the variable initial value A=6, and add the variable 2 after one second.
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/Variables_user2.webp" width="50%">
2020-08-06 14:32:55 +08:00
## operation
#### Function Description
>There are some basic arithmetic blocks in Math, such as "addition, subtraction, multiplication and division".
2020-04-08 14:09:44 +08:00
><img src="/image/Operation/Math.webp" width="30%">
2019-09-02 17:07:07 +08:00
* __constant__
Fill in any number and connect to other objects for assignment
2019-09-02 17:07:07 +08:00
* __Common operation__
Add data on both sides of the expression to add, subtract, multiply and divide power
2019-09-02 17:07:07 +08:00
* __Surplus__
Add data on both sides of the expression to make the remainder
2019-09-02 17:07:07 +08:00
* __Special number judgment__
Add a value to set whether the judgment is true (for example, whether it is odd or even or prime), if it is true, it is True, otherwise it is False.
2019-09-02 17:07:07 +08:00
* __Array calculation__
Summing an array, calculating the maximum or minimum, the average, etc.
2019-09-02 17:07:07 +08:00
* __round__
2019-08-22 10:58:10 +08:00
Rounding off decimals or going to the bottom
2019-09-02 17:07:07 +08:00
* __advance operation__
2019-08-22 10:58:10 +08:00
Find trigonometric functions, absolute values, etc.
2019-09-02 17:07:07 +08:00
* __convert to int__
2019-08-22 10:58:10 +08:00
Convert the value to an integer
2019-09-02 17:07:07 +08:00
* __convert to float__
2019-08-22 10:58:10 +08:00
Convert values to floating point numbers
#### Instructions
>Add data to both sides of the expression, assign the expression to a variable or other object, and get the result.
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/Math_user.webp" width="50%">
## random
#### Function Description
>When making games or animations, we sometimes need some random elements, and Random can generate random numbers according to our needs.
2020-04-08 14:09:44 +08:00
><img src="/image/Operation/Random.webp" width="50%">
2019-09-02 17:07:07 +08:00
* __random fraction__
Randomly generate a number between 0 and 1 each time it is executed
2019-09-02 17:07:07 +08:00
* __random integer__
Specify a random range, each time it is executed, randomly generate an integer in the range
#### Instructions
>Set a random range with a constant and assign a random intger to a variable
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/Random_user.webp" width="50%">
## map
2020-02-11 18:00:45 +08:00
2019-08-23 14:23:38 +08:00
#### Function Description
>Map is another variable container model that can store any type of object.
2020-04-08 14:09:44 +08:00
><img src="/image/Operation/map.webp" width="40%">
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __creat map__
2019-08-23 14:23:38 +08:00
Create key-value pairs of map.
2019-09-02 17:07:07 +08:00
* __map clear__
2019-08-23 14:23:38 +08:00
clear key-value.
2019-09-02 17:07:07 +08:00
* __map contain key__
2019-08-23 14:23:38 +08:00
Confirm if there is a key in map
2019-09-02 17:07:07 +08:00
* __get ken in map__
2019-08-23 14:23:38 +08:00
Get the value of Specified key.
2019-09-02 17:07:07 +08:00
* __in map add key value__
2019-08-23 14:23:38 +08:00
Add key-value in map.
2019-09-02 17:07:07 +08:00
* __in map set key value__
2019-08-23 14:23:38 +08:00
change the value of key in map.
2019-09-02 17:07:07 +08:00
* __in map delete key__
2019-08-23 14:23:38 +08:00
Delete specified key
#### Instructions
2020-04-03 20:22:45 +08:00
>Add a create map to create a map, add some elements to the map, Specify keywords and values
2019-08-23 14:23:38 +08:00
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/map_creat_user.webp" width="50%">
2019-08-23 14:23:38 +08:00
## array
__________________________
#### Function Description
2019-08-23 14:23:38 +08:00
>If the variable is a container, the array is a collection of many containers. We can assign values to any of the variables in the array.
2019-08-23 14:23:38 +08:00
2020-04-08 14:09:44 +08:00
><img src="/image/Operation/List.webp" width="40%">
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __length of__
Measure the length of the array (ie the number of elements in the array)
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __X is empty__
Determine whether an array is empty. When it is established, the expression is True, otherwise it is False.
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __in list find__
Array index, indexed positive or reverse specified element
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __create empty list__
Add a value to set whether the judgment is true (for example, whether it is odd or even or prime), if it is true, it is True, otherwise it is False.
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __create list with__
Customize an array
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __in list get__
2019-08-22 10:58:10 +08:00
Get the index value of an index element
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __in list get sub-list from__
2020-04-03 20:22:45 +08:00
Set an index to the specified value in the array
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __icreat list with item repeated times__
2019-08-22 10:58:10 +08:00
Create an array and use the element to repeat a certain number of times to fill
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __reverse__
2019-08-22 10:58:10 +08:00
Array in reverse order
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __in list set as__
2019-08-22 10:58:10 +08:00
Set an index to the specified value in the array
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __make list from text with delimiter__
2019-08-22 10:58:10 +08:00
Create an array from text, using a separator
2019-08-23 14:23:38 +08:00
#### Instructions
2020-04-03 20:22:45 +08:00
>Add a create list to create an array, add some elements to the array, call elements iteratively or by using other methods
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/List_user.webp" width="50%">
## JSON
2020-02-11 18:00:45 +08:00
2019-08-23 14:23:38 +08:00
#### Function Description
2019-08-23 14:23:38 +08:00
>JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for people to read and write.
2020-04-08 14:09:44 +08:00
><img src="/image/Operation/JSON.webp" width="40%">
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __dumps to json__
2019-08-23 14:23:38 +08:00
Encode Python objects into JSON strings.
2019-09-02 17:07:07 +08:00
* __loads json__
2019-08-23 14:23:38 +08:00
Decode an encoded JSON string into a Python object.
#### Instructions
2020-04-03 20:22:45 +08:00
>Creat a map and turn it into json format
2019-08-23 14:23:38 +08:00
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/JSON_dump_user.webp" width="50%">
2019-08-23 14:23:38 +08:00
## TEXT
2020-02-11 18:00:45 +08:00
2019-08-23 14:23:38 +08:00
#### Function Description
>Use these blocks for text processing and screen display.
2020-04-08 14:09:44 +08:00
><img src="/image/Operation/Text.webp" width="40%">
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __" "__
2019-08-23 14:23:38 +08:00
Assign text or String
2019-09-02 17:07:07 +08:00
* __to UPPER CASE__
2019-08-23 14:23:38 +08:00
Convert text to uppercase or lowercase.
2019-09-02 17:07:07 +08:00
* __in text get letter#__
2019-08-23 14:23:38 +08:00
Get the specified character from the text.
2019-09-02 17:07:07 +08:00
* __count in__
2020-04-03 20:22:45 +08:00
Find the number of occurrences of specific characters.
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __is empty__
2019-08-23 14:23:38 +08:00
Returns whether it is empty text.
2019-09-02 17:07:07 +08:00
* __length of__
2019-08-23 14:23:38 +08:00
Return text length.
2019-09-02 17:07:07 +08:00
* __print__
2019-08-23 14:23:38 +08:00
Print text.
2019-09-02 17:07:07 +08:00
* __replace with in__
2020-04-03 20:22:45 +08:00
Replace text.
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __trim spaces from both sides__
2020-04-03 20:22:45 +08:00
Remove spaces from both sides of the string.
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __Convert to str__
2019-08-23 14:23:38 +08:00
Convert other types to strings.
2019-09-02 17:07:07 +08:00
* __" "+__
2020-04-03 20:22:45 +08:00
Text merging.
2019-08-23 14:23:38 +08:00
2019-09-02 17:07:07 +08:00
* __decode__
2019-08-23 14:23:38 +08:00
Decode the string in the encoding format specified by encoding.
2019-09-02 17:07:07 +08:00
* __encode__
2019-08-23 14:23:38 +08:00
Encodes the string in the encoding format specified by encoding.
2019-09-02 17:07:07 +08:00
* __Reduce to decimal places__
2019-08-23 14:23:38 +08:00
Retain the specified number of decimal places.
#### Instructions
>
2020-08-10 15:56:54 +08:00
><img src="/image/Operation/Text_user.webp" width="50%">