[{"data":1,"prerenderedAt":4215},["ShallowReactive",2],{"item-lessons-light-ch25-command-based-programming":3,"item-examples-light-ch25-command-based-programming":444,"item-exercises-light-ch25-command-based-programming":753,"item-lesson-full-ch25-command-based-programming-25.7":1070,"item-example-full-ch25-command-based-programming-25.7":2216,"item-exercise-full-ch25-command-based-programming-25.7":2751},[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304,308,312,316,320,324,328,332,336,340,344,348,352,356,360,364,368,372,376,380,384,388,392,396,400,404,408,412,416,420,424,428,432,436,440],{"path":5,"title":6,"stem":7},"\u002Fshockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1-why-java-for-frc","Why Java for FRC?","shockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1.1-why-java-for-frc",{"path":9,"title":10,"stem":11},"\u002Fshockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers","shockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":13,"title":14,"stem":15},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":17,"title":18,"stem":19},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":21,"title":22,"stem":23},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":25,"title":26,"stem":27},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":29,"title":30,"stem":31},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":33,"title":34,"stem":35},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":37,"title":38,"stem":39},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":41,"title":42,"stem":43},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":45,"title":46,"stem":47},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":49,"title":50,"stem":51},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":53,"title":54,"stem":55},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":57,"title":58,"stem":59},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":61,"title":62,"stem":63},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":65,"title":66,"stem":67},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":69,"title":70,"stem":71},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","Control Structures: if Statements & For Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":73,"title":74,"stem":75},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":77,"title":78,"stem":79},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":81,"title":82,"stem":83},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":85,"title":86,"stem":87},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":89,"title":90,"stem":91},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":93,"title":94,"stem":95},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":97,"title":98,"stem":99},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":101,"title":102,"stem":103},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws)","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":105,"title":106,"stem":107},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F8-while-loops","While Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.8-while-loops",{"path":109,"title":110,"stem":111},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":113,"title":114,"stem":115},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F1-strings","Strings","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.1-strings",{"path":117,"title":118,"stem":119},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F2-string-algorithms","String Algorithms","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.2-string-algorithms",{"path":121,"title":122,"stem":123},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","The Class Blueprint","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":125,"title":126,"stem":127},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":129,"title":130,"stem":131},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":133,"title":134,"stem":135},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":137,"title":138,"stem":139},"\u002Fshockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\"","shockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":141,"title":142,"stem":143},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":145,"title":146,"stem":147},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":149,"title":150,"stem":151},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":153,"title":154,"stem":155},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":157,"title":158,"stem":159},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":161,"title":162,"stem":163},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":165,"title":166,"stem":167},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":169,"title":170,"stem":171},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":173,"title":174,"stem":175},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":177,"title":178,"stem":179},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":181,"title":182,"stem":183},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":185,"title":186,"stem":187},"\u002Fshockwave-curriculum\u002Flessons\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices","shockwave-curriculum\u002Flessons\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":189,"title":190,"stem":191},"\u002Fshockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch","shockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":193,"title":194,"stem":195},"\u002Fshockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas","shockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":197,"title":198,"stem":199},"\u002Fshockwave-curriculum\u002Flessons\u002Fch14-why-design-patterns\u002F14-why-design-patterns","Why Design Patterns?","shockwave-curriculum\u002Flessons\u002Fch14-why-design-patterns\u002F14-why-design-patterns",{"path":201,"title":202,"stem":203},"\u002Fshockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap)","shockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":205,"title":206,"stem":207},"\u002Fshockwave-curriculum\u002Flessons\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics","shockwave-curriculum\u002Flessons\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":209,"title":210,"stem":211},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":213,"title":214,"stem":215},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":217,"title":218,"stem":219},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":221,"title":222,"stem":223},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":225,"title":226,"stem":227},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":229,"title":230,"stem":231},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":233,"title":234,"stem":235},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":237,"title":238,"stem":239},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":241,"title":242,"stem":243},"\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts","shockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":245,"title":246,"stem":247},"\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References","shockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":249,"title":250,"stem":251},"\u002Fshockwave-curriculum\u002Flessons\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern","shockwave-curriculum\u002Flessons\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":253,"title":254,"stem":255},"\u002Fshockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories","Static Factories","shockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories",{"path":257,"title":258,"stem":259},"\u002Fshockwave-curriculum\u002Flessons\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern","shockwave-curriculum\u002Flessons\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":261,"title":262,"stem":263},"\u002Fshockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability","shockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":265,"title":266,"stem":267},"\u002Fshockwave-curriculum\u002Flessons\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions","shockwave-curriculum\u002Flessons\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":269,"title":270,"stem":271},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming?","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":273,"title":274,"stem":275},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":277,"title":278,"stem":279},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":281,"title":282,"stem":283},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":285,"title":286,"stem":287},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":289,"title":290,"stem":291},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":293,"title":294,"stem":295},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":297,"title":298,"stem":299},"\u002Fshockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways","shockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":301,"title":302,"stem":303},"\u002Fshockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design","shockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":305,"title":306,"stem":307},"\u002Fshockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F2-impact-of-program-design","Impact of Program Design","shockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F27.2-impact-of-program-design",{"path":309,"title":310,"stem":311},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":313,"title":314,"stem":315},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":317,"title":318,"stem":319},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":321,"title":322,"stem":323},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",{"path":325,"title":326,"stem":327},"\u002Fshockwave-curriculum\u002Flessons\u002Fch29-git-and-github-basics\u002F1-coming-soon","Git & GitHub Basics — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch29-git-and-github-basics\u002F29.1-coming-soon",{"path":329,"title":330,"stem":331},"\u002Fshockwave-curriculum\u002Flessons\u002Fch30-git-history-and-merging\u002F1-coming-soon","Git — History & Merging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch30-git-history-and-merging\u002F30.1-coming-soon",{"path":333,"title":334,"stem":335},"\u002Fshockwave-curriculum\u002Flessons\u002Fch31-dev-environment-and-tooling\u002F1-coming-soon","Dev Environment & Tooling — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch31-dev-environment-and-tooling\u002F31.1-coming-soon",{"path":337,"title":338,"stem":339},"\u002Fshockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F1-coming-soon","Unit Testing — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F32.1-coming-soon",{"path":341,"title":342,"stem":343},"\u002Fshockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F1-coming-soon","AdvantageKit — AutoLogging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F33.1-coming-soon",{"path":345,"title":346,"stem":347},"\u002Fshockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F1-coming-soon","Log Replay — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F34.1-coming-soon",{"path":349,"title":350,"stem":351},"\u002Fshockwave-curriculum\u002Flessons\u002Fch35-advantagescope-i-visualization\u002F1-coming-soon","AdvantageScope I: Visualization — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch35-advantagescope-i-visualization\u002F35.1-coming-soon",{"path":353,"title":354,"stem":355},"\u002Fshockwave-curriculum\u002Flessons\u002Fch36-advantagescope-ii-custom-3d-assets\u002F1-coming-soon","AdvantageScope II: Custom 3D Assets — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch36-advantagescope-ii-custom-3d-assets\u002F36.1-coming-soon",{"path":357,"title":358,"stem":359},"\u002Fshockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F1-coming-soon","Autonomous I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F37.1-coming-soon",{"path":361,"title":362,"stem":363},"\u002Fshockwave-curriculum\u002Flessons\u002Fch38-autonomous-ii-pathplanner-and-trajectories\u002F1-coming-soon","Autonomous II: PathPlanner & Trajectories — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch38-autonomous-ii-pathplanner-and-trajectories\u002F38.1-coming-soon",{"path":365,"title":366,"stem":367},"\u002Fshockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F1-coming-soon","Control Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F39.1-coming-soon",{"path":369,"title":370,"stem":371},"\u002Fshockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F1-coming-soon","Motion Profiles — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F40.1-coming-soon",{"path":373,"title":374,"stem":375},"\u002Fshockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F1-coming-soon","Hardware Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F41.1-coming-soon",{"path":377,"title":378,"stem":379},"\u002Fshockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F1-coming-soon","PhotonVision — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F42.1-coming-soon",{"path":381,"title":382,"stem":383},"\u002Fshockwave-curriculum\u002Flessons\u002Fch43-apriltags-and-pose\u002F1-coming-soon","AprilTags & Pose — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch43-apriltags-and-pose\u002F43.1-coming-soon",{"path":385,"title":386,"stem":387},"\u002Fshockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F1-coming-soon","Subsystems I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F44.1-coming-soon",{"path":389,"title":390,"stem":391},"\u002Fshockwave-curriculum\u002Flessons\u002Fch45-subsystems-ii-advanced\u002F1-coming-soon","Subsystems II — Advanced — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch45-subsystems-ii-advanced\u002F45.1-coming-soon",{"path":393,"title":394,"stem":395},"\u002Fshockwave-curriculum\u002Flessons\u002Fch46-team-utilities-i\u002F1-coming-soon","Team Utilities I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch46-team-utilities-i\u002F46.1-coming-soon",{"path":397,"title":398,"stem":399},"\u002Fshockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F1-coming-soon","Field Constants — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F47.1-coming-soon",{"path":401,"title":402,"stem":403},"\u002Fshockwave-curriculum\u002Flessons\u002Fch48-troubleshooting-i-runtime-debug\u002F1-coming-soon","Troubleshooting I — Runtime Debug — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch48-troubleshooting-i-runtime-debug\u002F48.1-coming-soon",{"path":405,"title":406,"stem":407},"\u002Fshockwave-curriculum\u002Flessons\u002Fch49-troubleshooting-ii-can-and-sim\u002F1-coming-soon","Troubleshooting II: CAN & Sim — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch49-troubleshooting-ii-can-and-sim\u002F49.1-coming-soon",{"path":409,"title":410,"stem":411},"\u002Fshockwave-curriculum\u002Flessons\u002Fch50-vendor-libraries-talonfx\u002F1-coming-soon","Vendor Libraries: TalonFX — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch50-vendor-libraries-talonfx\u002F50.1-coming-soon",{"path":413,"title":414,"stem":415},"\u002Fshockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F1-coming-soon","Robot Alerts — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F51.1-coming-soon",{"path":417,"title":418,"stem":419},"\u002Fshockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F1-coming-soon","WPILib Commands — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F52.1-coming-soon",{"path":421,"title":422,"stem":423},"\u002Fshockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F1-coming-soon","WPILib Geometry — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F53.1-coming-soon",{"path":425,"title":426,"stem":427},"\u002Fshockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F1-coming-soon","NetworkTables — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F54.1-coming-soon",{"path":429,"title":430,"stem":431},"\u002Fshockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F1-coming-soon","Command Scheduler — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F55.1-coming-soon",{"path":433,"title":434,"stem":435},"\u002Fshockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F1-coming-soon","WPILib Timers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F56.1-coming-soon",{"path":437,"title":438,"stem":439},"\u002Fshockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F1-coming-soon","WPILib Triggers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F57.1-coming-soon",{"path":441,"title":442,"stem":443},"\u002Fshockwave-curriculum\u002Flessons\u002Fch58-vendor-units-and-conversions\u002F1-coming-soon","Vendor Units & Conversions — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch58-vendor-units-and-conversions\u002F58.1-coming-soon",[445,449,453,457,461,465,469,473,477,481,485,489,493,497,501,505,509,513,517,521,525,529,533,537,541,545,549,553,557,561,565,569,573,577,581,585,589,593,597,601,605,609,613,617,621,625,629,633,637,641,645,649,653,657,661,665,669,673,677,681,685,689,693,697,701,705,709,713,717,721,725,729,733,737,741,745,749],{"path":446,"title":447,"stem":448},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":450,"title":451,"stem":452},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":454,"title":455,"stem":456},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":458,"title":459,"stem":460},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":462,"title":463,"stem":464},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":466,"title":467,"stem":468},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":470,"title":471,"stem":472},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":474,"title":475,"stem":476},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":478,"title":479,"stem":480},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":482,"title":483,"stem":484},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":486,"title":487,"stem":488},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":490,"title":491,"stem":492},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":494,"title":495,"stem":496},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":498,"title":499,"stem":500},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":502,"title":503,"stem":504},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":506,"title":507,"stem":508},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","if Statements & For Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":510,"title":511,"stem":512},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":514,"title":515,"stem":516},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":518,"title":519,"stem":520},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":522,"title":523,"stem":524},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":526,"title":527,"stem":528},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":530,"title":531,"stem":532},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":534,"title":535,"stem":536},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":538,"title":539,"stem":540},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws) — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":542,"title":543,"stem":544},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F8-while-loops","While Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.8-while-loops",{"path":546,"title":547,"stem":548},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":550,"title":551,"stem":552},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F1-strings","Strings — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.1-strings",{"path":554,"title":555,"stem":556},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.2-string-algorithms",{"path":558,"title":559,"stem":560},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","Anatomy of a Java Class — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":562,"title":563,"stem":564},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":566,"title":567,"stem":568},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":570,"title":571,"stem":572},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":574,"title":575,"stem":576},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\" — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":578,"title":579,"stem":580},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":582,"title":583,"stem":584},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":586,"title":587,"stem":588},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":590,"title":591,"stem":592},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":594,"title":595,"stem":596},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":598,"title":599,"stem":600},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":602,"title":603,"stem":604},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":606,"title":607,"stem":608},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":610,"title":611,"stem":612},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":614,"title":615,"stem":616},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":618,"title":619,"stem":620},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":622,"title":623,"stem":624},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":626,"title":627,"stem":628},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":630,"title":631,"stem":632},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":634,"title":635,"stem":636},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap) — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":638,"title":639,"stem":640},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":642,"title":643,"stem":644},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":646,"title":647,"stem":648},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":650,"title":651,"stem":652},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":654,"title":655,"stem":656},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":658,"title":659,"stem":660},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":662,"title":663,"stem":664},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":666,"title":667,"stem":668},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":670,"title":671,"stem":672},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":674,"title":675,"stem":676},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":678,"title":679,"stem":680},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":682,"title":683,"stem":684},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":686,"title":687,"stem":688},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch21-static-factories\u002F21-static-factories","Static Factories — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch21-static-factories\u002F21-static-factories",{"path":690,"title":691,"stem":692},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":694,"title":695,"stem":696},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":698,"title":699,"stem":700},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":702,"title":703,"stem":704},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming? — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":706,"title":707,"stem":708},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":710,"title":711,"stem":712},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":714,"title":715,"stem":716},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":718,"title":719,"stem":720},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":722,"title":723,"stem":724},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":726,"title":727,"stem":728},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":730,"title":731,"stem":732},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":734,"title":735,"stem":736},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":738,"title":739,"stem":740},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":742,"title":743,"stem":744},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":746,"title":747,"stem":748},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":750,"title":751,"stem":752},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",[754,758,762,766,770,774,778,782,786,790,794,798,802,806,810,814,818,822,826,830,834,838,842,846,850,854,858,862,866,870,874,878,882,886,890,894,898,902,906,910,914,918,922,926,930,934,938,942,946,950,954,958,962,966,970,974,978,982,986,990,994,998,1002,1006,1010,1014,1018,1022,1026,1030,1034,1038,1042,1046,1050,1054,1058,1062,1066],{"path":755,"title":756,"stem":757},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":759,"title":760,"stem":761},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":763,"title":764,"stem":765},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":767,"title":768,"stem":769},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":771,"title":772,"stem":773},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":775,"title":776,"stem":777},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":779,"title":780,"stem":781},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":783,"title":784,"stem":785},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":787,"title":788,"stem":789},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":791,"title":792,"stem":793},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":795,"title":796,"stem":797},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":799,"title":800,"stem":801},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":803,"title":804,"stem":805},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":807,"title":808,"stem":809},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":811,"title":812,"stem":813},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":815,"title":816,"stem":817},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","if Statements & For Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":819,"title":820,"stem":821},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":823,"title":824,"stem":825},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":827,"title":828,"stem":829},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":831,"title":832,"stem":833},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":835,"title":836,"stem":837},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":839,"title":840,"stem":841},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":843,"title":844,"stem":845},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":847,"title":848,"stem":849},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws) — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":851,"title":852,"stem":853},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F8-while-loops","While Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.8-while-loops",{"path":855,"title":856,"stem":857},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":859,"title":860,"stem":861},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F1-strings","Strings — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.1-strings",{"path":863,"title":864,"stem":865},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.2-string-algorithms",{"path":867,"title":868,"stem":869},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","Anatomy of a Java Class — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":871,"title":872,"stem":873},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":875,"title":876,"stem":877},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":879,"title":880,"stem":881},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":883,"title":884,"stem":885},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\" — Exercises","shockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":887,"title":888,"stem":889},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":891,"title":892,"stem":893},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":895,"title":896,"stem":897},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":899,"title":900,"stem":901},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":903,"title":904,"stem":905},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":907,"title":908,"stem":909},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":911,"title":912,"stem":913},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":915,"title":916,"stem":917},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":919,"title":920,"stem":921},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":923,"title":924,"stem":925},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":927,"title":928,"stem":929},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":931,"title":932,"stem":933},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices — Exercises","shockwave-curriculum\u002Fexercises\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":935,"title":936,"stem":937},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch — Exercises","shockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":939,"title":940,"stem":941},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas — Exercises","shockwave-curriculum\u002Fexercises\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":943,"title":944,"stem":945},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch14-why-design-patterns\u002F14-why-design-patterns","Why Design Patterns? — Exercises","shockwave-curriculum\u002Fexercises\u002Fch14-why-design-patterns\u002F14-why-design-patterns",{"path":947,"title":948,"stem":949},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap) — Exercises","shockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":951,"title":952,"stem":953},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics — Exercises","shockwave-curriculum\u002Fexercises\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":955,"title":956,"stem":957},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":959,"title":960,"stem":961},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":963,"title":964,"stem":965},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":967,"title":968,"stem":969},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":971,"title":972,"stem":973},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":975,"title":976,"stem":977},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":979,"title":980,"stem":981},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":983,"title":984,"stem":985},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":987,"title":988,"stem":989},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts — Exercises","shockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":991,"title":992,"stem":993},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References — Exercises","shockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":995,"title":996,"stem":997},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern — Exercises","shockwave-curriculum\u002Fexercises\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":999,"title":1000,"stem":1001},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch21-static-factories\u002F21-static-factories","Static Factories — Exercises","shockwave-curriculum\u002Fexercises\u002Fch21-static-factories\u002F21-static-factories",{"path":1003,"title":1004,"stem":1005},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern — Exercises","shockwave-curriculum\u002Fexercises\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":1007,"title":1008,"stem":1009},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability — Exercises","shockwave-curriculum\u002Fexercises\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":1011,"title":1012,"stem":1013},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":1015,"title":1016,"stem":1017},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming? — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":1019,"title":1020,"stem":1021},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":1023,"title":1024,"stem":1025},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":1027,"title":1028,"stem":1029},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":1031,"title":1032,"stem":1033},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":1035,"title":1036,"stem":1037},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":1039,"title":1040,"stem":1041},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":1043,"title":1044,"stem":1045},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways — Exercises","shockwave-curriculum\u002Fexercises\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":1047,"title":1048,"stem":1049},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design — Exercises","shockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":1051,"title":1052,"stem":1053},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F2-impact-of-program-design","Impact of Program Design — Exercises","shockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F27.2-impact-of-program-design",{"path":1055,"title":1056,"stem":1057},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":1059,"title":1060,"stem":1061},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":1063,"title":1064,"stem":1065},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":1067,"title":1068,"stem":1069},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",{"id":1071,"title":294,"body":1072,"description":1107,"extension":2210,"meta":2211,"navigation":1197,"path":293,"seo":2214,"stem":295,"__hash__":2215},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project.md",{"type":1073,"value":1074,"toc":2200},"minimark",[1075,1079,1084,1098,1108,1122,1129,1133,1141,1262,1273,1280,1284,1302,1343,1355,1431,1438,1448,1452,1480,1497,1501,1504,1541,1597,1648,1655,1659,1674,1677,1821,2019,2030,2034,2087,2091,2160,2196],[1076,1077,294],"h1",{"id":1078},"structuring-a-command-based-robot-project",[1080,1081,1083],"h2",{"id":1082},"the-standard-project-shape","The Standard Project Shape",[1085,1086,1087,1088,1092,1093,1097],"p",{},"WPILib 2027's official Commands v3 project template organizes a robot around a thin ",[1089,1090,1091],"code",{},"Robot"," class, one class per ",[1094,1095,1096],"strong",{},"opmode",", and two packages:",[1099,1100,1105],"pre",{"className":1101,"code":1103,"language":1104},[1102],"language-text","Robot.java          the entry point: mechanisms, controllers, and the scheduler call\nExampleAuto.java    an autonomous opmode, marked @Autonomous\nExampleTeleop.java  a teleop opmode, marked @Teleop\nconstants\u002F          one small constants class per topic, like DriverConstants\nmechanisms\u002F         one file per mechanism, like ExampleMechanism\n","text",[1089,1106,1103],{"__ignoreMap":1107},"",[1085,1109,1110,1111,1113,1114,1117,1118,1121],{},"An ",[1094,1112,1096],{}," is one selectable mode of robot behavior — \"Score and Back Up\" or \"Two-Piece Auto\" for autonomous, \"Driver Teleop\" for teleop. The drive team picks one on the Driver Station before enabling. Package names are lowercase (",[1089,1115,1116],{},"constants",", ",[1089,1119,1120],{},"mechanisms","), like every Java package.",[1085,1123,1124,1125,1128],{},"Alpha note: this ",[1089,1126,1127],{},"OpModeRobot"," framework is new for 2027 (it's been in the template since June 2026), so details may still shift before the season.",[1080,1130,1132],{"id":1131},"robot-deliberately-thin","Robot: Deliberately Thin",[1085,1134,1135,1137,1138,1140],{},[1089,1136,1091],{}," extends WPILib's ",[1089,1139,1127],{},". It creates the mechanisms and controllers, sets the default commands that apply in every mode, and runs the scheduler — and almost nothing else:",[1099,1142,1146],{"className":1143,"code":1144,"language":1145,"meta":1107,"style":1107},"language-java shiki shiki-themes github-light github-dark","public class Robot extends OpModeRobot\n{\n    final CommandXboxController driverController =\n        new CommandXboxController(DriverConstants.DRIVER_CONTROLLER_PORT);\n    final Intake intake = new Intake(driverController.a(), driverController.b());\n    final Drive drive = new Drive();\n    final Shooter shooter = new Shooter();\n\n    public Robot()\n    {\n        intake.setDefaultCommand(intake.stateMachineCommand()); \u002F\u002F Lesson 25.5's machine\n    }\n\n    @Override\n    public void robotPeriodic()\n    {\n        Scheduler.getDefault().run(); \u002F\u002F the most important line in the project\n    }\n}\n","java",[1089,1147,1148,1156,1162,1168,1174,1180,1186,1192,1199,1205,1211,1217,1223,1228,1234,1240,1245,1251,1256],{"__ignoreMap":1107},[1149,1150,1153],"span",{"class":1151,"line":1152},"line",1,[1149,1154,1155],{},"public class Robot extends OpModeRobot\n",[1149,1157,1159],{"class":1151,"line":1158},2,[1149,1160,1161],{},"{\n",[1149,1163,1165],{"class":1151,"line":1164},3,[1149,1166,1167],{},"    final CommandXboxController driverController =\n",[1149,1169,1171],{"class":1151,"line":1170},4,[1149,1172,1173],{},"        new CommandXboxController(DriverConstants.DRIVER_CONTROLLER_PORT);\n",[1149,1175,1177],{"class":1151,"line":1176},5,[1149,1178,1179],{},"    final Intake intake = new Intake(driverController.a(), driverController.b());\n",[1149,1181,1183],{"class":1151,"line":1182},6,[1149,1184,1185],{},"    final Drive drive = new Drive();\n",[1149,1187,1189],{"class":1151,"line":1188},7,[1149,1190,1191],{},"    final Shooter shooter = new Shooter();\n",[1149,1193,1195],{"class":1151,"line":1194},8,[1149,1196,1198],{"emptyLinePlaceholder":1197},true,"\n",[1149,1200,1202],{"class":1151,"line":1201},9,[1149,1203,1204],{},"    public Robot()\n",[1149,1206,1208],{"class":1151,"line":1207},10,[1149,1209,1210],{},"    {\n",[1149,1212,1214],{"class":1151,"line":1213},11,[1149,1215,1216],{},"        intake.setDefaultCommand(intake.stateMachineCommand()); \u002F\u002F Lesson 25.5's machine\n",[1149,1218,1220],{"class":1151,"line":1219},12,[1149,1221,1222],{},"    }\n",[1149,1224,1226],{"class":1151,"line":1225},13,[1149,1227,1198],{"emptyLinePlaceholder":1197},[1149,1229,1231],{"class":1151,"line":1230},14,[1149,1232,1233],{},"    @Override\n",[1149,1235,1237],{"class":1151,"line":1236},15,[1149,1238,1239],{},"    public void robotPeriodic()\n",[1149,1241,1243],{"class":1151,"line":1242},16,[1149,1244,1210],{},[1149,1246,1248],{"class":1151,"line":1247},17,[1149,1249,1250],{},"        Scheduler.getDefault().run(); \u002F\u002F the most important line in the project\n",[1149,1252,1254],{"class":1151,"line":1253},18,[1149,1255,1222],{},[1149,1257,1259],{"class":1151,"line":1258},19,[1149,1260,1261],{},"}\n",[1085,1263,1264,1265,1268,1269,1272],{},"The fields are ",[1089,1266,1267],{},"final",", so nothing can ever swap in a different intake, and they deliberately have no access modifier: package-private access (Ch.23) lets the opmode classes in the same package read ",[1089,1270,1271],{},"robot.intake",", while code outside the package can't. The controller is declared first because the intake's constructor uses its buttons — field initializers run top to bottom.",[1085,1274,1275,1276,1279],{},"Piling large amounts of imperative logic directly into ",[1089,1277,1278],{},"Robot.java"," fights the entire declarative philosophy (Lesson 25.1) — mode-specific setup belongs in the opmodes.",[1080,1281,1283],{"id":1282},"opmodes-one-class-per-mode","OpModes: One Class per Mode",[1085,1285,1286,1287,1290,1291,1294,1295,1298,1299,1301],{},"An opmode is a class that implements WPILib's ",[1089,1288,1289],{},"OpMode"," interface and is marked with an annotation — ",[1089,1292,1293],{},"@Autonomous"," or ",[1089,1296,1297],{},"@Teleop"," — so the framework finds it automatically. Its constructor receives the ",[1089,1300,1091],{},", which is how it reaches the mechanisms:",[1099,1303,1305],{"className":1143,"code":1304,"language":1145,"meta":1107,"style":1107},"@Teleop\npublic class DriverTeleop implements OpMode\n{\n    public DriverTeleop(Robot robot)\n    {\n        robot.driverController.rightBumper().whileTrue(robot.intake.ejectCommand());\n    }\n}\n",[1089,1306,1307,1312,1317,1321,1326,1330,1335,1339],{"__ignoreMap":1107},[1149,1308,1309],{"class":1151,"line":1152},[1149,1310,1311],{},"@Teleop\n",[1149,1313,1314],{"class":1151,"line":1158},[1149,1315,1316],{},"public class DriverTeleop implements OpMode\n",[1149,1318,1319],{"class":1151,"line":1164},[1149,1320,1161],{},[1149,1322,1323],{"class":1151,"line":1170},[1149,1324,1325],{},"    public DriverTeleop(Robot robot)\n",[1149,1327,1328],{"class":1151,"line":1176},[1149,1329,1210],{},[1149,1331,1332],{"class":1151,"line":1182},[1149,1333,1334],{},"        robot.driverController.rightBumper().whileTrue(robot.intake.ejectCommand());\n",[1149,1336,1337],{"class":1151,"line":1188},[1149,1338,1222],{},[1149,1340,1341],{"class":1151,"line":1194},[1149,1342,1261],{},[1085,1344,1345,1346,1350,1351,1354],{},"The framework constructs an opmode when it's ",[1347,1348,1349],"em",{},"selected"," on the Driver Station. Bindings made in its constructor belong to that opmode's scope (Lesson 25.3): they only work while it's selected, so each teleop opmode can map the buttons its own way. An autonomous opmode usually schedules its routine in ",[1089,1352,1353],{},"start()",", which runs once, when the robot is enabled:",[1099,1356,1358],{"className":1143,"code":1357,"language":1145,"meta":1107,"style":1107},"@Autonomous(name = \"Drive Then Shoot\")\npublic class DriveThenShoot implements OpMode\n{\n    private final Command routine;\n\n    public DriveThenShoot(Robot robot)\n    {\n        routine = Autos.driveThenShoot(robot.drive, robot.shooter);\n    }\n\n    @Override\n    public void start()\n    {\n        Scheduler.getDefault().schedule(routine);\n    }\n}\n",[1089,1359,1360,1365,1370,1374,1379,1383,1388,1392,1397,1401,1405,1409,1414,1418,1423,1427],{"__ignoreMap":1107},[1149,1361,1362],{"class":1151,"line":1152},[1149,1363,1364],{},"@Autonomous(name = \"Drive Then Shoot\")\n",[1149,1366,1367],{"class":1151,"line":1158},[1149,1368,1369],{},"public class DriveThenShoot implements OpMode\n",[1149,1371,1372],{"class":1151,"line":1164},[1149,1373,1161],{},[1149,1375,1376],{"class":1151,"line":1170},[1149,1377,1378],{},"    private final Command routine;\n",[1149,1380,1381],{"class":1151,"line":1176},[1149,1382,1198],{"emptyLinePlaceholder":1197},[1149,1384,1385],{"class":1151,"line":1182},[1149,1386,1387],{},"    public DriveThenShoot(Robot robot)\n",[1149,1389,1390],{"class":1151,"line":1188},[1149,1391,1210],{},[1149,1393,1394],{"class":1151,"line":1194},[1149,1395,1396],{},"        routine = Autos.driveThenShoot(robot.drive, robot.shooter);\n",[1149,1398,1399],{"class":1151,"line":1201},[1149,1400,1222],{},[1149,1402,1403],{"class":1151,"line":1207},[1149,1404,1198],{"emptyLinePlaceholder":1197},[1149,1406,1407],{"class":1151,"line":1213},[1149,1408,1233],{},[1149,1410,1411],{"class":1151,"line":1219},[1149,1412,1413],{},"    public void start()\n",[1149,1415,1416],{"class":1151,"line":1225},[1149,1417,1210],{},[1149,1419,1420],{"class":1151,"line":1230},[1149,1421,1422],{},"        Scheduler.getDefault().schedule(routine);\n",[1149,1424,1425],{"class":1151,"line":1236},[1149,1426,1222],{},[1149,1428,1429],{"class":1151,"line":1242},[1149,1430,1261],{},[1085,1432,1433,1434,1437],{},"Because the routine is scheduled inside the autonomous opmode, the scheduler cancels it automatically when autonomous ends — there's no separate \"cancel autonomous when teleop starts\" step. The ",[1089,1435,1436],{},"name"," shown on the Driver Station defaults to the class name if you leave it out.",[1085,1439,1440,1441,1443,1444,1447],{},"Passing the ",[1089,1442,1091],{}," into each opmode's constructor is ",[1094,1445,1446],{},"dependency injection"," (first seen in Lesson 25.2's factories): each opmode is handed exactly what it works with, instead of reaching for global variables.",[1080,1449,1451],{"id":1450},"constants-one-place-for-every-tunable-number","Constants: One Place for Every Tunable Number",[1099,1453,1455],{"className":1143,"code":1454,"language":1145,"meta":1107,"style":1107},"public final class IntakeConstants\n{\n    public static final int MOTOR_CHANNEL = 5; \u002F\u002F PWM channel\n    public static final double INTAKE_SPEED = 0.8;\n}\n",[1089,1456,1457,1462,1466,1471,1476],{"__ignoreMap":1107},[1149,1458,1459],{"class":1151,"line":1152},[1149,1460,1461],{},"public final class IntakeConstants\n",[1149,1463,1464],{"class":1151,"line":1158},[1149,1465,1161],{},[1149,1467,1468],{"class":1151,"line":1164},[1149,1469,1470],{},"    public static final int MOTOR_CHANNEL = 5; \u002F\u002F PWM channel\n",[1149,1472,1473],{"class":1151,"line":1170},[1149,1474,1475],{},"    public static final double INTAKE_SPEED = 0.8;\n",[1149,1477,1478],{"class":1151,"line":1176},[1149,1479,1261],{},[1085,1481,1482,1483,1486,1487,1490,1491,1493,1494,1496],{},"Every constant is ",[1089,1484,1485],{},"public static final"," and named in ALL_CAPS — the constants convention from Lesson 7.4, which WPILib 2027's own template uses too (",[1089,1488,1489],{},"DRIVER_CONTROLLER_PORT","). The template gives each topic its own small class in the ",[1089,1492,1116],{}," package; marking the class ",[1089,1495,1267],{}," means nothing can extend it. Changing one tunable value, like the intake speed, means editing exactly one line.",[1080,1498,1500],{"id":1499},"choosing-how-to-define-a-reusable-command","Choosing How to Define a Reusable Command",[1085,1502,1503],{},"For a command that's used in more than one place (a button binding, an autonomous routine, a self-test), a few options exist, each suited to a different case:",[1505,1506,1507,1522,1532],"ul",{},[1508,1509,1510,1513,1514,1517,1518,1521],"li",{},[1094,1511,1512],{},"Instance factory method on a single mechanism"," (the ",[1089,1515,1516],{},"run(...)"," factories from Lesson 25.2) — best for a command tied to exactly one mechanism: ",[1089,1519,1520],{},"shooter.spinUpCommand()",".",[1508,1523,1524,1527,1528,1531],{},[1094,1525,1526],{},"Static factory method"," (Ch.21) — best when a command needs to coordinate ",[1347,1529,1530],{},"multiple"," mechanisms at once, so it doesn't naturally belong to any single one of them.",[1508,1533,1534,1540],{},[1094,1535,1536,1537],{},"A class that ",[1089,1538,1539],{},"implements Command"," — best when a command needs its own genuine internal state (not mechanism state) or unusually complex logic.",[1099,1542,1544],{"className":1143,"code":1543,"language":1145,"meta":1107,"style":1107},"public class Shooter implements Mechanism\n{\n    \u002F\u002F built with run(...), so it implicitly requires `this` shooter\n    public Command spinUpCommand()\n    {\n        return run(coroutine -> {\n            setSpeed(ShooterConstants.SPIN_SPEED);\n            coroutine.park();\n        }).whenExited(() -> setSpeed(0.0)).named(\"Spin Up\");\n    }\n}\n",[1089,1545,1546,1551,1555,1560,1565,1569,1574,1579,1584,1589,1593],{"__ignoreMap":1107},[1149,1547,1548],{"class":1151,"line":1152},[1149,1549,1550],{},"public class Shooter implements Mechanism\n",[1149,1552,1553],{"class":1151,"line":1158},[1149,1554,1161],{},[1149,1556,1557],{"class":1151,"line":1164},[1149,1558,1559],{},"    \u002F\u002F built with run(...), so it implicitly requires `this` shooter\n",[1149,1561,1562],{"class":1151,"line":1170},[1149,1563,1564],{},"    public Command spinUpCommand()\n",[1149,1566,1567],{"class":1151,"line":1176},[1149,1568,1210],{},[1149,1570,1571],{"class":1151,"line":1182},[1149,1572,1573],{},"        return run(coroutine -> {\n",[1149,1575,1576],{"class":1151,"line":1188},[1149,1577,1578],{},"            setSpeed(ShooterConstants.SPIN_SPEED);\n",[1149,1580,1581],{"class":1151,"line":1194},[1149,1582,1583],{},"            coroutine.park();\n",[1149,1585,1586],{"class":1151,"line":1201},[1149,1587,1588],{},"        }).whenExited(() -> setSpeed(0.0)).named(\"Spin Up\");\n",[1149,1590,1591],{"class":1151,"line":1207},[1149,1592,1222],{},[1149,1594,1595],{"class":1151,"line":1213},[1149,1596,1261],{},[1099,1598,1600],{"className":1143,"code":1599,"language":1145,"meta":1107,"style":1107},"public final class Autos\n{\n    public static Command driveThenShoot(Drive drive, Shooter shooter)\n    {\n        return Command.sequence(\n            drive.driveForwardCommand().withTimeout(Seconds.of(2)),\n            shooter.shootCommand()\n        ).named(\"Drive Then Shoot\");\n    }\n}\n",[1089,1601,1602,1607,1611,1616,1620,1625,1630,1635,1640,1644],{"__ignoreMap":1107},[1149,1603,1604],{"class":1151,"line":1152},[1149,1605,1606],{},"public final class Autos\n",[1149,1608,1609],{"class":1151,"line":1158},[1149,1610,1161],{},[1149,1612,1613],{"class":1151,"line":1164},[1149,1614,1615],{},"    public static Command driveThenShoot(Drive drive, Shooter shooter)\n",[1149,1617,1618],{"class":1151,"line":1170},[1149,1619,1210],{},[1149,1621,1622],{"class":1151,"line":1176},[1149,1623,1624],{},"        return Command.sequence(\n",[1149,1626,1627],{"class":1151,"line":1182},[1149,1628,1629],{},"            drive.driveForwardCommand().withTimeout(Seconds.of(2)),\n",[1149,1631,1632],{"class":1151,"line":1188},[1149,1633,1634],{},"            shooter.shootCommand()\n",[1149,1636,1637],{"class":1151,"line":1194},[1149,1638,1639],{},"        ).named(\"Drive Then Shoot\");\n",[1149,1641,1642],{"class":1151,"line":1201},[1149,1643,1222],{},[1149,1645,1646],{"class":1151,"line":1207},[1149,1647,1261],{},[1085,1649,1650,1651,1654],{},"A multi-mechanism routine can also be written in the ",[1089,1652,1653],{},"coroutine.await(...)"," style from Lesson 25.2, so each mechanism is claimed only while its step runs.",[1080,1656,1658],{"id":1657},"reading-commands-v2-code-2026-and-earlier","Reading Commands v2 Code (2026 and Earlier)",[1085,1660,1661,1662,1665,1666,1669,1670,1673],{},"Commands v2 is what most existing team code — including older code of our own — still uses, and it's what most examples online show. This section is for ",[1094,1663,1664],{},"recognizing"," v2 code when you read it, not for writing new code: new code in this course is v3. (In 2026 and earlier, v2 lives in the package ",[1089,1667,1668],{},"edu.wpi.first.wpilibj2.command","; WPILib 2027 still ships it as ",[1089,1671,1672],{},"org.wpilib.command2"," for teams that haven't moved over yet.)",[1085,1675,1676],{},"Here is one v2 mechanism and one v2 command class, with notes on what each piece became:",[1099,1678,1680],{"className":1143,"code":1679,"language":1145,"meta":1107,"style":1107},"\u002F\u002F Commands v2 (2026 and earlier): for recognizing, not for writing new code\npublic class Intake extends SubsystemBase    \u002F\u002F v3: implements Mechanism\n{\n    public Command runCommand()\n    {\n        \u002F\u002F v3: run(...) with park(), plus whenExited(...), plus .named(...)\n        return startEnd(() -> set(0.8), () -> set(0.0));\n    }\n}\n\npublic class FeedUntilLoaded extends Command  \u002F\u002F v3: one factory method with one body\n{\n    private final Intake intake;\n\n    public FeedUntilLoaded(Intake intake)\n    {\n        this.intake = intake;\n        addRequirements(intake);              \u002F\u002F v3: requirements come from the builder\n    }\n\n    @Override\n    public void initialize() { intake.set(0.6); }            \u002F\u002F v3: code before the loop\n\n    @Override\n    public boolean isFinished() { return intake.hasPiece(); } \u002F\u002F v3: the loop condition\n\n    @Override\n    public void end(boolean interrupted) { intake.set(0.0); } \u002F\u002F v3: whenExited(...)\n}\n",[1089,1681,1682,1687,1692,1696,1701,1705,1710,1715,1719,1723,1727,1732,1736,1741,1745,1750,1754,1759,1764,1768,1773,1778,1784,1789,1794,1800,1805,1810,1816],{"__ignoreMap":1107},[1149,1683,1684],{"class":1151,"line":1152},[1149,1685,1686],{},"\u002F\u002F Commands v2 (2026 and earlier): for recognizing, not for writing new code\n",[1149,1688,1689],{"class":1151,"line":1158},[1149,1690,1691],{},"public class Intake extends SubsystemBase    \u002F\u002F v3: implements Mechanism\n",[1149,1693,1694],{"class":1151,"line":1164},[1149,1695,1161],{},[1149,1697,1698],{"class":1151,"line":1170},[1149,1699,1700],{},"    public Command runCommand()\n",[1149,1702,1703],{"class":1151,"line":1176},[1149,1704,1210],{},[1149,1706,1707],{"class":1151,"line":1182},[1149,1708,1709],{},"        \u002F\u002F v3: run(...) with park(), plus whenExited(...), plus .named(...)\n",[1149,1711,1712],{"class":1151,"line":1188},[1149,1713,1714],{},"        return startEnd(() -> set(0.8), () -> set(0.0));\n",[1149,1716,1717],{"class":1151,"line":1194},[1149,1718,1222],{},[1149,1720,1721],{"class":1151,"line":1201},[1149,1722,1261],{},[1149,1724,1725],{"class":1151,"line":1207},[1149,1726,1198],{"emptyLinePlaceholder":1197},[1149,1728,1729],{"class":1151,"line":1213},[1149,1730,1731],{},"public class FeedUntilLoaded extends Command  \u002F\u002F v3: one factory method with one body\n",[1149,1733,1734],{"class":1151,"line":1219},[1149,1735,1161],{},[1149,1737,1738],{"class":1151,"line":1225},[1149,1739,1740],{},"    private final Intake intake;\n",[1149,1742,1743],{"class":1151,"line":1230},[1149,1744,1198],{"emptyLinePlaceholder":1197},[1149,1746,1747],{"class":1151,"line":1236},[1149,1748,1749],{},"    public FeedUntilLoaded(Intake intake)\n",[1149,1751,1752],{"class":1151,"line":1242},[1149,1753,1210],{},[1149,1755,1756],{"class":1151,"line":1247},[1149,1757,1758],{},"        this.intake = intake;\n",[1149,1760,1761],{"class":1151,"line":1253},[1149,1762,1763],{},"        addRequirements(intake);              \u002F\u002F v3: requirements come from the builder\n",[1149,1765,1766],{"class":1151,"line":1258},[1149,1767,1222],{},[1149,1769,1771],{"class":1151,"line":1770},20,[1149,1772,1198],{"emptyLinePlaceholder":1197},[1149,1774,1776],{"class":1151,"line":1775},21,[1149,1777,1233],{},[1149,1779,1781],{"class":1151,"line":1780},22,[1149,1782,1783],{},"    public void initialize() { intake.set(0.6); }            \u002F\u002F v3: code before the loop\n",[1149,1785,1787],{"class":1151,"line":1786},23,[1149,1788,1198],{"emptyLinePlaceholder":1197},[1149,1790,1792],{"class":1151,"line":1791},24,[1149,1793,1233],{},[1149,1795,1797],{"class":1151,"line":1796},25,[1149,1798,1799],{},"    public boolean isFinished() { return intake.hasPiece(); } \u002F\u002F v3: the loop condition\n",[1149,1801,1803],{"class":1151,"line":1802},26,[1149,1804,1198],{"emptyLinePlaceholder":1197},[1149,1806,1808],{"class":1151,"line":1807},27,[1149,1809,1233],{},[1149,1811,1813],{"class":1151,"line":1812},28,[1149,1814,1815],{},"    public void end(boolean interrupted) { intake.set(0.0); } \u002F\u002F v3: whenExited(...)\n",[1149,1817,1819],{"class":1151,"line":1818},29,[1149,1820,1261],{},[1822,1823,1824,1837],"table",{},[1825,1826,1827],"thead",{},[1828,1829,1830,1834],"tr",{},[1831,1832,1833],"th",{},"In v2 code you'll see",[1831,1835,1836],{},"In v3 you write",[1838,1839,1840,1854,1884,1896,1914,1930,1955,1967,1979,1995,2006],"tbody",{},[1828,1841,1842,1848],{},[1843,1844,1845],"td",{},[1089,1846,1847],{},"extends SubsystemBase",[1843,1849,1850,1853],{},[1089,1851,1852],{},"implements Mechanism"," (an interface)",[1828,1855,1856,1870],{},[1843,1857,1858,1117,1861,1117,1864,1117,1867],{},[1089,1859,1860],{},"initialize()",[1089,1862,1863],{},"execute()",[1089,1865,1866],{},"isFinished()",[1089,1868,1869],{},"end(interrupted)",[1843,1871,1872,1873,1876,1877,1880,1881],{},"one coroutine body: code before the loop, a loop ending in ",[1089,1874,1875],{},"coroutine.yield()",", code after, plus ",[1089,1878,1879],{},"whenExited(...)","\u002F",[1089,1882,1883],{},"whenCanceled(...)",[1828,1885,1886,1891],{},[1843,1887,1888],{},[1089,1889,1890],{},"CommandScheduler.getInstance()",[1843,1892,1893],{},[1089,1894,1895],{},"Scheduler.getDefault()",[1828,1897,1898,1903],{},[1843,1899,1900],{},[1089,1901,1902],{},"RobotContainer",[1843,1904,1905,1908,1909,1880,1911,1913],{},[1089,1906,1907],{},"Robot extends OpModeRobot",", plus ",[1089,1910,1293],{},[1089,1912,1297],{}," opmode classes",[1828,1915,1916,1921],{},[1843,1917,1918],{},[1089,1919,1920],{},"addRequirements(...)",[1843,1922,1923,1924,1117,1927],{},"requirements from the builder: ",[1089,1925,1926],{},"mechanism.run(...)",[1089,1928,1929],{},"Command.requiring(...)",[1828,1931,1932,1949],{},[1843,1933,1934,1937,1938,1117,1941,1944,1945,1948],{},[1089,1935,1936],{},"InterruptionBehavior"," (",[1089,1939,1940],{},"CANCEL_SELF",[1089,1942,1943],{},"CANCEL_INCOMING","; ",[1089,1946,1947],{},"kCancelSelf"," in older code)",[1843,1950,1951,1952],{},"priorities: ",[1089,1953,1954],{},".withPriority(...)",[1828,1956,1957,1962],{},[1843,1958,1959],{},[1089,1960,1961],{},"Commands.runOnce(() -> ..., mechanism)",[1843,1963,1964],{},[1089,1965,1966],{},"mechanism.run(coroutine -> ...).named(\"...\")",[1828,1968,1969,1974],{},[1843,1970,1971],{},[1089,1972,1973],{},"withTimeout(1.5)",[1843,1975,1976],{},[1089,1977,1978],{},"withTimeout(Seconds.of(1.5))",[1828,1980,1981,1988],{},[1843,1982,1983,1984,1987],{},"a subsystem's ",[1089,1985,1986],{},"periodic()"," method",[1843,1989,1990,1991,1994],{},"a default command (or ",[1089,1992,1993],{},"addPeriodic(...)"," for data only)",[1828,1996,1997,2003],{},[1843,1998,1999,2000],{},"cancel the auto command in ",[1089,2001,2002],{},"teleopInit()",[1843,2004,2005],{},"nothing to write: scopes cancel it",[1828,2007,2008,2014],{},[1843,2009,2010,2011],{},"constants named like ",[1089,2012,2013],{},"kMotorId",[1843,2015,2010,2016],{},[1089,2017,2018],{},"MOTOR_CHANNEL",[1085,2020,2021,2022,2025,2026,2029],{},"Two more v2 habits you'll spot: v2 commands don't have to be named, and v2 compositions like ",[1089,2023,2024],{},"Commands.sequence(...)"," return a finished command, with no ",[1089,2027,2028],{},".named(...)"," at the end.",[1080,2031,2033],{"id":2032},"common-pitfalls","Common Pitfalls",[1505,2035,2036,2049,2061,2070],{},[1508,2037,2038,2045,2046,2048],{},[1094,2039,2040,2041,2044],{},"Declaring mechanisms as ",[1089,2042,2043],{},"static"," fields for easy access."," Global mechanisms let any code anywhere call their methods directly, bypassing the scheduler's resource management — opmodes reach them through the ",[1089,2047,1091],{}," passed to their constructor instead.",[1508,2050,2051,2054,2055,2057,2058,2060],{},[1094,2052,2053],{},"Scheduling an autonomous routine in the opmode's constructor."," The constructor runs when the opmode is ",[1347,2056,1349],{},", while the robot is still disabled; schedule the routine in ",[1089,2059,1353],{},", which runs when the robot is enabled.",[1508,2062,2063,2069],{},[1094,2064,2065,2066,2068],{},"Scattering constants across many files instead of the ",[1089,2067,1116],{}," package."," Changing one tunable value (like an intake speed) should mean editing exactly one line, not hunting across the codebase.",[1508,2071,2072,2075,2076,1117,2079,2082,2083,2086],{},[1094,2073,2074],{},"Pasting v2 code into a v3 project."," Names like ",[1089,2077,2078],{},"SubsystemBase",[1089,2080,2081],{},"Commands.runOnce",", and ",[1089,2084,2085],{},"CommandScheduler"," don't exist in v3; translate the code with the table above instead of mixing the two frameworks.",[1080,2088,2090],{"id":2089},"key-takeaways","Key Takeaways",[1505,2092,2093,2115,2125,2134,2140,2146],{},[1508,2094,2095,2096,2098,2099,2101,2102,1880,2104,2106,2107,2109,2110,2112,2113,2068],{},"WPILib 2027's Commands v3 template has a thin ",[1089,2097,1091],{}," (extends ",[1089,2100,1127],{},"), one class per opmode (",[1089,2103,1293],{},[1089,2105,1297],{},", implementing ",[1089,2108,1289],{},"), a ",[1089,2111,1116],{}," package, and a ",[1089,2114,1120],{},[1508,2116,2117,2120,2121,2124],{},[1089,2118,2119],{},"Robot.robotPeriodic()"," must call ",[1089,2122,2123],{},"Scheduler.getDefault().run()"," — nothing works without this line.",[1508,2126,2127,2128,2130,2131,2133],{},"Each opmode receives the ",[1089,2129,1091],{}," in its constructor (dependency injection); bindings made there only work while that opmode is selected, and autonomous routines are scheduled in ",[1089,2132,1353],{}," and canceled automatically when the mode ends.",[1508,2135,2136,2137,2139],{},"Constants are ",[1089,2138,1485],{},", ALL_CAPS, grouped by topic.",[1508,2141,2142,2143,2145],{},"Choose how to define a reusable command based on its shape: instance factory (one mechanism), static factory (several mechanisms), or a class that ",[1089,2144,1539],{}," (real internal state or complex logic).",[1508,2147,2148,2149,2151,2152,1117,2155,2082,2157,2159],{},"Most existing team code is Commands v2: recognize ",[1089,2150,2078],{},", the four lifecycle methods, ",[1089,2153,2154],{},"addRequirements",[1089,2156,2085],{},[1089,2158,1902],{},", and translate them to v3 rather than mixing frameworks.",[1085,2161,2162,2163,2166,2167,2170,2171,2174,2175,2178,2179,1937,2182,1117,2185,2188,2189,1117,2192,2195],{},"Derived from ",[1089,2164,2165],{},"other-reference-repo",": ",[1089,2168,2169],{},"wpilib\u002Fcommand-based\u002F04-subsystems.md"," (WPILIB 20.4), ",[1089,2172,2173],{},"06-structuring-command-based-project.md"," (WPILIB 20.6), ",[1089,2176,2177],{},"07-organizing-command-based.md"," (WPILIB 20.7); updated for Commands v3 from allwpilib ",[1089,2180,2181],{},"main",[1089,2183,2184],{},"wpilibjExamples\u002F…\u002Ftemplates\u002Fcommandv3\u002F",[1089,2186,2187],{},"hatchbotcmdv3"," example, ",[1089,2190,2191],{},"wpilibj\u002F…\u002Fframework\u002FOpModeRobot.java",[1089,2193,2194],{},"wpilibj\u002F…\u002Fopmode\u002FOpMode.java",")",[2197,2198,2199],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":1107,"searchDepth":1158,"depth":1158,"links":2201},[2202,2203,2204,2205,2206,2207,2208,2209],{"id":1082,"depth":1158,"text":1083},{"id":1131,"depth":1158,"text":1132},{"id":1282,"depth":1158,"text":1283},{"id":1450,"depth":1158,"text":1451},{"id":1499,"depth":1158,"text":1500},{"id":1657,"depth":1158,"text":1658},{"id":2032,"depth":1158,"text":2033},{"id":2089,"depth":1158,"text":2090},"md",{"outlineRef":2212,"status":2213},"25.7 — Structuring a Command-Based Robot Project (WPILIB 20.4,6-7)","new — authored lesson (rewritten for the WPILib 2027 Commands v3 template; v2 reading section added)",{"title":294,"description":1107},"_Fk3k8WnHOsO5uOS3OyaQYT1gWGDUQgA1h9b5BirDJI",{"id":2217,"title":727,"body":2218,"description":1107,"extension":2210,"meta":2746,"navigation":1197,"path":726,"seo":2749,"stem":728,"__hash__":2750},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project.md",{"type":1073,"value":2219,"toc":2734},[2220,2223,2227,2234,2246,2255,2259,2287,2291,2319,2342,2351,2358,2407,2418,2444,2451,2508,2520,2524,2564,2590,2594,2667,2693,2697,2732],[1076,2221,727],{"id":2222},"structuring-a-command-based-robot-project-worked-example",[1080,2224,2226],{"id":2225},"problem","Problem",[1085,2228,2229,2230,2233],{},"A practice robot has one mechanism: an ",[1089,2231,2232],{},"Arm",", driven by a motor on PWM channel 9. The team wants:",[1505,2235,2236,2243],{},[1508,2237,2238,2239,2242],{},"Holding the operator's ",[1094,2240,2241],{},"left bumper"," raises the arm at 40% speed; releasing it stops the arm.",[1508,2244,2245],{},"In autonomous, the arm raises for 1.5 seconds, then stops.",[1085,2247,2248,2249,2251,2252,2254],{},"Lay out where every piece of this goes in a WPILib 2027 Commands v3 project: the constants, the ",[1089,2250,2232],{}," mechanism, ",[1089,2253,1091],{},", a teleop opmode, and an autonomous opmode.",[1080,2256,2258],{"id":2257},"step-1-plan-it-first","Step 1: Plan It First",[2260,2261,2262,2267,2273,2279,2282],"ol",{},[1508,2263,2264,2265,2068],{},"Put the tunable numbers (motor channel, raise speed, controller port) in the ",[1089,2266,1116],{},[1508,2268,2269,2270,2272],{},"Give ",[1089,2271,2232],{}," an instance factory method for its \"raise\" command, since that command only involves the arm.",[1508,2274,2275,2276,2278],{},"Keep ",[1089,2277,1091],{}," thin: create the controller and the arm, and run the scheduler.",[1508,2280,2281],{},"Bind the bumper in a teleop opmode's constructor.",[1508,2283,2284,2285,1521],{},"Build the timed raise in an autonomous opmode, and schedule it in ",[1089,2286,1353],{},[1080,2288,2290],{"id":2289},"step-2-constants-every-tunable-number-in-one-place","Step 2: Constants — Every Tunable Number in One Place",[1099,2292,2294],{"className":1143,"code":2293,"language":1145,"meta":1107,"style":1107},"public final class ArmConstants\n{\n    public static final int MOTOR_CHANNEL = 9; \u002F\u002F PWM channel\n    public static final double RAISE_SPEED = 0.4;\n}\n",[1089,2295,2296,2301,2305,2310,2315],{"__ignoreMap":1107},[1149,2297,2298],{"class":1151,"line":1152},[1149,2299,2300],{},"public final class ArmConstants\n",[1149,2302,2303],{"class":1151,"line":1158},[1149,2304,1161],{},[1149,2306,2307],{"class":1151,"line":1164},[1149,2308,2309],{},"    public static final int MOTOR_CHANNEL = 9; \u002F\u002F PWM channel\n",[1149,2311,2312],{"class":1151,"line":1170},[1149,2313,2314],{},"    public static final double RAISE_SPEED = 0.4;\n",[1149,2316,2317],{"class":1151,"line":1176},[1149,2318,1261],{},[1099,2320,2322],{"className":1143,"code":2321,"language":1145,"meta":1107,"style":1107},"public final class DriverConstants\n{\n    public static final int OPERATOR_CONTROLLER_PORT = 1;\n}\n",[1089,2323,2324,2329,2333,2338],{"__ignoreMap":1107},[1149,2325,2326],{"class":1151,"line":1152},[1149,2327,2328],{},"public final class DriverConstants\n",[1149,2330,2331],{"class":1151,"line":1158},[1149,2332,1161],{},[1149,2334,2335],{"class":1151,"line":1164},[1149,2336,2337],{},"    public static final int OPERATOR_CONTROLLER_PORT = 1;\n",[1149,2339,2340],{"class":1151,"line":1170},[1149,2341,1261],{},[1085,2343,2344,2345,2347,2348,2350],{},"Both classes live in the ",[1089,2346,1116],{}," package. If the arm moves to a different PWM channel, or the drive team wants it faster, exactly one line changes, and ",[1089,2349,1267],{}," means no code can accidentally reassign either value while the robot runs.",[1080,2352,2354,2355,2357],{"id":2353},"step-3-arm-a-single-mechanism-command-lives-on-the-mechanism","Step 3: ",[1089,2356,2232],{}," — A Single-Mechanism Command Lives on the Mechanism",[1099,2359,2361],{"className":1143,"code":2360,"language":1145,"meta":1107,"style":1107},"public class Arm implements Mechanism\n{\n    public Command raiseCommand()\n    {\n        return run(coroutine -> {\n            set(ArmConstants.RAISE_SPEED);\n            coroutine.park();\n        }).whenExited(() -> set(0.0)).named(\"Raise Arm\");\n    }\n}\n",[1089,2362,2363,2368,2372,2377,2381,2385,2390,2394,2399,2403],{"__ignoreMap":1107},[1149,2364,2365],{"class":1151,"line":1152},[1149,2366,2367],{},"public class Arm implements Mechanism\n",[1149,2369,2370],{"class":1151,"line":1158},[1149,2371,1161],{},[1149,2373,2374],{"class":1151,"line":1164},[1149,2375,2376],{},"    public Command raiseCommand()\n",[1149,2378,2379],{"class":1151,"line":1170},[1149,2380,1210],{},[1149,2382,2383],{"class":1151,"line":1176},[1149,2384,1573],{},[1149,2386,2387],{"class":1151,"line":1182},[1149,2388,2389],{},"            set(ArmConstants.RAISE_SPEED);\n",[1149,2391,2392],{"class":1151,"line":1188},[1149,2393,1583],{},[1149,2395,2396],{"class":1151,"line":1194},[1149,2397,2398],{},"        }).whenExited(() -> set(0.0)).named(\"Raise Arm\");\n",[1149,2400,2401],{"class":1151,"line":1201},[1149,2402,1222],{},[1149,2404,2405],{"class":1151,"line":1207},[1149,2406,1261],{},[1085,2408,2409,2410,2413,2414,2417],{},"(",[1089,2411,2412],{},"set(double speed)"," is the arm's own method for driving its motor on ",[1089,2415,2416],{},"ArmConstants.MOTOR_CHANNEL","; the hardware setup is left out here.)",[1085,2419,2420,2423,2424,2426,2427,2429,2430,2432,2433,2436,2437,2440,2441,2443],{},[1089,2421,2422],{},"raiseCommand()"," only involves the arm, so an instance factory method on ",[1089,2425,2232],{}," is the natural home, in the ",[1089,2428,1120],{}," package. Because it's built with the mechanism's own ",[1089,2431,1516],{},", the command automatically requires ",[1089,2434,2435],{},"this"," arm. ",[1089,2438,2439],{},"park()"," keeps the arm raising until something cancels the command, and ",[1089,2442,1879],{}," stops the motor however the command ends.",[1080,2445,2447,2448,2450],{"id":2446},"step-4-robot-deliberately-thin","Step 4: ",[1089,2449,1091],{}," — Deliberately Thin",[1099,2452,2454],{"className":1143,"code":2453,"language":1145,"meta":1107,"style":1107},"public class Robot extends OpModeRobot\n{\n    final CommandXboxController operatorController =\n        new CommandXboxController(DriverConstants.OPERATOR_CONTROLLER_PORT);\n    final Arm arm = new Arm();\n\n    @Override\n    public void robotPeriodic()\n    {\n        Scheduler.getDefault().run();\n    }\n}\n",[1089,2455,2456,2460,2464,2469,2474,2479,2483,2487,2491,2495,2500,2504],{"__ignoreMap":1107},[1149,2457,2458],{"class":1151,"line":1152},[1149,2459,1155],{},[1149,2461,2462],{"class":1151,"line":1158},[1149,2463,1161],{},[1149,2465,2466],{"class":1151,"line":1164},[1149,2467,2468],{},"    final CommandXboxController operatorController =\n",[1149,2470,2471],{"class":1151,"line":1170},[1149,2472,2473],{},"        new CommandXboxController(DriverConstants.OPERATOR_CONTROLLER_PORT);\n",[1149,2475,2476],{"class":1151,"line":1176},[1149,2477,2478],{},"    final Arm arm = new Arm();\n",[1149,2480,2481],{"class":1151,"line":1182},[1149,2482,1198],{"emptyLinePlaceholder":1197},[1149,2484,2485],{"class":1151,"line":1188},[1149,2486,1233],{},[1149,2488,2489],{"class":1151,"line":1194},[1149,2490,1239],{},[1149,2492,2493],{"class":1151,"line":1201},[1149,2494,1210],{},[1149,2496,2497],{"class":1151,"line":1207},[1149,2498,2499],{},"        Scheduler.getDefault().run();\n",[1149,2501,2502],{"class":1151,"line":1213},[1149,2503,1222],{},[1149,2505,2506],{"class":1151,"line":1219},[1149,2507,1261],{},[1085,2509,2510,2512,2513,2515,2516,2519],{},[1089,2511,1091],{}," creates the controller and the arm, and runs the scheduler every loop. Its fields are package-private and ",[1089,2514,1267],{},", so the opmodes in the same package can read ",[1089,2517,2518],{},"robot.arm",", but nothing can replace it. Nothing about bumpers or autonomous appears here at all.",[1080,2521,2523],{"id":2522},"step-5-the-teleop-opmode-bindings-for-one-mode","Step 5: The Teleop Opmode — Bindings for One Mode",[1099,2525,2527],{"className":1143,"code":2526,"language":1145,"meta":1107,"style":1107},"@Teleop\npublic class ArmTeleop implements OpMode\n{\n    public ArmTeleop(Robot robot)\n    {\n        robot.operatorController.leftBumper().whileTrue(robot.arm.raiseCommand());\n    }\n}\n",[1089,2528,2529,2533,2538,2542,2547,2551,2556,2560],{"__ignoreMap":1107},[1149,2530,2531],{"class":1151,"line":1152},[1149,2532,1311],{},[1149,2534,2535],{"class":1151,"line":1158},[1149,2536,2537],{},"public class ArmTeleop implements OpMode\n",[1149,2539,2540],{"class":1151,"line":1164},[1149,2541,1161],{},[1149,2543,2544],{"class":1151,"line":1170},[1149,2545,2546],{},"    public ArmTeleop(Robot robot)\n",[1149,2548,2549],{"class":1151,"line":1176},[1149,2550,1210],{},[1149,2552,2553],{"class":1151,"line":1182},[1149,2554,2555],{},"        robot.operatorController.leftBumper().whileTrue(robot.arm.raiseCommand());\n",[1149,2557,2558],{"class":1151,"line":1188},[1149,2559,1222],{},[1149,2561,2562],{"class":1151,"line":1194},[1149,2563,1261],{},[1505,2565,2566,2574,2583],{},[1508,2567,2568,2569,2571,2572,1521],{},"The framework finds this class by its ",[1089,2570,1297],{}," annotation and constructs it when the drive team selects it, passing in the ",[1089,2573,1091],{},[1508,2575,2576,2579,2580,2582],{},[1089,2577,2578],{},"whileTrue"," raises the arm while the bumper is held, and cancels the command on release — which runs ",[1089,2581,1879],{}," and stops the arm.",[1508,2584,2585,2586,2589],{},"The binding belongs to this opmode's scope: it only works while ",[1089,2587,2588],{},"ArmTeleop"," is the selected opmode.",[1080,2591,2593],{"id":2592},"step-6-the-autonomous-opmode-a-timed-raise","Step 6: The Autonomous Opmode — A Timed Raise",[1099,2595,2597],{"className":1143,"code":2596,"language":1145,"meta":1107,"style":1107},"@Autonomous(name = \"Raise Arm\")\npublic class RaiseArmAuto implements OpMode\n{\n    private final Command routine;\n\n    public RaiseArmAuto(Robot robot)\n    {\n        routine = robot.arm.raiseCommand().withTimeout(Seconds.of(1.5));\n    }\n\n    @Override\n    public void start()\n    {\n        Scheduler.getDefault().schedule(routine);\n    }\n}\n",[1089,2598,2599,2604,2609,2613,2617,2621,2626,2630,2635,2639,2643,2647,2651,2655,2659,2663],{"__ignoreMap":1107},[1149,2600,2601],{"class":1151,"line":1152},[1149,2602,2603],{},"@Autonomous(name = \"Raise Arm\")\n",[1149,2605,2606],{"class":1151,"line":1158},[1149,2607,2608],{},"public class RaiseArmAuto implements OpMode\n",[1149,2610,2611],{"class":1151,"line":1164},[1149,2612,1161],{},[1149,2614,2615],{"class":1151,"line":1170},[1149,2616,1378],{},[1149,2618,2619],{"class":1151,"line":1176},[1149,2620,1198],{"emptyLinePlaceholder":1197},[1149,2622,2623],{"class":1151,"line":1182},[1149,2624,2625],{},"    public RaiseArmAuto(Robot robot)\n",[1149,2627,2628],{"class":1151,"line":1188},[1149,2629,1210],{},[1149,2631,2632],{"class":1151,"line":1194},[1149,2633,2634],{},"        routine = robot.arm.raiseCommand().withTimeout(Seconds.of(1.5));\n",[1149,2636,2637],{"class":1151,"line":1201},[1149,2638,1222],{},[1149,2640,2641],{"class":1151,"line":1207},[1149,2642,1198],{"emptyLinePlaceholder":1197},[1149,2644,2645],{"class":1151,"line":1213},[1149,2646,1233],{},[1149,2648,2649],{"class":1151,"line":1219},[1149,2650,1413],{},[1149,2652,2653],{"class":1151,"line":1225},[1149,2654,1210],{},[1149,2656,2657],{"class":1151,"line":1230},[1149,2658,1422],{},[1149,2660,2661],{"class":1151,"line":1236},[1149,2662,1222],{},[1149,2664,2665],{"class":1151,"line":1242},[1149,2666,1261],{},[1505,2668,2669,2681,2690],{},[1508,2670,2671,2672,2674,2675,2677,2678,2680],{},"The autonomous command reuses the same factory, with ",[1089,2673,1978],{}," giving it an end condition. When the timeout cancels the raise, ",[1089,2676,1879],{}," stops the arm. Each call to ",[1089,2679,2422],{}," builds a brand-new command object, so the teleop binding and autonomous never share one instance.",[1508,2682,2683,2684,2686,2687,2689],{},"The constructor runs when the opmode is ",[1347,2685,1349],{},", while the robot is still disabled, so it only builds the routine. ",[1089,2688,1353],{}," runs once when the robot is enabled — that's when the routine is scheduled.",[1508,2691,2692],{},"Because the routine is scheduled inside the autonomous opmode, the scheduler cancels it automatically if autonomous ends first. There's no teleop code to write for that.",[1080,2694,2696],{"id":2695},"recap","Recap",[1505,2698,2699,2707,2712,2726],{},[1508,2700,2701,2703,2704,2706],{},[1089,2702,1116],{}," package: every tunable number, ",[1089,2705,1485],{},", ALL_CAPS, one small class per topic.",[1508,2708,2709,2711],{},[1089,2710,1120],{}," package: a command that only involves one mechanism is an instance factory method on it.",[1508,2713,2714,2716,2717,2719,2720,2722,2723,1521],{},[1089,2715,1091],{},": package-private ",[1089,2718,1267],{}," mechanisms and controllers, plus ",[1089,2721,2123],{}," in ",[1089,2724,2725],{},"robotPeriodic()",[1508,2727,2728,2729,2731],{},"Opmodes: a teleop opmode makes its bindings in its constructor; an autonomous opmode builds its routine in the constructor and schedules it in ",[1089,2730,1353],{},", and scopes cancel it automatically when the mode ends.",[2197,2733,2199],{},{"title":1107,"searchDepth":1158,"depth":1158,"links":2735},[2736,2737,2738,2739,2741,2743,2744,2745],{"id":2225,"depth":1158,"text":2226},{"id":2257,"depth":1158,"text":2258},{"id":2289,"depth":1158,"text":2290},{"id":2353,"depth":1158,"text":2740},"Step 3: Arm — A Single-Mechanism Command Lives on the Mechanism",{"id":2446,"depth":1158,"text":2742},"Step 4: Robot — Deliberately Thin",{"id":2522,"depth":1158,"text":2523},{"id":2592,"depth":1158,"text":2593},{"id":2695,"depth":1158,"text":2696},{"outlineRef":2212,"pairsWith":2747,"status":2748},"[`lessons\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project.md`](..\u002F..\u002Flessons\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt); rewritten for the WPILib 2027 Commands v3 template",{"title":727,"description":1107},"SqcWSfl6FCc6XRQEkoeE_X8HnEM7gsqfgZfy3uytnSQ",{"id":2752,"title":1040,"body":2753,"description":1107,"extension":2210,"meta":4211,"navigation":1197,"path":1039,"seo":4213,"stem":1041,"__hash__":4214},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project.md",{"type":1073,"value":2754,"toc":4206},[2755,2758,2762,2776,2781,2823,2829,2838,2869,2873,2894,2897,2965,2970,3025,3108,3112,3118,3137,3206,3223,3229,3234,3643,3648,3653,3659,3664,3669,3674,3678,3684,3688,3694,3699,3703,3709,3713,3719,3724,3728,3734,3738,3744,3749,3753,3759,3763,3769,3774,4156,4204],[1076,2756,1040],{"id":2757},"structuring-a-command-based-robot-project-exercises",[1080,2759,2761],{"id":2760},"multiple-choice","Multiple Choice",[1085,2763,2764,2767,2768,2771,2772,2775],{},[1094,2765,2766],{},"Question:"," A new \"hand-off\" command has to move the ",[1089,2769,2770],{},"Elevator"," down and run the ",[1089,2773,2774],{},"Wrist"," at the same time, so a game piece can pass from one mechanism to the other. Neither mechanism is more \"in charge\" of the hand-off than the other, and the command has no internal state of its own. Which is the best way to define it so it can be reused from a button binding and from autonomous?",[1085,2777,2778],{},[1094,2779,2780],{},"Options:",[1505,2782,2783,2790,2799,2805],{},[1508,2784,2785,2786,2789],{},"A. A static factory method, like ",[1089,2787,2788],{},"HandoffCommands.handoff(elevator, wrist)",", that takes both mechanisms as parameters",[1508,2791,2792,2793,2795,2796],{},"B. An instance factory method on ",[1089,2794,2770],{},", like ",[1089,2797,2798],{},"elevator.handoffCommand()",[1508,2800,2801,2802,2804],{},"C. A full class that ",[1089,2803,1539],{},", with its own fields for tracking state",[1508,2806,2807,2808,2811,2812,2815,2816,2819,2820,2822],{},"D. Make ",[1089,2809,2810],{},"elevator"," and ",[1089,2813,2814],{},"wrist"," ",[1089,2817,2818],{},"public static"," fields in ",[1089,2821,1091],{},", so the command can reach them from anywhere",[1085,2824,2825,2828],{},[1094,2826,2827],{},"Answer:"," A",[1085,2830,2831,2834,2835,2837],{},[1094,2832,2833],{},"Why:"," A command that coordinates ",[1347,2836,1530],{}," mechanisms doesn't naturally belong to any single one of them, which is exactly the case a static factory method is for. Passing both mechanisms in as parameters is dependency injection: the method gets exactly what it needs, explicitly.",[1505,2839,2840,2853,2860],{},[1508,2841,2842,2843,2846,2847,2849,2850,2852],{},"B is wrong — an instance factory on one mechanism is best for a command tied to ",[1347,2844,2845],{},"that one"," mechanism; here the ",[1089,2848,2770],{}," would need to reach the ",[1089,2851,2774],{},", which it has no business owning.",[1508,2854,2855,2856,2859],{},"C is wrong — a full ",[1089,2857,2858],{},"Command"," class is for a command with genuine internal state or unusually complex logic; this one has neither, so a whole class is unnecessary.",[1508,2861,2862,2863,2865,2866,2868],{},"D is wrong — making mechanisms ",[1089,2864,2818],{}," lets any code anywhere call their methods directly, bypassing the scheduler's resource-management guarantees; ",[1089,2867,1091],{},"'s mechanisms stay package-private and get passed explicitly to whatever needs them.",[1080,2870,2872],{"id":2871},"micro-parsons","Micro-Parsons",[1085,2874,2875,2878,2879,2882,2883,2886,2887,2889,2890,2893],{},[1094,2876,2877],{},"Problem:"," These lines, once correctly ordered, form a complete ",[1089,2880,2881],{},"Autos"," class with one static factory method, ",[1089,2884,2885],{},"scoreAndBackUp",". It receives an ",[1089,2888,2770],{}," and a ",[1089,2891,2892],{},"Drive"," as parameters, and returns a named sequence that first raises the elevator, then releases the game piece, then drives backward for 2 seconds.",[1085,2895,2896],{},"Reorder the fragments below into a working class:",[1505,2898,2899,2905,2911,2917,2923,2929,2935,2941,2947,2953,2959],{},[1508,2900,2901,2902],{},"a. ",[1089,2903,2904],{},"            drive.driveBackwardCommand().withTimeout(Seconds.of(2))",[1508,2906,2907,2908],{},"b. ",[1089,2909,2910],{},"public class Autos",[1508,2912,2913,2914],{},"c. ",[1089,2915,2916],{},"    }",[1508,2918,2919,2920],{},"d. ",[1089,2921,2922],{},"        return Command.sequence(",[1508,2924,2925,2926],{},"e. ",[1089,2927,2928],{},"            elevator.raiseCommand(),",[1508,2930,2931,2932],{},"f. ",[1089,2933,2934],{},"{",[1508,2936,2937,2938],{},"g. ",[1089,2939,2940],{},"        ).named(\"Score And Back Up\");",[1508,2942,2943,2944],{},"h. ",[1089,2945,2946],{},"    public static Command scoreAndBackUp(Elevator elevator, Drive drive)",[1508,2948,2949,2950],{},"i. ",[1089,2951,2952],{},"            elevator.releaseCommand(),",[1508,2954,2955,2956],{},"j. ",[1089,2957,2958],{},"    {",[1508,2960,2961,2962],{},"k. ",[1089,2963,2964],{},"}",[1085,2966,2967,2969],{},[1094,2968,2827],{}," b, f, h, j, d, e, i, a, g, c, k",[1099,2971,2973],{"className":1143,"code":2972,"language":1145,"meta":1107,"style":1107},"public class Autos\n{\n    public static Command scoreAndBackUp(Elevator elevator, Drive drive)\n    {\n        return Command.sequence(\n            elevator.raiseCommand(),\n            elevator.releaseCommand(),\n            drive.driveBackwardCommand().withTimeout(Seconds.of(2))\n        ).named(\"Score And Back Up\");\n    }\n}\n",[1089,2974,2975,2980,2984,2989,2993,2997,3002,3007,3012,3017,3021],{"__ignoreMap":1107},[1149,2976,2977],{"class":1151,"line":1152},[1149,2978,2979],{},"public class Autos\n",[1149,2981,2982],{"class":1151,"line":1158},[1149,2983,1161],{},[1149,2985,2986],{"class":1151,"line":1164},[1149,2987,2988],{},"    public static Command scoreAndBackUp(Elevator elevator, Drive drive)\n",[1149,2990,2991],{"class":1151,"line":1170},[1149,2992,1210],{},[1149,2994,2995],{"class":1151,"line":1176},[1149,2996,1624],{},[1149,2998,2999],{"class":1151,"line":1182},[1149,3000,3001],{},"            elevator.raiseCommand(),\n",[1149,3003,3004],{"class":1151,"line":1188},[1149,3005,3006],{},"            elevator.releaseCommand(),\n",[1149,3008,3009],{"class":1151,"line":1194},[1149,3010,3011],{},"            drive.driveBackwardCommand().withTimeout(Seconds.of(2))\n",[1149,3013,3014],{"class":1151,"line":1201},[1149,3015,3016],{},"        ).named(\"Score And Back Up\");\n",[1149,3018,3019],{"class":1151,"line":1207},[1149,3020,1222],{},[1149,3022,3023],{"class":1151,"line":1213},[1149,3024,1261],{},[1085,3026,3027,3030,3031,3034,3035,3038,3039,3034,3042,3045,3046,1937,3049,3052,3053,3056,3057,3060,3061,3064,3065,3068,3069,3072,3073,3076,3077,3080,3081,3083,3084,1117,3086,3089,3090,1937,3093,3096,3097,3099,3100,3103,3104,3107],{},[1094,3028,3029],{},"Why this order:"," The class header (",[1089,3032,3033],{},"b",") and brace (",[1089,3036,3037],{},"f","), then the static method's signature (",[1089,3040,3041],{},"h",[1089,3043,3044],{},"j","). The method takes both mechanisms as parameters instead of reaching for global variables — dependency injection. ",[1089,3047,3048],{},"return Command.sequence(",[1089,3050,3051],{},"d",") opens the sequence, and the order of its arguments ",[1347,3054,3055],{},"is"," the order the robot does things: raise (",[1089,3058,3059],{},"e","), then release (",[1089,3062,3063],{},"i","), then back up (",[1089,3066,3067],{},"a","). The last argument has no trailing comma, and ",[1089,3070,3071],{},"withTimeout(Seconds.of(2))"," gives the drive step its 2-second end condition — ",[1089,3074,3075],{},"withTimeout"," takes a ",[1089,3078,3079],{},"Time",", not a bare number. Unlike v2's ",[1089,3082,2024],{},", which returned a finished ",[1089,3085,2858],{},[1089,3087,3088],{},"Command.sequence(...)"," in v3 returns a builder, so the call ends with ",[1089,3091,3092],{},".named(\"Score And Back Up\")",[1089,3094,3095],{},"g",") to turn it into a ",[1089,3098,2858],{}," — leaving that off is a compile error. Then the method's brace (",[1089,3101,3102],{},"c",") and the class's (",[1089,3105,3106],{},"k",").",[1080,3109,3111],{"id":3110},"coding","Coding",[1085,3113,3114,3117],{},[1094,3115,3116],{},"Mode:"," full-program",[1085,3119,3120,3122,3123,2811,3125,3128,3129,3132,3133,3136],{},[1094,3121,2877],{}," Two small pieces of a Commands v3 project, in the style of the lesson. ",[1089,3124,2892],{},[1089,3126,3127],{},"Shooter"," (below)\nare finished mechanisms: ",[1089,3130,3131],{},"Drive Forward"," runs until something stops it, and ",[1089,3134,3135],{},"Shoot"," fires for one\nloop. Write:",[1505,3138,3139,3166],{},[1508,3140,3141,3144,3145,3147,3148,3150,3151,3154,3155,3158,3159,3162,3163,3107],{},[1089,3142,3143],{},"IntakeConstants",": a ",[1089,3146,1267],{}," class with two constants, each ",[1089,3149,1485],{}," and named in\nALL_CAPS: ",[1089,3152,3153],{},"MOTOR_CHANNEL = 5"," (an ",[1089,3156,3157],{},"int",") and ",[1089,3160,3161],{},"INTAKE_SPEED = 0.8"," (a ",[1089,3164,3165],{},"double",[1508,3167,3168,3144,3171,3174,3175,2815,3178,1937,3185,3187,3188,3190,3191,3194,3195,2815,3198,3201,3202,3205],{},[1089,3169,3170],{},"Autos.driveThenShoot(drive, shooter, seconds)",[1094,3172,3173],{},"static factory"," that returns one command\nthat runs ",[1089,3176,3177],{},"drive.driveForwardCommand()",[1094,3179,3180,3181,3184],{},"limited to ",[1089,3182,3183],{},"seconds"," seconds",[1089,3186,3075],{}," with a\n",[1089,3189,3079],{}," made by ",[1089,3192,3193],{},"Seconds.of(...)","), ",[1094,3196,3197],{},"then",[1089,3199,3200],{},"shooter.shootCommand()",". Finish it with\n",[1089,3203,3204],{},".withAutomaticName()"," so the name describes its members.",[1085,3207,3208,3209,3211,3212,3215,3216,3218,3219,3222],{},"The fixed ",[1089,3210,2181],{}," reads the number of seconds, prints the routine's name and what it requires, then\n",[1094,3213,3214],{},"runs the real scheduler"," on a fake clock, one simulated second at a time, printing what the\ncommands did in each loop. Finally it reports what it can tell about ",[1089,3217,3143],{},". For the\ninput ",[1089,3220,3221],{},"2",":",[1099,3224,3227],{"className":3225,"code":3226,"language":1104,"meta":1107},[1102],"Drive Forward [2.0 Second timeout] -> Shoot\nrequires drive: true, shooter: true\nt=0 s: [drive]\nt=1 s: [drive]\nt=2 s: [drive, shoot]\nt=3 s: []\nIntakeConstants final: true\nMOTOR_CHANNEL public static final: true = 5\nINTAKE_SPEED public static final: true = 0.8\n",[1089,3228,3226],{"__ignoreMap":1107},[1085,3230,3231],{},[1094,3232,3233],{},"Starter:",[1099,3235,3237],{"className":1143,"code":3236,"language":1145,"meta":1107,"style":1107},"import java.lang.reflect.*;\nimport java.util.*;\nimport org.wpilib.command3.Command;\nimport org.wpilib.command3.Mechanism;\nimport org.wpilib.command3.Scheduler;\nimport org.wpilib.command3.TestSupport;\nimport static org.wpilib.units.Units.Seconds;\n\npublic class Main\n{\n    \u002F\u002F Don't change main\n    public static void main(String[] args) throws Exception\n    {\n        TestSupport.init(); \u002F\u002F a fake robot clock and opmode, so the scheduler can run without a robot\n        Scanner in = new Scanner(System.in);\n        int seconds = in.nextInt();\n        Drive drive = new Drive();\n        Shooter shooter = new Shooter();\n        Command routine = Autos.driveThenShoot(drive, shooter, seconds);\n        System.out.println(routine.name());\n        System.out.println(\"requires drive: \" + routine.requires(drive) + \", shooter: \" + routine.requires(shooter));\n\n        Scheduler scheduler = Scheduler.getDefault();\n        scheduler.schedule(routine);\n        for (int t = 0; t \u003C= seconds + 1; t++)\n        {\n            log.clear();\n            scheduler.run();\n            System.out.println(\"t=\" + t + \" s: \" + log);\n            TestSupport.advance(1.0);\n        }\n\n        Class\u003C?> constants = IntakeConstants.class;\n        System.out.println(\"IntakeConstants final: \" + Modifier.isFinal(constants.getModifiers()));\n        for (String name : new String[] { \"MOTOR_CHANNEL\", \"INTAKE_SPEED\" })\n        {\n            Field field = constants.getDeclaredField(name);\n            int m = field.getModifiers();\n            boolean ok = Modifier.isPublic(m) && Modifier.isStatic(m) && Modifier.isFinal(m);\n            System.out.println(name + \" public static final: \" + ok + \" = \" + field.get(null));\n        }\n    }\n\n    \u002F\u002F each command records what it does here, once per loop\n    static final List\u003CString> log = new ArrayList\u003C>();\n}\n\n\u002F\u002F Don't change Drive\nclass Drive implements Mechanism\n{\n    \u002F\u002F drives every loop, until something stops it\n    public Command driveForwardCommand()\n    {\n        return run(coroutine -> {\n            while (true)\n            {\n                Main.log.add(\"drive\");\n                coroutine.yield();\n            }\n        }).named(\"Drive Forward\");\n    }\n}\n\n\u002F\u002F Don't change Shooter\nclass Shooter implements Mechanism\n{\n    \u002F\u002F fires once, then ends\n    public Command shootCommand()\n    {\n        return run(coroutine -> Main.log.add(\"shoot\")).named(\"Shoot\");\n    }\n}\n\n\u002F\u002F TODO: class IntakeConstants\n\n\u002F\u002F TODO: class Autos\n",[1089,3238,3239,3244,3249,3254,3259,3264,3269,3274,3278,3283,3287,3292,3297,3301,3306,3311,3316,3321,3326,3331,3336,3341,3345,3350,3355,3360,3365,3370,3375,3380,3386,3392,3397,3403,3409,3415,3420,3426,3432,3438,3444,3449,3454,3459,3465,3471,3476,3481,3487,3493,3498,3504,3510,3515,3520,3526,3532,3538,3544,3550,3556,3561,3566,3571,3577,3583,3588,3594,3600,3605,3611,3616,3621,3626,3632,3637],{"__ignoreMap":1107},[1149,3240,3241],{"class":1151,"line":1152},[1149,3242,3243],{},"import java.lang.reflect.*;\n",[1149,3245,3246],{"class":1151,"line":1158},[1149,3247,3248],{},"import java.util.*;\n",[1149,3250,3251],{"class":1151,"line":1164},[1149,3252,3253],{},"import org.wpilib.command3.Command;\n",[1149,3255,3256],{"class":1151,"line":1170},[1149,3257,3258],{},"import org.wpilib.command3.Mechanism;\n",[1149,3260,3261],{"class":1151,"line":1176},[1149,3262,3263],{},"import org.wpilib.command3.Scheduler;\n",[1149,3265,3266],{"class":1151,"line":1182},[1149,3267,3268],{},"import org.wpilib.command3.TestSupport;\n",[1149,3270,3271],{"class":1151,"line":1188},[1149,3272,3273],{},"import static org.wpilib.units.Units.Seconds;\n",[1149,3275,3276],{"class":1151,"line":1194},[1149,3277,1198],{"emptyLinePlaceholder":1197},[1149,3279,3280],{"class":1151,"line":1201},[1149,3281,3282],{},"public class Main\n",[1149,3284,3285],{"class":1151,"line":1207},[1149,3286,1161],{},[1149,3288,3289],{"class":1151,"line":1213},[1149,3290,3291],{},"    \u002F\u002F Don't change main\n",[1149,3293,3294],{"class":1151,"line":1219},[1149,3295,3296],{},"    public static void main(String[] args) throws Exception\n",[1149,3298,3299],{"class":1151,"line":1225},[1149,3300,1210],{},[1149,3302,3303],{"class":1151,"line":1230},[1149,3304,3305],{},"        TestSupport.init(); \u002F\u002F a fake robot clock and opmode, so the scheduler can run without a robot\n",[1149,3307,3308],{"class":1151,"line":1236},[1149,3309,3310],{},"        Scanner in = new Scanner(System.in);\n",[1149,3312,3313],{"class":1151,"line":1242},[1149,3314,3315],{},"        int seconds = in.nextInt();\n",[1149,3317,3318],{"class":1151,"line":1247},[1149,3319,3320],{},"        Drive drive = new Drive();\n",[1149,3322,3323],{"class":1151,"line":1253},[1149,3324,3325],{},"        Shooter shooter = new Shooter();\n",[1149,3327,3328],{"class":1151,"line":1258},[1149,3329,3330],{},"        Command routine = Autos.driveThenShoot(drive, shooter, seconds);\n",[1149,3332,3333],{"class":1151,"line":1770},[1149,3334,3335],{},"        System.out.println(routine.name());\n",[1149,3337,3338],{"class":1151,"line":1775},[1149,3339,3340],{},"        System.out.println(\"requires drive: \" + routine.requires(drive) + \", shooter: \" + routine.requires(shooter));\n",[1149,3342,3343],{"class":1151,"line":1780},[1149,3344,1198],{"emptyLinePlaceholder":1197},[1149,3346,3347],{"class":1151,"line":1786},[1149,3348,3349],{},"        Scheduler scheduler = Scheduler.getDefault();\n",[1149,3351,3352],{"class":1151,"line":1791},[1149,3353,3354],{},"        scheduler.schedule(routine);\n",[1149,3356,3357],{"class":1151,"line":1796},[1149,3358,3359],{},"        for (int t = 0; t \u003C= seconds + 1; t++)\n",[1149,3361,3362],{"class":1151,"line":1802},[1149,3363,3364],{},"        {\n",[1149,3366,3367],{"class":1151,"line":1807},[1149,3368,3369],{},"            log.clear();\n",[1149,3371,3372],{"class":1151,"line":1812},[1149,3373,3374],{},"            scheduler.run();\n",[1149,3376,3377],{"class":1151,"line":1818},[1149,3378,3379],{},"            System.out.println(\"t=\" + t + \" s: \" + log);\n",[1149,3381,3383],{"class":1151,"line":3382},30,[1149,3384,3385],{},"            TestSupport.advance(1.0);\n",[1149,3387,3389],{"class":1151,"line":3388},31,[1149,3390,3391],{},"        }\n",[1149,3393,3395],{"class":1151,"line":3394},32,[1149,3396,1198],{"emptyLinePlaceholder":1197},[1149,3398,3400],{"class":1151,"line":3399},33,[1149,3401,3402],{},"        Class\u003C?> constants = IntakeConstants.class;\n",[1149,3404,3406],{"class":1151,"line":3405},34,[1149,3407,3408],{},"        System.out.println(\"IntakeConstants final: \" + Modifier.isFinal(constants.getModifiers()));\n",[1149,3410,3412],{"class":1151,"line":3411},35,[1149,3413,3414],{},"        for (String name : new String[] { \"MOTOR_CHANNEL\", \"INTAKE_SPEED\" })\n",[1149,3416,3418],{"class":1151,"line":3417},36,[1149,3419,3364],{},[1149,3421,3423],{"class":1151,"line":3422},37,[1149,3424,3425],{},"            Field field = constants.getDeclaredField(name);\n",[1149,3427,3429],{"class":1151,"line":3428},38,[1149,3430,3431],{},"            int m = field.getModifiers();\n",[1149,3433,3435],{"class":1151,"line":3434},39,[1149,3436,3437],{},"            boolean ok = Modifier.isPublic(m) && Modifier.isStatic(m) && Modifier.isFinal(m);\n",[1149,3439,3441],{"class":1151,"line":3440},40,[1149,3442,3443],{},"            System.out.println(name + \" public static final: \" + ok + \" = \" + field.get(null));\n",[1149,3445,3447],{"class":1151,"line":3446},41,[1149,3448,3391],{},[1149,3450,3452],{"class":1151,"line":3451},42,[1149,3453,1222],{},[1149,3455,3457],{"class":1151,"line":3456},43,[1149,3458,1198],{"emptyLinePlaceholder":1197},[1149,3460,3462],{"class":1151,"line":3461},44,[1149,3463,3464],{},"    \u002F\u002F each command records what it does here, once per loop\n",[1149,3466,3468],{"class":1151,"line":3467},45,[1149,3469,3470],{},"    static final List\u003CString> log = new ArrayList\u003C>();\n",[1149,3472,3474],{"class":1151,"line":3473},46,[1149,3475,1261],{},[1149,3477,3479],{"class":1151,"line":3478},47,[1149,3480,1198],{"emptyLinePlaceholder":1197},[1149,3482,3484],{"class":1151,"line":3483},48,[1149,3485,3486],{},"\u002F\u002F Don't change Drive\n",[1149,3488,3490],{"class":1151,"line":3489},49,[1149,3491,3492],{},"class Drive implements Mechanism\n",[1149,3494,3496],{"class":1151,"line":3495},50,[1149,3497,1161],{},[1149,3499,3501],{"class":1151,"line":3500},51,[1149,3502,3503],{},"    \u002F\u002F drives every loop, until something stops it\n",[1149,3505,3507],{"class":1151,"line":3506},52,[1149,3508,3509],{},"    public Command driveForwardCommand()\n",[1149,3511,3513],{"class":1151,"line":3512},53,[1149,3514,1210],{},[1149,3516,3518],{"class":1151,"line":3517},54,[1149,3519,1573],{},[1149,3521,3523],{"class":1151,"line":3522},55,[1149,3524,3525],{},"            while (true)\n",[1149,3527,3529],{"class":1151,"line":3528},56,[1149,3530,3531],{},"            {\n",[1149,3533,3535],{"class":1151,"line":3534},57,[1149,3536,3537],{},"                Main.log.add(\"drive\");\n",[1149,3539,3541],{"class":1151,"line":3540},58,[1149,3542,3543],{},"                coroutine.yield();\n",[1149,3545,3547],{"class":1151,"line":3546},59,[1149,3548,3549],{},"            }\n",[1149,3551,3553],{"class":1151,"line":3552},60,[1149,3554,3555],{},"        }).named(\"Drive Forward\");\n",[1149,3557,3559],{"class":1151,"line":3558},61,[1149,3560,1222],{},[1149,3562,3564],{"class":1151,"line":3563},62,[1149,3565,1261],{},[1149,3567,3569],{"class":1151,"line":3568},63,[1149,3570,1198],{"emptyLinePlaceholder":1197},[1149,3572,3574],{"class":1151,"line":3573},64,[1149,3575,3576],{},"\u002F\u002F Don't change Shooter\n",[1149,3578,3580],{"class":1151,"line":3579},65,[1149,3581,3582],{},"class Shooter implements Mechanism\n",[1149,3584,3586],{"class":1151,"line":3585},66,[1149,3587,1161],{},[1149,3589,3591],{"class":1151,"line":3590},67,[1149,3592,3593],{},"    \u002F\u002F fires once, then ends\n",[1149,3595,3597],{"class":1151,"line":3596},68,[1149,3598,3599],{},"    public Command shootCommand()\n",[1149,3601,3603],{"class":1151,"line":3602},69,[1149,3604,1210],{},[1149,3606,3608],{"class":1151,"line":3607},70,[1149,3609,3610],{},"        return run(coroutine -> Main.log.add(\"shoot\")).named(\"Shoot\");\n",[1149,3612,3614],{"class":1151,"line":3613},71,[1149,3615,1222],{},[1149,3617,3619],{"class":1151,"line":3618},72,[1149,3620,1261],{},[1149,3622,3624],{"class":1151,"line":3623},73,[1149,3625,1198],{"emptyLinePlaceholder":1197},[1149,3627,3629],{"class":1151,"line":3628},74,[1149,3630,3631],{},"\u002F\u002F TODO: class IntakeConstants\n",[1149,3633,3635],{"class":1151,"line":3634},75,[1149,3636,1198],{"emptyLinePlaceholder":1197},[1149,3638,3640],{"class":1151,"line":3639},76,[1149,3641,3642],{},"\u002F\u002F TODO: class Autos\n",[1085,3644,3645],{},[1094,3646,3647],{},"Scenario 1 (visible):",[1085,3649,3650],{},[1094,3651,3652],{},"Input:",[1099,3654,3657],{"className":3655,"code":3656,"language":1104,"meta":1107},[1102],"2\n",[1089,3658,3656],{"__ignoreMap":1107},[1085,3660,3661],{},[1094,3662,3663],{},"Expected output:",[1099,3665,3667],{"className":3666,"code":3226,"language":1104,"meta":1107},[1102],[1089,3668,3226],{"__ignoreMap":1107},[1085,3670,3671],{},[1094,3672,3673],{},"Scenario 2 (visible):",[1085,3675,3676],{},[1094,3677,3652],{},[1099,3679,3682],{"className":3680,"code":3681,"language":1104,"meta":1107},[1102],"4\n",[1089,3683,3681],{"__ignoreMap":1107},[1085,3685,3686],{},[1094,3687,3663],{},[1099,3689,3692],{"className":3690,"code":3691,"language":1104,"meta":1107},[1102],"Drive Forward [4.0 Second timeout] -> Shoot\nrequires drive: true, shooter: true\nt=0 s: [drive]\nt=1 s: [drive]\nt=2 s: [drive]\nt=3 s: [drive]\nt=4 s: [drive, shoot]\nt=5 s: []\nIntakeConstants final: true\nMOTOR_CHANNEL public static final: true = 5\nINTAKE_SPEED public static final: true = 0.8\n",[1089,3693,3691],{"__ignoreMap":1107},[1085,3695,3696],{},[1094,3697,3698],{},"Scenario 3 (hidden):",[1085,3700,3701],{},[1094,3702,3652],{},[1099,3704,3707],{"className":3705,"code":3706,"language":1104,"meta":1107},[1102],"1\n",[1089,3708,3706],{"__ignoreMap":1107},[1085,3710,3711],{},[1094,3712,3663],{},[1099,3714,3717],{"className":3715,"code":3716,"language":1104,"meta":1107},[1102],"Drive Forward [1.0 Second timeout] -> Shoot\nrequires drive: true, shooter: true\nt=0 s: [drive]\nt=1 s: [drive, shoot]\nt=2 s: []\nIntakeConstants final: true\nMOTOR_CHANNEL public static final: true = 5\nINTAKE_SPEED public static final: true = 0.8\n",[1089,3718,3716],{"__ignoreMap":1107},[1085,3720,3721],{},[1094,3722,3723],{},"Scenario 4 (hidden):",[1085,3725,3726],{},[1094,3727,3652],{},[1099,3729,3732],{"className":3730,"code":3731,"language":1104,"meta":1107},[1102],"3\n",[1089,3733,3731],{"__ignoreMap":1107},[1085,3735,3736],{},[1094,3737,3663],{},[1099,3739,3742],{"className":3740,"code":3741,"language":1104,"meta":1107},[1102],"Drive Forward [3.0 Second timeout] -> Shoot\nrequires drive: true, shooter: true\nt=0 s: [drive]\nt=1 s: [drive]\nt=2 s: [drive]\nt=3 s: [drive, shoot]\nt=4 s: []\nIntakeConstants final: true\nMOTOR_CHANNEL public static final: true = 5\nINTAKE_SPEED public static final: true = 0.8\n",[1089,3743,3741],{"__ignoreMap":1107},[1085,3745,3746],{},[1094,3747,3748],{},"Scenario 5 (hidden):",[1085,3750,3751],{},[1094,3752,3652],{},[1099,3754,3757],{"className":3755,"code":3756,"language":1104,"meta":1107},[1102],"5\n",[1089,3758,3756],{"__ignoreMap":1107},[1085,3760,3761],{},[1094,3762,3663],{},[1099,3764,3767],{"className":3765,"code":3766,"language":1104,"meta":1107},[1102],"Drive Forward [5.0 Second timeout] -> Shoot\nrequires drive: true, shooter: true\nt=0 s: [drive]\nt=1 s: [drive]\nt=2 s: [drive]\nt=3 s: [drive]\nt=4 s: [drive]\nt=5 s: [drive, shoot]\nt=6 s: []\nIntakeConstants final: true\nMOTOR_CHANNEL public static final: true = 5\nINTAKE_SPEED public static final: true = 0.8\n",[1089,3768,3766],{"__ignoreMap":1107},[1085,3770,3771],{},[1094,3772,3773],{},"Solution:",[1099,3775,3777],{"className":1143,"code":3776,"language":1145,"meta":1107,"style":1107},"import java.lang.reflect.*;\nimport java.util.*;\nimport org.wpilib.command3.Command;\nimport org.wpilib.command3.Mechanism;\nimport org.wpilib.command3.Scheduler;\nimport org.wpilib.command3.TestSupport;\nimport static org.wpilib.units.Units.Seconds;\n\npublic class Main\n{\n    \u002F\u002F Don't change main\n    public static void main(String[] args) throws Exception\n    {\n        TestSupport.init(); \u002F\u002F a fake robot clock and opmode, so the scheduler can run without a robot\n        Scanner in = new Scanner(System.in);\n        int seconds = in.nextInt();\n        Drive drive = new Drive();\n        Shooter shooter = new Shooter();\n        Command routine = Autos.driveThenShoot(drive, shooter, seconds);\n        System.out.println(routine.name());\n        System.out.println(\"requires drive: \" + routine.requires(drive) + \", shooter: \" + routine.requires(shooter));\n\n        Scheduler scheduler = Scheduler.getDefault();\n        scheduler.schedule(routine);\n        for (int t = 0; t \u003C= seconds + 1; t++)\n        {\n            log.clear();\n            scheduler.run();\n            System.out.println(\"t=\" + t + \" s: \" + log);\n            TestSupport.advance(1.0);\n        }\n\n        Class\u003C?> constants = IntakeConstants.class;\n        System.out.println(\"IntakeConstants final: \" + Modifier.isFinal(constants.getModifiers()));\n        for (String name : new String[] { \"MOTOR_CHANNEL\", \"INTAKE_SPEED\" })\n        {\n            Field field = constants.getDeclaredField(name);\n            int m = field.getModifiers();\n            boolean ok = Modifier.isPublic(m) && Modifier.isStatic(m) && Modifier.isFinal(m);\n            System.out.println(name + \" public static final: \" + ok + \" = \" + field.get(null));\n        }\n    }\n\n    \u002F\u002F each command records what it does here, once per loop\n    static final List\u003CString> log = new ArrayList\u003C>();\n}\n\n\u002F\u002F Don't change Drive\nclass Drive implements Mechanism\n{\n    \u002F\u002F drives every loop, until something stops it\n    public Command driveForwardCommand()\n    {\n        return run(coroutine -> {\n            while (true)\n            {\n                Main.log.add(\"drive\");\n                coroutine.yield();\n            }\n        }).named(\"Drive Forward\");\n    }\n}\n\n\u002F\u002F Don't change Shooter\nclass Shooter implements Mechanism\n{\n    \u002F\u002F fires once, then ends\n    public Command shootCommand()\n    {\n        return run(coroutine -> Main.log.add(\"shoot\")).named(\"Shoot\");\n    }\n}\n\nfinal class IntakeConstants\n{\n    public static final int MOTOR_CHANNEL = 5;\n    public static final double INTAKE_SPEED = 0.8;\n}\n\nclass Autos\n{\n    public static Command driveThenShoot(Drive drive, Shooter shooter, int seconds)\n    {\n        return drive.driveForwardCommand()\n            .withTimeout(Seconds.of(seconds))\n            .andThen(shooter.shootCommand())\n            .withAutomaticName();\n    }\n}\n",[1089,3778,3779,3783,3787,3791,3795,3799,3803,3807,3811,3815,3819,3823,3827,3831,3835,3839,3843,3847,3851,3855,3859,3863,3867,3871,3875,3879,3883,3887,3891,3895,3899,3903,3907,3911,3915,3919,3923,3927,3931,3935,3939,3943,3947,3951,3955,3959,3963,3967,3971,3975,3979,3983,3987,3991,3995,3999,4003,4007,4011,4015,4019,4023,4027,4031,4035,4039,4043,4047,4051,4055,4059,4063,4067,4071,4076,4080,4085,4090,4095,4100,4106,4111,4117,4122,4128,4134,4140,4146,4151],{"__ignoreMap":1107},[1149,3780,3781],{"class":1151,"line":1152},[1149,3782,3243],{},[1149,3784,3785],{"class":1151,"line":1158},[1149,3786,3248],{},[1149,3788,3789],{"class":1151,"line":1164},[1149,3790,3253],{},[1149,3792,3793],{"class":1151,"line":1170},[1149,3794,3258],{},[1149,3796,3797],{"class":1151,"line":1176},[1149,3798,3263],{},[1149,3800,3801],{"class":1151,"line":1182},[1149,3802,3268],{},[1149,3804,3805],{"class":1151,"line":1188},[1149,3806,3273],{},[1149,3808,3809],{"class":1151,"line":1194},[1149,3810,1198],{"emptyLinePlaceholder":1197},[1149,3812,3813],{"class":1151,"line":1201},[1149,3814,3282],{},[1149,3816,3817],{"class":1151,"line":1207},[1149,3818,1161],{},[1149,3820,3821],{"class":1151,"line":1213},[1149,3822,3291],{},[1149,3824,3825],{"class":1151,"line":1219},[1149,3826,3296],{},[1149,3828,3829],{"class":1151,"line":1225},[1149,3830,1210],{},[1149,3832,3833],{"class":1151,"line":1230},[1149,3834,3305],{},[1149,3836,3837],{"class":1151,"line":1236},[1149,3838,3310],{},[1149,3840,3841],{"class":1151,"line":1242},[1149,3842,3315],{},[1149,3844,3845],{"class":1151,"line":1247},[1149,3846,3320],{},[1149,3848,3849],{"class":1151,"line":1253},[1149,3850,3325],{},[1149,3852,3853],{"class":1151,"line":1258},[1149,3854,3330],{},[1149,3856,3857],{"class":1151,"line":1770},[1149,3858,3335],{},[1149,3860,3861],{"class":1151,"line":1775},[1149,3862,3340],{},[1149,3864,3865],{"class":1151,"line":1780},[1149,3866,1198],{"emptyLinePlaceholder":1197},[1149,3868,3869],{"class":1151,"line":1786},[1149,3870,3349],{},[1149,3872,3873],{"class":1151,"line":1791},[1149,3874,3354],{},[1149,3876,3877],{"class":1151,"line":1796},[1149,3878,3359],{},[1149,3880,3881],{"class":1151,"line":1802},[1149,3882,3364],{},[1149,3884,3885],{"class":1151,"line":1807},[1149,3886,3369],{},[1149,3888,3889],{"class":1151,"line":1812},[1149,3890,3374],{},[1149,3892,3893],{"class":1151,"line":1818},[1149,3894,3379],{},[1149,3896,3897],{"class":1151,"line":3382},[1149,3898,3385],{},[1149,3900,3901],{"class":1151,"line":3388},[1149,3902,3391],{},[1149,3904,3905],{"class":1151,"line":3394},[1149,3906,1198],{"emptyLinePlaceholder":1197},[1149,3908,3909],{"class":1151,"line":3399},[1149,3910,3402],{},[1149,3912,3913],{"class":1151,"line":3405},[1149,3914,3408],{},[1149,3916,3917],{"class":1151,"line":3411},[1149,3918,3414],{},[1149,3920,3921],{"class":1151,"line":3417},[1149,3922,3364],{},[1149,3924,3925],{"class":1151,"line":3422},[1149,3926,3425],{},[1149,3928,3929],{"class":1151,"line":3428},[1149,3930,3431],{},[1149,3932,3933],{"class":1151,"line":3434},[1149,3934,3437],{},[1149,3936,3937],{"class":1151,"line":3440},[1149,3938,3443],{},[1149,3940,3941],{"class":1151,"line":3446},[1149,3942,3391],{},[1149,3944,3945],{"class":1151,"line":3451},[1149,3946,1222],{},[1149,3948,3949],{"class":1151,"line":3456},[1149,3950,1198],{"emptyLinePlaceholder":1197},[1149,3952,3953],{"class":1151,"line":3461},[1149,3954,3464],{},[1149,3956,3957],{"class":1151,"line":3467},[1149,3958,3470],{},[1149,3960,3961],{"class":1151,"line":3473},[1149,3962,1261],{},[1149,3964,3965],{"class":1151,"line":3478},[1149,3966,1198],{"emptyLinePlaceholder":1197},[1149,3968,3969],{"class":1151,"line":3483},[1149,3970,3486],{},[1149,3972,3973],{"class":1151,"line":3489},[1149,3974,3492],{},[1149,3976,3977],{"class":1151,"line":3495},[1149,3978,1161],{},[1149,3980,3981],{"class":1151,"line":3500},[1149,3982,3503],{},[1149,3984,3985],{"class":1151,"line":3506},[1149,3986,3509],{},[1149,3988,3989],{"class":1151,"line":3512},[1149,3990,1210],{},[1149,3992,3993],{"class":1151,"line":3517},[1149,3994,1573],{},[1149,3996,3997],{"class":1151,"line":3522},[1149,3998,3525],{},[1149,4000,4001],{"class":1151,"line":3528},[1149,4002,3531],{},[1149,4004,4005],{"class":1151,"line":3534},[1149,4006,3537],{},[1149,4008,4009],{"class":1151,"line":3540},[1149,4010,3543],{},[1149,4012,4013],{"class":1151,"line":3546},[1149,4014,3549],{},[1149,4016,4017],{"class":1151,"line":3552},[1149,4018,3555],{},[1149,4020,4021],{"class":1151,"line":3558},[1149,4022,1222],{},[1149,4024,4025],{"class":1151,"line":3563},[1149,4026,1261],{},[1149,4028,4029],{"class":1151,"line":3568},[1149,4030,1198],{"emptyLinePlaceholder":1197},[1149,4032,4033],{"class":1151,"line":3573},[1149,4034,3576],{},[1149,4036,4037],{"class":1151,"line":3579},[1149,4038,3582],{},[1149,4040,4041],{"class":1151,"line":3585},[1149,4042,1161],{},[1149,4044,4045],{"class":1151,"line":3590},[1149,4046,3593],{},[1149,4048,4049],{"class":1151,"line":3596},[1149,4050,3599],{},[1149,4052,4053],{"class":1151,"line":3602},[1149,4054,1210],{},[1149,4056,4057],{"class":1151,"line":3607},[1149,4058,3610],{},[1149,4060,4061],{"class":1151,"line":3613},[1149,4062,1222],{},[1149,4064,4065],{"class":1151,"line":3618},[1149,4066,1261],{},[1149,4068,4069],{"class":1151,"line":3623},[1149,4070,1198],{"emptyLinePlaceholder":1197},[1149,4072,4073],{"class":1151,"line":3628},[1149,4074,4075],{},"final class IntakeConstants\n",[1149,4077,4078],{"class":1151,"line":3634},[1149,4079,1161],{},[1149,4081,4082],{"class":1151,"line":3639},[1149,4083,4084],{},"    public static final int MOTOR_CHANNEL = 5;\n",[1149,4086,4088],{"class":1151,"line":4087},77,[1149,4089,1475],{},[1149,4091,4093],{"class":1151,"line":4092},78,[1149,4094,1261],{},[1149,4096,4098],{"class":1151,"line":4097},79,[1149,4099,1198],{"emptyLinePlaceholder":1197},[1149,4101,4103],{"class":1151,"line":4102},80,[1149,4104,4105],{},"class Autos\n",[1149,4107,4109],{"class":1151,"line":4108},81,[1149,4110,1161],{},[1149,4112,4114],{"class":1151,"line":4113},82,[1149,4115,4116],{},"    public static Command driveThenShoot(Drive drive, Shooter shooter, int seconds)\n",[1149,4118,4120],{"class":1151,"line":4119},83,[1149,4121,1210],{},[1149,4123,4125],{"class":1151,"line":4124},84,[1149,4126,4127],{},"        return drive.driveForwardCommand()\n",[1149,4129,4131],{"class":1151,"line":4130},85,[1149,4132,4133],{},"            .withTimeout(Seconds.of(seconds))\n",[1149,4135,4137],{"class":1151,"line":4136},86,[1149,4138,4139],{},"            .andThen(shooter.shootCommand())\n",[1149,4141,4143],{"class":1151,"line":4142},87,[1149,4144,4145],{},"            .withAutomaticName();\n",[1149,4147,4149],{"class":1151,"line":4148},88,[1149,4150,1222],{},[1149,4152,4154],{"class":1151,"line":4153},89,[1149,4155,1261],{},[1085,4157,4158,4160,4161,4163,4164,4167,4168,4171,4172,4175,4176,4178,4179,4181,4182,4185,4186,4189,4190,4193,4194,4197,4198,4200,4201,4203],{},[1094,4159,2833],{}," The ",[1094,4162,3173],{}," takes both mechanisms as parameters, since a command that coordinates several\nmechanisms doesn't belong to any single one of them. ",[1089,4165,4166],{},"withTimeout(Seconds.of(seconds))"," limits only\nthe drive step, and ",[1089,4169,4170],{},"andThen(...)"," makes the sequence, so the group requires both mechanisms. The\ntimeline shows exactly that: ",[1089,4173,4174],{},"drive"," appears every loop, the timeout cancels it once ",[1089,4177,3183],{},"\nsimulated seconds have passed (in that loop ",[1089,4180,4174],{}," runs one last time and ",[1089,4183,4184],{},"shoot"," starts), and\nafter that nothing is left running. ",[1089,4187,4188],{},"withAutomaticName()"," builds the name from the\nmembers, which is how the printed name shows the order (",[1089,4191,4192],{},"->"," is a sequence; a parallel group would\nprint ",[1089,4195,4196],{},"&",") and the timeout. The constants class is ",[1089,4199,1267],{}," so nothing can extend it, and each\nconstant is ",[1089,4202,1485],{}," and named in ALL_CAPS, so changing a tunable number means editing\nexactly one line.",[2197,4205,2199],{},{"title":1107,"searchDepth":1158,"depth":1158,"links":4207},[4208,4209,4210],{"id":2760,"depth":1158,"text":2761},{"id":2871,"depth":1158,"text":2872},{"id":3110,"depth":1158,"text":3111},{"outlineRef":2212,"pairsWith":2747,"status":4212},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding); rewritten for the WPILib 2027 Commands v3 template",{"title":1040,"description":1107},"f8L5nP1S6kgLarP1Zyksiptqb2aAfmS2EswAGCn0MMY",1792718166831]