colobot-data/help/cbot/R/term.txt

32 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

\b;Точка с запятой
После простого выражения всегда ставьте точку с запятой \c;;\n;. Например:
\c;
\s; int counter = 0;
\n;
Тем не менее после \l;блока\u cbot\bloc; точка с запятой никогда не ставятся:
\c;
\s; {
\s; float dist;
\s; dist = distance(p1, p2);
\s; } \n;// здесь точки с запятой нет!\c;
\n;
Также не используйте точку с запятой сразу же после инструкций \c;\l;while\u cbot\while;\n;, \c;\l;if\u cbot\if;\n; и \c;\l;for\u cbot\for;\n;:
\c;
\s; if ( a < b ) \n;// здесь нет точки с запятой!\c;
\s; {
\s; b = 100-a;
\s; }
\n;
Инструкции всегда заканчиваются точкой с запятой, а не концом строки. Поэтому вы можете спокойно поместить в одну строку несколько инструкций:
\c;
\s; int d=20;
\s; move(d);
\s; turn(90);
\n;
Это эквивалентно:
\c;
\s; int d=20; move(d); turn(90);
\n;
\t;Смотри также
\l;Программирование\u cbot;, \l;типы\u cbot\type; и \l;категории\u cbot\category;.