Alice 3.3: различия между версиями

90 байт добавлено ,  1 год назад
м
<source> -> <syntaxhighlight> (phab:T237267)
м (<source> -> <syntaxhighlight> (phab:T237267))
 
=Одновременное движение объектов=
==Движение в одном направлении==
<sourcesyntaxhighlight lang="c++">
constant DecimalNumber Force = 0.25
constant DecimalNumber Duration = 0.25
MoveRight = nextRandomBoolean()
}
</syntaxhighlight>
</source>
 
==Броуновское движение==
<sourcesyntaxhighlight lang="c++">
constant DecimalNumber Force = 0.25
constant DecimalNumber Duration = 0.25
}
}
</syntaxhighlight>
</source>
 
=Поиск и сортировка=
==Линейный поиск==
<sourcesyntaxhighlight lang="c++">
constant DecimalNumber Arr = new DecimalNumber[] {0.25, 1.0, 2.0, 0.5, 1.0}
WholeNumber i = 0
if (NOT Found) is true then
this.alice say("X не найден")
</syntaxhighlight>
</source>
 
==Сортировка выбором==
<sourcesyntaxhighlight lang="c++">
constant DecimalNumber Arr = new DecimalNumber[] {0.25, 1.0, 2.0, 0.5, 1.0}
WholeNumber i = 0
for each (DecimalNumber n) in Arr
this.alice say("n:" + n)
</syntaxhighlight>
</source>
 
=Camera Markers=
Облёт кубика с трех сторон.
<sourcesyntaxhighlight lang="c++">
constant CameraMarker Arr = new CameraMarker[] {this.cameraMarker1, this.cameraMarker2, this.cameraMarker3}
for each (CameraMarker cameraMarker) in Arr
this.camera orientTo(target = this.cameraMarker)
}
</syntaxhighlight>
</source>
=Анимации=
==Качание объекта==
583

правки