I. Understanding, analyzing and solving problems. The student:
2) formulates and writes in the form of algorithms commands consisting of:
c) controlling the robot or object on the screen;
3) distinguishes basic steps in algorithmic problem solving: determination of the problem and goal to be achieved, analysis of the problem situation, developing a solution, checking the problem solution for example data, writing the solution in the form of a diagram or program.
II. Programming and solving problems with the use of computer and other digital devices. The student:
1) designs, creates and writes in a visual programming language:
a) ideas of stories and solutions to problems, including simple algorithms using sequential, conditional and iterative commands and events, b) a simple program that controls a robot or other object on the computer screen;
Children often play in guessing. One of the games is guessing the number or objects that the other person has in mind.
Your task is to write a script in which the computer „invents” a number, and you guess it. The rules are simple – determine the range of numbers between which the number is looked for. If the number you choose is too small or too large, you enter the next one. The game lasts so long until you guess the number.
Before writing a script, ask the other person to play the game together. Write down your answers and discuss what would be important for the algorithm of your script.
Before you start writing a script, learn how to communicate with the sprite. Blocks from the Sensing and Operators category are helpful in communication.
Task 1
Build a script in which the sprite will ask you for your name and then use it to greet you.
Build a script in which the program draws a number from 1 to 20. The drawn number has to be shown on the screen. The sprite says if the number is smaller or greater than 10.
Then change the script so that the upper boundupper boundupper bound of the draw numbers depends on your choice.
You can compare your solutionsolutionsolution with the one on the slideshow. It shows how to test the program.
[Slideshow]
Task 3
Using your previous scripts, build a script to play the game of guessing numbers.
Add selected backdrop.
You can add a countercountercounter of correct answers or scored pointsscored pointsscored points.
Jednym z warunków gry w zgadywanie liczb jest wybranie dowolnej liczby przez program. W tym celu losuje on liczby w zadanym mu przedziale. Przydatny jest tu operator losuj od ... do ... . Oprócz niego potrzebna będzie jeszcze zmienna, do której przypiszesz wylosowaną liczbę.
m94456c77ed3affbd_1528449000663_0
Zabawa w zgadywanie liczby
m94456c77ed3affbd_1528449084556_0
Drugi
m94456c77ed3affbd_1528449076687_0
Klasy IV‑VI
I. Rozumienie, analizowanie i rozwiązywanie problemów. Uczeń:
2) formułuje i zapisuje w postaci algorytmów polecenia składające się na:
c) sterowanie robotem lub obiektem na ekranie;
3) w algorytmicznym rozwiązywaniu problemu wyróżnia podstawowe kroki: określenie problemu i celu do osiągnięcia, analiza sytuacji problemowej, opracowanie rozwiązania, sprawdzenie rozwiązania problemu dla przykładowych danych, zapisanie rozwiązania w postaci schematu lub programu.
II. Programowanie i rozwiązywanie problemów z wykorzystaniem komputera i innych urządzeń cyfrowych. Uczeń:
1) projektuje, tworzy i zapisuje w wizualnym języku programowania:
a) pomysły historyjek i rozwiązania problemów, w tym proste algorytmy z wykorzystaniem poleceń sekwencyjnych, warunkowych i iteracyjnych oraz zdarzeń, b) prosty program sterujący robotem lub innym obiektem na ekranie komputera;
m94456c77ed3affbd_1528449068082_0
45 minut
m94456c77ed3affbd_1528449523725_0
Tworzy program wykorzystujący liczby losowe.
m94456c77ed3affbd_1528449552113_0
1. Wykorzystuje polecenia warunkowe.
2. Tworzy algorytmy do wymyślonych historii.
3. Wprowadza dane do programu.
m94456c77ed3affbd_1528450430307_0
Uczeń:
- buduje programy wykorzystujące liczby losowe,
- stosuje polecenia warunkowe i sekwencyjne.
m94456c77ed3affbd_1528449534267_0
1. Dyskusja.
2. Praca z komputerem.
m94456c77ed3affbd_1528449514617_0
1. Praca indywidualna.
2. Praca grupowa.
m94456c77ed3affbd_1528450135461_0
m94456c77ed3affbd_1528450127855_0
Dzieci często bawią się w zgadywanie. Jedną z zabaw jest odgadywanie liczby lub przedmiotów, które druga osoba ma na myśli.
Twoim zadaniem jest napisanie skryptu, w którym komputer „wymyśla” liczbę, a Ty ją zgadujesz. Reguły są proste – ustala się zakres liczb, pomiędzy którymi znajduje się poszukiwana liczba. Jeśli wybrana przez Ciebie liczba jest za mała lub za duża, podajesz następną. Gra trwa tak długa, aż zgadniesz liczbę.
Przed pisaniem skryptu poproś drugą osobę o zagranie razem w taką grę. Zanotujcie swoje odpowiedzi i przedyskutujcie, co byłoby istotne dla algorytmu Twojego skryptu.
m94456c77ed3affbd_1528446435040_0
Nim przejdziesz do pisania skryptu, naucz się komunikować z duszkiem. Pomocne w komunikowaniu są bloczki z kategorii Czujniki oraz Wyrażenia.
Polecenie 1
Zbuduj skrypt, w którym duszek zapyta Cię o imię i następnie używając go, przywita się z Tobą.
Rozwiązanie:
[Ilustracja 1]
Jednym z warunków gry w zgadywanie liczb jest wybranie dowolnej liczby przez program. W tym celu losuje on liczby w zadanym mu przedziale. Przydatny jest tu operator losuj od ... do ... . Oprócz niego potrzebna będzie jeszcze zmienna, do której przypiszesz wylosowaną liczbę.
Polecenie 2
Zbuduj skrypt, w którym program losuje liczbę od 1 do 20. Wylosowana liczba ma być pokazywana jest na ekranie. Duszek ma informować, czy liczba jest mniejsza czy większa od 10.
Zmień następnie skrypt tak, aby górna granica losowania zależała od Twojego wyboru.
Swoje rozwiązanie możesz porównać z zamieszczonym na pokazie slajdów. Pokazują one, jak przeprowadzić testowanie programu.
[Slideshow]
Polecenie 3
Wykorzystując swoje poprzednie skrypty zbuduj skrypt do gry w zgadywanie liczb.
Dodaj wybrane tło.
Możesz dodać licznik poprawnych odpowiedzi lub zdobytych punktów.
m94456c77ed3affbd_1528450119332_0
Przydatną funkcją programu jest losowanie liczb z wybranego zakresu.