Treasure-Hunt
Treasure Hunt Game: Learn to Code
Curriculum Module
Created with R2022b. Compatible with R2022b and later releases.
Description
This curriculum module contains interactive live scripts that teach fundamental concepts and basic terminology related to programming computers. This includes discussion of variables, matrices, conditional statements, strings, arrays, indexing and functions.
These lessons can be used as part of a lecture, as activities in an instructional setting, or as interactive assignments to be completed outside class.
Please contact the MathWorks online teaching team with any feedback or questions.
Get started with the Treasure Hunt Game: Learn to Code interactive examples
Option 1: Download to Desktop Download and unzip the repository. Then, double-click the TreasureHunt.prj file inside MATLAB®.
Option 2: Log in to your MathWorks account to access your license. If you are associated with a university, use your university email to access a license.
- The instructions inside the live scripts will guide you through the exercises and activities.
- Get started with each live script by running it one section at a time.
- To stop running the script or a section midway (for example, if a loop is running longer than intended), click the
Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.
Prerequisite Domain Knowledge
This module assumes an ability to identify and plot X,Y points on a grid. It is also intended for those who have an understanding of basic computer science concepts, such as syntax, variables, and arrays. If you would like more practice with these concepts, we recommend trying the set of exercises in Fundamentals of Programming.
Details
treasureHuntLearn.mlx
This script walks the learner through the necessary steps to build the treasure hunting game, while teaching the relevant computer science concepts along the way.
treasureHuntLearnSoln.mlx
This script contains the solutions for the treasureHuntLearn.mlx script.
treasureHuntPlay.mlx
This script contains a barebones version of the playable treasure hunt game, with guidance for the learner to paste their code from treasureHuntLearn.mlx in order to make the game playable.
treasureHuntPlaySoln.mlx
This script contains the solutions for the treasureHuntPlay.mlx script.
Learning Goals
- Recognize and assign values to variables
- Recognize and use built-in MATLAB functions and live controls
- Interpret messages about syntax errors
- Write comments in code and explain their importance
- Use documentation to learn new functionality in a programming language
- Assign values to the elements of a matrix and manipulate matrices
- Identify and use conditional statements
- Create and use custom functions
Products
MATLAB®
License
The license for this module is available in the License.txt file in this GitHub repository.
Support
If you would like to provide feedback or have a question, contact the MathWorks online teaching team.
Copyright 2023 The MathWorks, Inc.
Cite As
Ryan Weinstein (2023). Treasure-Hunt (https://github.com/MathWorks-Teaching-Resources/Treasure-Hunt/releases/tag/v1.0.1), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Communities
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.1.0 | See release notes for this release on GitHub: https://github.com/MathWorks-Teaching-Resources/Treasure-Hunt/releases/tag/v1.0.1 |
||
1.0.0 |