home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2001 November / Gamestar_34_2001-11_cd1.bin / PATCHE / colobotpatch17e.exe / english / help / Cbot.txt next >
Text File  |  2001-09-14  |  3KB  |  64 lines

  1. \b;Programming - the CBOT language
  2. The CBOT language is very close in structure and syntax to C++ and Java. It has been adapted for the specific purposes of COLOBOT, and for an efficient pedagogical approach.
  3. This language is made up of instructions (see below), \l;blocks\u cbot\bloc;, \l;variables\u cbot\var;, \l;expressions\u cbot\expr; and \l;conditions\u cbot\cond;.
  4.  
  5. o  \c;\token;Instructions\norm;\n;
  6. In the program editor, an instruction in the CBOT language is always displayed on an orange background. If an instruction hasn't got an orange background, this means that it has been misspelled. Instruction names are always written in lower case. 
  7.  
  8. o  \c;\type;Type\norm;\n;
  9. The \l;type\u cbot\type; of a variable appears with a green background. 
  10.  
  11. o  \c;\const;Constants\norm;\n;
  12. Constants like \l;categories\u cbot\category; are displayed with a red background. 
  13.  
  14. \t;Instructions in the CBOT language:
  15. \c;\l;extern\u cbot\extern;     \n;Indicate the main procedure
  16. \c;\l;if\u cbot\if;         \n;Choice structure
  17. \c;\l;else\u cbot\if;       \n;Alternative choice structure
  18. \c;\l;for\u cbot\for;        \n;Loop structure
  19. \c;\l;while\u cbot\while;      \n;Control structure
  20. \c;\l;do\u cbot\do;         \n;Control structure
  21. \c;\l;break\u cbot\break;      \n;Exit from a loop
  22. \c;\l;continue\u cbot\continue;   \n;Continues the loop
  23. \c;\l;return\u cbot\return;     \n;Exit from a function
  24.  
  25. \t;Specific instructions for bots:
  26. \c;\l;radar\u cbot\radar;      \n;Object detection
  27. \c;\l;direction\u cbot\direct;  \n;Calculates a rotation angle
  28. \c;\l;distance\u cbot\dist;   \n;Calculates a distance
  29. \c;\l;distance2d\u cbot\dist2d; \n;Calculates a distance
  30. \c;\l;wait\u cbot\wait;       \n;Waits
  31. \c;\l;move\u cbot\move;       \n;Moves forward or backward
  32. \c;\l;turn\u cbot\turn;       \n;Turns
  33. \c;\l;goto\u cbot\goto;       \n;Goes to a given position
  34. \c;\l;motor\u cbot\motor;      \n;Direct motor control
  35. \c;\l;jet\u cbot\jet;        \n;Direct jet engine control
  36. \c;\l;message\u cbot\message;    \n;Displays a message
  37. \c;\l;retobject\u cbot\retobj;  \n;Returns an object from a function
  38. \c;\l;errmode\u cbot\errmode;    \n;Error treatement control
  39. \c;\l;abstime\u cbot\abstime;    \n;Returns the absolute time
  40.  
  41. \t;Instructions about topology:
  42. \c;\l;space\u cbot\space;      \n;Calculates a free space
  43. \c;\l;topo\u cbot\topo;       \n;Returns the altitude of a point
  44. \c;\l;flatground\u cbot\flatgrnd; \n;Returns radius of a flat area
  45.  
  46. \t;Instructions specific to some bots:
  47. \c;\l;grab\u cbot\grab;       \n;Picks up an object
  48. \c;\l;drop\u cbot\drop;       \n;Puts down an object
  49. \c;\l;sniff\u cbot\sniff;      \n;Sounds the subsoil
  50. \c;\l;thump\u cbot\thump;      \n;Overturns alien insects
  51. \c;\l;recycle\u cbot\recycle;    \n;Recycles a derelict bot
  52. \c;\l;shield\u cbot\shield;     \n;Extends or withdraws the shield
  53. \c;\l;fire\u cbot\fire;       \n;Fires the cannon
  54. \c;\l;aim\u cbot\aim;        \n;Vertical angle of the cannon
  55.  
  56. \t;Specific instructions for exchange posts:
  57. \c;\l;receive\u cbot\receive;    \n;Receives an information
  58. \c;\l;send\u cbot\send;       \n;Sends a new information
  59. \c;\l;testinfo\u cbot\testinfo;   \n;Tests if an information exists
  60. \c;\l;deleteinfo\u cbot\delinfo; \n;Deletes an existing information
  61.  
  62. \t;See also
  63. \l;Types\u cbot\type; and \l;categories\u cbot\category;.
  64.