Bai 2 ICT Crocodile

- 0 / 0
(Tài liệu chưa được thẩm định)
Nguồn:
Người gửi: Bùi văn Vân
Ngày gửi: 09h:51' 09-08-2021
Dung lượng: 487.5 KB
Số lượt tải: 3
Nguồn:
Người gửi: Bùi văn Vân
Ngày gửi: 09h:51' 09-08-2021
Dung lượng: 487.5 KB
Số lượt tải: 3
Số lượt thích:
0 người
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
1. Tutorial - Creating and monitoring a flowchart
2. Tutorial - Creating and using a function
3. Tutorial - Getting and setting part properties
4. Tutorial - Using the `On button press` part
5. Tutorial - Constructing a dance routine
6. Tutorial - Programming a character`s speech
7. Tutorial - Setting a context
8. Tutorial - Using scenes
9. Phụ lục: Contextualising a model
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
Instructions
We are going to construct a function that works out the horizontal distance between a girl and a boy part every time it is called.
1. Drag on a boy character and a girl character from the Parts pane.
2. Drag on a function part from the Flowcharts > Start and Stop folder. Click on its name to edit it. Change its name to `dist`.
3. Drag on two get property parts from the Flowcharts > Inputs and Outputs folder and connect them one after the other after the function part.
Hướng dẫn
Chúng ta sẽ xây dựng một hàm tính toán khoảng cách ngang giữa phần con gái và con trai mỗi khi nó được gọi.
1. Kéo nhân vật bé trai và nhân vật bé gái từ ngăn Bộ phận.
2. Kéo trên một phần chức năng từ thư mục Lưu đồ> Bắt đầu và Dừng. Bấm vào tên của nó để chỉnh sửa nó. Thay đổi tên của nó thành `dist`.
3. Kéo hai phần thuộc tính get từ thư mục Flowcharts> Inputs and Outputs và nối chúng lần lượt sau phần chức năng.
1
1
2
3
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
4. Edit the get property parts as shown above, so that the X position of the girl is stored in the variable girlX and the X position of the boy is stored in variable boyX. (You will need to use the target tool to associate each part to a character.)
5. Drag on a set variable part from the Flowcharts > Processes folder, connecting it to the last part.
6. We now need to calculate the difference between these two X positions. We do this by using the expression:
abs(boyX-girlX)
This expression uses the built-in function abs() to ensure that the distance between the characters is given as a positive number. (Note that variable names are case-sensitive so make sure that you use capital and small letters as you did when entering the variables earlier.)
Dịch
4. Chỉnh sửa các phần thuộc tính get như hình trên, để vị trí X của cô gái được lưu trong biến girlX và vị trí X của chàng trai được lưu trong biến boyX. (Bạn sẽ cần sử dụng công cụ đích để liên kết từng phần với một ký tự.)
5. Kéo trên một phần biến đã đặt từ thư mục Flowcharts> Processes, kết nối nó với phần cuối cùng.
6. Bây giờ chúng ta cần tính toán sự khác biệt giữa hai vị trí X này. Chúng tôi thực hiện điều này bằng cách sử dụng biểu thức:
abs (boyX-girlX)
Biểu thức này sử dụng hàm abs () tích hợp sẵn để đảm bảo rằng khoảng cách giữa các ký tự là một số dương. (Lưu ý rằng tên biến có phân biệt chữ hoa chữ thường, vì vậy hãy đảm bảo rằng bạn sử dụng chữ hoa và chữ nhỏ như khi nhập các biến trước đó.)
target tool
built-in function
4
6
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
7. Enter this expression on the right side of the set variable part, thereby assigning its value, when it is evaluated at run-time, to the variable x.
8. Now finish the function with a return part. Select the part and in its Properties pane choose to return an `Expression`. In the Expression edit box ensure that x is written. This means that the result of our expression above will be returned when the function is run.
9. To test the function, construct the following flowchart (within the same document). The flowchart uses a start part, a set property part, and a stop part. Drag on a Number part from the Presentation folder, select it and in its Properties pane select `Display Label`. Enter a label for it, then associate the set property part to the Number part (and select its Value property).
Dịch
7. Nhập biểu thức này vào phía bên phải của phần biến đã đặt, do đó gán giá trị của nó, khi nó được đánh giá tại thời điểm chạy, cho biến x.
8. Bây giờ kết thúc hàm với một phần trả về. Chọn phần và trong ngăn Thuộc tính của nó, hãy chọn trả về `Biểu thức`. Trong hộp soạn thảo Biểu thức, hãy đảm bảo rằng x được viết. Điều này có nghĩa là kết quả của biểu thức của chúng ta ở trên sẽ được trả về khi hàm được chạy.
9. Để kiểm tra chức năng, hãy xây dựng lưu đồ sau (trong cùng một tài liệu).
Lưu đồ sử dụng một phần bắt đầu, một phần thuộc tính đặt và một phần dừng. Kéo phần Số từ thư mục Trình bày, chọn phần đó và trong ngăn Thuộc tính của nó, chọn `Nhãn hiển thị`. Nhập nhãn cho nó, sau đó liên kết phần thuộc tính tập hợp với phần Số (và chọn thuộc tính Giá trị của nó).
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
10. Now run the flowchart and the distance (in pixels) between the two characters will appear in the Number part.
11. Move the characters and run the flowchart again to assure yourself that the function is working.
Dịch
10. Bây giờ hãy chạy lưu đồ và khoảng cách (tính bằng pixel) giữa hai ký tự sẽ xuất hiện trong phần Number.
11. Di chuyển các ký tự và chạy lại lưu đồ để đảm bảo với bạn rằng hàm đang hoạt động.
FUNCTION THÔNG DỤNG:
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
3. Custom functions
Construction
Custom functions are created by using a function part to start a series of operations and then ending the series of operations with a return part.
In the example above, the Add_text() function takes a string and adds it to the text already in a textbox. This kind of function might be useful when using the textbox as if it were a computer screen. No value is returned from the example above.
By default, no value is returned by the return part.
Function naming
Each function within the document must have a unique name so that it can be identified when called from a routine.
Variables and functions
Functions do not have access to variables that are defined in the main flowchart. If a function is to use variables that are used in a main flowchart, either:
the variables must be passed to the function as parameters; or
the variables must be scene variables.
1. Tutorial - Creating and monitoring a flowchart
2. Tutorial - Creating and using a function
3. Tutorial - Getting and setting part properties
4. Tutorial - Using the `On button press` part
5. Tutorial - Constructing a dance routine
6. Tutorial - Programming a character`s speech
7. Tutorial - Setting a context
8. Tutorial - Using scenes
9. Phụ lục: Contextualising a model
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
Instructions
We are going to construct a function that works out the horizontal distance between a girl and a boy part every time it is called.
1. Drag on a boy character and a girl character from the Parts pane.
2. Drag on a function part from the Flowcharts > Start and Stop folder. Click on its name to edit it. Change its name to `dist`.
3. Drag on two get property parts from the Flowcharts > Inputs and Outputs folder and connect them one after the other after the function part.
Hướng dẫn
Chúng ta sẽ xây dựng một hàm tính toán khoảng cách ngang giữa phần con gái và con trai mỗi khi nó được gọi.
1. Kéo nhân vật bé trai và nhân vật bé gái từ ngăn Bộ phận.
2. Kéo trên một phần chức năng từ thư mục Lưu đồ> Bắt đầu và Dừng. Bấm vào tên của nó để chỉnh sửa nó. Thay đổi tên của nó thành `dist`.
3. Kéo hai phần thuộc tính get từ thư mục Flowcharts> Inputs and Outputs và nối chúng lần lượt sau phần chức năng.
1
1
2
3
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
4. Edit the get property parts as shown above, so that the X position of the girl is stored in the variable girlX and the X position of the boy is stored in variable boyX. (You will need to use the target tool to associate each part to a character.)
5. Drag on a set variable part from the Flowcharts > Processes folder, connecting it to the last part.
6. We now need to calculate the difference between these two X positions. We do this by using the expression:
abs(boyX-girlX)
This expression uses the built-in function abs() to ensure that the distance between the characters is given as a positive number. (Note that variable names are case-sensitive so make sure that you use capital and small letters as you did when entering the variables earlier.)
Dịch
4. Chỉnh sửa các phần thuộc tính get như hình trên, để vị trí X của cô gái được lưu trong biến girlX và vị trí X của chàng trai được lưu trong biến boyX. (Bạn sẽ cần sử dụng công cụ đích để liên kết từng phần với một ký tự.)
5. Kéo trên một phần biến đã đặt từ thư mục Flowcharts> Processes, kết nối nó với phần cuối cùng.
6. Bây giờ chúng ta cần tính toán sự khác biệt giữa hai vị trí X này. Chúng tôi thực hiện điều này bằng cách sử dụng biểu thức:
abs (boyX-girlX)
Biểu thức này sử dụng hàm abs () tích hợp sẵn để đảm bảo rằng khoảng cách giữa các ký tự là một số dương. (Lưu ý rằng tên biến có phân biệt chữ hoa chữ thường, vì vậy hãy đảm bảo rằng bạn sử dụng chữ hoa và chữ nhỏ như khi nhập các biến trước đó.)
target tool
built-in function
4
6
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
7. Enter this expression on the right side of the set variable part, thereby assigning its value, when it is evaluated at run-time, to the variable x.
8. Now finish the function with a return part. Select the part and in its Properties pane choose to return an `Expression`. In the Expression edit box ensure that x is written. This means that the result of our expression above will be returned when the function is run.
9. To test the function, construct the following flowchart (within the same document). The flowchart uses a start part, a set property part, and a stop part. Drag on a Number part from the Presentation folder, select it and in its Properties pane select `Display Label`. Enter a label for it, then associate the set property part to the Number part (and select its Value property).
Dịch
7. Nhập biểu thức này vào phía bên phải của phần biến đã đặt, do đó gán giá trị của nó, khi nó được đánh giá tại thời điểm chạy, cho biến x.
8. Bây giờ kết thúc hàm với một phần trả về. Chọn phần và trong ngăn Thuộc tính của nó, hãy chọn trả về `Biểu thức`. Trong hộp soạn thảo Biểu thức, hãy đảm bảo rằng x được viết. Điều này có nghĩa là kết quả của biểu thức của chúng ta ở trên sẽ được trả về khi hàm được chạy.
9. Để kiểm tra chức năng, hãy xây dựng lưu đồ sau (trong cùng một tài liệu).
Lưu đồ sử dụng một phần bắt đầu, một phần thuộc tính đặt và một phần dừng. Kéo phần Số từ thư mục Trình bày, chọn phần đó và trong ngăn Thuộc tính của nó, chọn `Nhãn hiển thị`. Nhập nhãn cho nó, sau đó liên kết phần thuộc tính tập hợp với phần Số (và chọn thuộc tính Giá trị của nó).
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
2. Tutorial - Creating and using a function
10. Now run the flowchart and the distance (in pixels) between the two characters will appear in the Number part.
11. Move the characters and run the flowchart again to assure yourself that the function is working.
Dịch
10. Bây giờ hãy chạy lưu đồ và khoảng cách (tính bằng pixel) giữa hai ký tự sẽ xuất hiện trong phần Number.
11. Di chuyển các ký tự và chạy lại lưu đồ để đảm bảo với bạn rằng hàm đang hoạt động.
FUNCTION THÔNG DỤNG:
HƯỚNG DẪN ICT CROCODILE TUTOR MINH HỌA
3. Custom functions
Construction
Custom functions are created by using a function part to start a series of operations and then ending the series of operations with a return part.
In the example above, the Add_text() function takes a string and adds it to the text already in a textbox. This kind of function might be useful when using the textbox as if it were a computer screen. No value is returned from the example above.
By default, no value is returned by the return part.
Function naming
Each function within the document must have a unique name so that it can be identified when called from a routine.
Variables and functions
Functions do not have access to variables that are defined in the main flowchart. If a function is to use variables that are used in a main flowchart, either:
the variables must be passed to the function as parameters; or
the variables must be scene variables.
 








Các ý kiến mới nhất