lucio
Łączny wynik programu to: 135
Rav Lexis LALUSIN - 2 miesiące temu
Rav Lexis LALUSIN - 2 miesiące temu
Podstawowe polecenia
wstecz X , ws X
Żółw do tyłu x punktów
Example:
back 50
prawo X , pw X
Rotate the turtle right x degrees
Example:
right 90
Explained in lesson:
wróć , cs
Wyczyści ekran i przesunie żółwia do punktu wyjścia
Example:
cs
Explained in lesson:
changeshape X or STR , csh X or STR
Will change the turtle to another shape accordin to the following 0 = "turtle", 1 = "cat", 2 = "fish", 3 = "dog", 4 = "horse", 5 = "tiger", 6 = "crab", 7 = "snail"
Example:
csh 1 or csh "dog
Explained in lesson:
Używanie Pióra
podnieśpisak , pod
Żółw przestaje zostawiać ślad
Example:
penup
Explained in lesson:
opuśćpisak , opu
Żółw zostawi ślad
Example:
pendown
Explained in lesson:
czekaj X
Will cause the turtle to wait X ( 60ths of seconds ) time before executing the command
Example:
repeat 4 [ wait 10 fd 50]
Explained in lesson:
ustawgrubość X
Will set the pen width to X
Example:
setwidth 4 fd 50
Explained in lesson:
ukryjżółwia , uz
Ukryj żółwia
Example:
hideturtle
Explained in lesson:
pokażżółwia , pz
Pokaż żółwia
Example:
ht wait st
Explained in lesson:
początek
Przesuwa żółwia na środek, wskazującego w górę
Example:
home
ux NUM_x
Move turtle to the specified X location
Example:
setx 100
Explained in lesson:
uy NUM_y
Move turtle to the specified Y location
Example:
sety 200
Explained in lesson:
uxy NUM_X NUM_Y
Przenieś żółwia w określone miejsce
Example:
setxy 100 100
Explained in lesson:
ustawkierunek , uk
Obróć żółwia w określonym kierunku
Example:
sh 145
Explained in lesson:
łuk ANGLE RADIUS
Narysuje łuk o promieniu PROMIEŃ I kącie KĄT
Example:
ARC 360 5
Explained in lesson:
ellipse WIDTH HEIGHT
Narysuje elipsę o szerokości Szerokość i wysokości Wysokość
Example:
ellipse 80 90
poz
Wyświetla bieżącą pozycję żółwia odpowiednio jako [x y], x lub y
Example:
pos
Explained in lesson:
xpoz
Wyświetla bieżącą pozycję żółwia odpowiednio jako [x y], x lub y
Example:
xcor
Explained in lesson:
ypoz
Wyświetla bieżącą pozycję żółwia odpowiednio jako [x y], x lub y
Example:
ycor
Explained in lesson:
kierunek
Wyświetla bieżący kurs żółwia
Example:
heading
do
Wyprowadza kurs w kierunku określonych współrzędnych [x y]
Example:
towards
Explained in lesson:
Pętle i procedury
powtórz X [ statements ... ]
Repeat statements X times
Example:
repeat 4 [ fd 50 rt 90]
Explained in lesson:
powtórzrazy
Wyświetla bieżący numer iteracji bieżącego powtórzenia lub pętli bez końca
Example:
repeat 4 [ repcount ]
for controllist [ statements ...]
Typowe dla pętli. Lista kontrolna określa trzy lub cztery elementy: lokalną nazwę zmiennej, wartość początkową, wartość maksymalną i opcjonalną wartość kroku
Example:
for [i 1 10 1] [print :i]
Explained in lesson:
oto PROCNAME inputs ... statements ... end
Zdefiniuj nową nazwaną procedurę z opcjonalnymi parametrami
Example:
to TURTLE repeat 4 [ fd 50 rt 90] end
Explained in lesson:
make varname expr
Update a variable or define a new global variable. The variable name must be quoted
Example:
make "foo 5
Explained in lesson:
: VARNAME
access the content of VARNAME
Example:
make "foo 5 repeate :foo [fd 50 rt 360 / :foo]
Listy
lista thing1 thing2 ...
Utwórz nową listę z danych wejściowych
Example:
make "mylist (list "turtle "academy)
Explained in lesson:
pierwszy listname
Wyświetla pierwszy element z listy
Example:
print first :mylist
Explained in lesson:
pozapierwszym listname
Wyświetla wszystkie elementy listy z wyjątkiem pierwszego elementu
Example:
print butfirst :mylist
Explained in lesson:
ostatni listname
Wyświetla ostatni element z listy
Example:
print last :mylist
Explained in lesson:
pozaostatnim listname
Wyświetla wszystkie elementy listy z wyjątkiem ostatniego elementu
Example:
print butlast :mylist
Explained in lesson:
pozycja index listname
Wyświetla element o określonym numerze z listy lub tablicy
Example:
print item 1 :mylist
Explained in lesson:
wybierz index listname
Wyświetla losowo jeden element z listy
Example:
print pick :mylist
Explained in lesson:
Kolory
ustawkolor X
0: czarny | 1: niebieski | 2: limonka |
3: cyjan | 4: czerwony | 5: magenta |
6: żółty | 7: biały | 8: brązowy |
9: tangens | 10: zielony | 11: akwamaryna |
12: łososiowy | 13: fioletowy | 14: pomarańczowy |
15: szary |
Example:
setcolor 1
Explained in lesson:
ustawkolor [r,g,b]
Will set the turtle color accroding to the amount of red , green and blue
Example:
setcolor [50 100 50]
zamaluj
Does a paint bucket flood fill at the turtle\'s position
Example:
cs repeear 4 [ fd 50 rt 90 ] pu setxy 50 50 pd fill
Explained in lesson:
filled fillcolor [ statements ... ]
Wykonuj polecenia bez rysowania, ale śledząc ruchy żółwia. Po zakończeniu wypełnij obszar narysowany przez żółwia kolorem wypełnienia i obrysuj obszar bieżącym stylem pisaka
Example:
filled "blue [repeat 4 [fd 100 rt 90]]
Explained in lesson:
Matematyka
minus X Y
return the distance between x and y x-y
Example:
print minus 8 2
losowy X
Will choose a random number between 0 - (X-1)'
Example:
cs print sum random 10 3
Explained in lesson:
modulo expr expr
Wyprowadza resztę (modulus). Dla pozostałych % wynik ma taki sam znak jak pierwsza liczba; dla modulo wynik ma taki sam znak jak druga liczba.
Example:
cs print modulo 10 3
Control Structure
jeśli expr [statement]
Execute statment if expressoin is true
Example:
if 2>1 [print "hello]
Explained in lesson:
jeśliinaczej expr [statementTrue] [statementFalse]
Execute StatementTrue if tru else execute statementFalse
Example:
ifelse 0>1 [print "true] [print "false]
test expr
Test the specified expression save the result in the local scope for the subsequent use by iftrue iffalse
Example:
test 3>4 iftrue [print "true] iffalse [print "false]
jeśliprawda [statements]
Example:
test 3>4 iftrue [print "true] iffalse [print "false]
iffalse [statements]]
Example:
test 3>4 iftrue [print "true] iffalse [print "false]
TobyJDavidM - 2 miesiące temu