Changes between Version 1 and Version 2 of ControlSystems/SoftwareTeam/Training/VirtualTraining/JuniorRobot


Ignore:
Timestamp:
Aug 31, 2020, 11:41:55 PM (5 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/VirtualTraining/JuniorRobot

    v1 v2  
    11== Junior Robot ==
    2 In the last lesson, we tested a basic "Junior Robot" that was created for us.  In this lesson, we'll examine the structure of that robot.  This lesson will touch lightly on many topics that we will explore in detail in subsequent lessons.  Don't expect to understand everything in detail yet; it will become clear over time.
     2In the last lesson, we created and tested a basic "Junior Robot".  In this lesson, we'll examine the structure of that robot.  This lesson will touch lightly on many topics that we will explore in detail in subsequent lessons.  Don't expect to understand everything in detail yet; it will become clear over time.
    33
    44=== Packages ===
     
    77}}}
    88In Java, related things are grouped together into ''packages''. 
    9 Examples of related things include: all the robots written by Alice or all the robots written by team 2537 or a set of software tools to make robots (like robocode).  Keeping related things in separate packages helps prevent "naming conflicts"; team2537 and team5945 could both create robots named !RoboJojo and battle them without confusion or conflict; they would be referred to as team2537.RoboJojo and team5945.RoboJojo.  You can read more about Java packages [https://www.tutorialspoint.com/java/java_packages.htm here]
     9Examples of related things include: all the robots written by Alice or all the robots written by team 2537 or a set of software tools to make robots (like robocode).  Keeping related things in separate packages helps prevent "naming conflicts"; team2537 and team5945 could both create robots named !RoboJojo and battle them without confusion or conflict; they would be referred to as team2537.!RoboJojo and team5945.!RoboJojo.  You can read more about Java packages [https://www.tutorialspoint.com/java/java_packages.htm here]
    1010
    1111A large part of software development is focused on modularity: keeping related things together '''cohesion''' and avoiding unwanted interactions '''coupling'''.  These concepts underpin much of modern software engineering, keep them in mind as you learn to program.  Packages are an example of how Java helps encourage cohesion and reduce coupling.
     
    2727     */
    2828}}}
    29 In the sample program, a comment is provided to show you where to learn more about robocode and the [https://robocode.sourceforge.io/docs/robocode/robocode/JuniorRobot.html !JuniorRobot] followed by a comment that provides the name of your robot, the author, and typically you'd provide a brief summary of what your robot does.
     29In the sample program, a comment is provided to show you where to learn more about robocode and the [https://robocode.sourceforge.io/docs/robocode/robocode/JuniorRobot.html JuniorRobot] followed by a comment that provides the name of your robot, the author, and typically you'd provide a brief summary of what your robot does.
    3030{{{
    3131// API help : https://robocode.sourceforge.io/docs/robocode/robocode/JuniorRobot.html
     
    4545
    4646=== Methods ===
    47 Methods are the verbs of a programming language; the describe the behaviors of your robot. 
     47Methods are the verbs of a programming language; they describe the behaviors (actions) of your robot. 
    4848
    4949Every robocode robot must have a '''run''' method that defines what the robot will do when it enters the arena and the battle begins. It is good practice to always place a comment at the start of each method that explains what the method does.  For now, just know that you invoke a verb by placing parentheses after it that may include relevant values; for example, to turn the robot 90-degrees to the right you would invoke the method: {{{ turnRight(90); }}} Notice too that a semicolon finishes each invoked method.