Files
pplus-web/mojo/corpus/quest/manifest.json
T
2026-10-05 03:03:38 +00:00

4826 lines
206 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"items": [
{
"dialect": {},
"expect": {
"check": {
"stdout": "MQ Robotics control daemon starting"
},
"kind": "pass"
},
"file": "solutions/MQ_101.mojo",
"id": "quest/MQ-101/solution",
"meta": {
"concept": "Every Mojo program must include a function named `main()` as the entry point",
"docUrl": "https://mojolang.org/docs/manual/basics/#hello-world",
"file": "src/boot.mojo",
"hint": "Add a `def main():` whose body calls `boot()`.",
"title": "Wire up the program entry point",
"topic": "Language Basics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_101.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "MQ Robotics control daemon starting"
},
"kind": "fail"
},
"file": "starters/MQ_101.mojo",
"id": "quest/MQ-101/starter",
"meta": {
"concept": "Every Mojo program must include a function named `main()` as the entry point",
"docUrl": "https://mojolang.org/docs/manual/basics/#hello-world",
"file": "src/boot.mojo",
"hint": "Add a `def main():` whose body calls `boot()`.",
"title": "Wire up the program entry point",
"topic": "Language Basics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-101",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "MQ Robotics nav stack online"
},
"kind": "pass"
},
"file": "solutions/MQ_102.mojo",
"id": "quest/MQ-102/solution",
"meta": {
"concept": "Code blocks such as functions, conditions, and loops are defined with a colon followed by indented lines",
"docUrl": "https://mojolang.org/docs/manual/functions/#anatomy-of-a-function",
"file": "src/nav.mojo",
"hint": "Put 4 spaces before the `print` so it lives inside `main`.",
"title": "Get the navigation stack booting",
"topic": "Language Basics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_102.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "MQ Robotics nav stack online"
},
"kind": "fail"
},
"file": "starters/MQ_102.mojo",
"id": "quest/MQ-102/starter",
"meta": {
"concept": "Code blocks such as functions, conditions, and loops are defined with a colon followed by indented lines",
"docUrl": "https://mojolang.org/docs/manual/functions/#anatomy-of-a-function",
"file": "src/nav.mojo",
"hint": "Put 4 spaces before the `print` so it lives inside `main`.",
"title": "Get the navigation stack booting",
"topic": "Language Basics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-102",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "heartbeat ok"
},
"kind": "pass"
},
"file": "solutions/MQ_103.mojo",
"id": "quest/MQ-103/solution",
"meta": {
"concept": "Mojo uses the `def` keyword to define functions",
"docUrl": "https://mojolang.org/docs/manual/functions/#anatomy-of-a-function",
"file": "src/heartbeat.mojo",
"hint": "A function definition must begin with `def`. Add it before `heartbeat`.",
"title": "Define the heartbeat function",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_103.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "heartbeat ok"
},
"kind": "fail"
},
"file": "starters/MQ_103.mojo",
"id": "quest/MQ-103/starter",
"meta": {
"concept": "Mojo uses the `def` keyword to define functions",
"docUrl": "https://mojolang.org/docs/manual/functions/#anatomy-of-a-function",
"file": "src/heartbeat.mojo",
"hint": "A function definition must begin with `def`. Add it before `heartbeat`.",
"title": "Define the heartbeat function",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-103",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Grid cells: 12"
},
"kind": "pass"
},
"file": "solutions/MQ_104.mojo",
"id": "quest/MQ-104/solution",
"meta": {
"concept": "You must declare the type of each function parameter and argument; the return type follows `->`",
"docUrl": "https://mojolang.org/docs/manual/functions/#function-arguments",
"file": "src/grid.mojo",
"hint": "A `def` won't compile with bare arguments. Give each argument an explicit type and declare the type the function returns — both are integers here.",
"title": "Annotate the occupancy-grid size helper",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_104.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Grid cells: 12"
},
"kind": "fail"
},
"file": "starters/MQ_104.mojo",
"id": "quest/MQ-104/starter",
"meta": {
"concept": "You must declare the type of each function parameter and argument; the return type follows `->`",
"docUrl": "https://mojolang.org/docs/manual/functions/#function-arguments",
"file": "src/grid.mojo",
"hint": "A `def` won't compile with bare arguments. Give each argument an explicit type and declare the type the function returns — both are integers here.",
"title": "Annotate the occupancy-grid size helper",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-104",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "New capacity: 42"
},
"kind": "pass"
},
"file": "solutions/MQ_105.mojo",
"id": "quest/MQ-105/solution",
"meta": {
"concept": "Values are passed back using the `return` keyword; the return type is declared with the `-> type` syntax",
"docUrl": "https://mojolang.org/docs/manual/functions/#return-values",
"file": "src/ring_buffer.mojo",
"hint": "Right now the function hands back its input unchanged. Multiply it so the result is twice as large.",
"title": "Implement the ring-buffer capacity helper",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_105.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "New capacity: 42"
},
"kind": "fail"
},
"file": "starters/MQ_105.mojo",
"id": "quest/MQ-105/starter",
"meta": {
"concept": "Values are passed back using the `return` keyword; the return type is declared with the `-> type` syntax",
"docUrl": "https://mojolang.org/docs/manual/functions/#return-values",
"file": "src/ring_buffer.mojo",
"hint": "Right now the function hands back its input unchanged. Multiply it so the result is twice as large.",
"title": "Implement the ring-buffer capacity helper",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-105",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Add a triple-quoted docstring (\"\"\" … \"\"\" or ''' … ''') just below the function definition.",
"patterns": [
"(\"\"\"[\\s\\S]+?\"\"\"|'''[\\s\\S]+?''')"
]
},
"kind": "pass"
},
"file": "solutions/MQ_106.mojo",
"id": "quest/MQ-106/solution",
"meta": {
"concept": "A docstring is a string literal in triple quotes placed as the first statement in a function body",
"docUrl": "https://mojolang.org/docs/manual/functions/",
"file": "src/logging.mojo",
"hint": "Put a short sentence describing the function on its very first body line, wrapped in triple quotes — Mojo treats that as the docstring.",
"title": "Document the command logger",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_106.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Add a triple-quoted docstring (\"\"\" … \"\"\" or ''' … ''') just below the function definition.",
"patterns": [
"(\"\"\"[\\s\\S]+?\"\"\"|'''[\\s\\S]+?''')"
]
},
"kind": "fail"
},
"file": "starters/MQ_106.mojo",
"id": "quest/MQ-106/starter",
"meta": {
"concept": "A docstring is a string literal in triple quotes placed as the first statement in a function body",
"docUrl": "https://mojolang.org/docs/manual/functions/",
"file": "src/logging.mojo",
"hint": "Put a short sentence describing the function on its very first body line, wrapped in triple quotes — Mojo treats that as the docstring.",
"title": "Document the command logger",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-106",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "speed: 2 accel: 5"
},
"kind": "pass"
},
"file": "solutions/MQ_107.mojo",
"id": "quest/MQ-107/solution",
"meta": {
"concept": "Keyword arguments are specified using `argument_name = argument_value` and can be passed in any order",
"docUrl": "https://mojolang.org/docs/manual/functions/#keyword-arguments",
"file": "src/limits_set.mojo",
"hint": "Name each argument at the call site (the `name=value` form) so each value lands in the argument you intend, regardless of order.",
"title": "Pass the speed limits by keyword",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_107.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "speed: 2 accel: 5"
},
"kind": "fail"
},
"file": "starters/MQ_107.mojo",
"id": "quest/MQ-107/starter",
"meta": {
"concept": "Keyword arguments are specified using `argument_name = argument_value` and can be passed in any order",
"docUrl": "https://mojolang.org/docs/manual/functions/#keyword-arguments",
"file": "src/limits_set.mojo",
"hint": "Name each argument at the call site (the `name=value` form) so each value lands in the argument you intend, regardless of order.",
"title": "Pass the speed limits by keyword",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-107",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total: 1000"
},
"kind": "pass"
},
"file": "solutions/MQ_108.mojo",
"id": "quest/MQ-108/solution",
"meta": {
"concept": "An optional argument includes a default value, and must appear after any required arguments",
"docUrl": "https://mojolang.org/docs/manual/functions/#optional-arguments",
"file": "src/spin_up.mojo",
"hint": "Give the second argument a default value in the signature (assign it `100`). A one-argument call then fills it in automatically.",
"title": "Give the spin-up ramp a default",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_108.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total: 1000"
},
"kind": "fail"
},
"file": "starters/MQ_108.mojo",
"id": "quest/MQ-108/starter",
"meta": {
"concept": "An optional argument includes a default value, and must appear after any required arguments",
"docUrl": "https://mojolang.org/docs/manual/functions/#optional-arguments",
"file": "src/spin_up.mojo",
"hint": "Give the second argument a default value in the signature (assign it `100`). A one-argument call then fills it in automatically.",
"title": "Give the spin-up ramp a default",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-108",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "imu [verbose]"
},
"kind": "pass"
},
"file": "solutions/MQ_109.mojo",
"id": "quest/MQ-109/solution",
"meta": {
"concept": "A single star (`*`) in the argument list marks the following arguments as keyword-only",
"docUrl": "https://mojolang.org/docs/manual/functions/#positional-only-and-keyword-only-arguments",
"file": "src/diag.mojo",
"hint": "Everything after the bare `*` is keyword-only — supply that flag by name at the call site rather than positionally.",
"title": "Pass the keyword-only diagnostic flag",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_109.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "imu [verbose]"
},
"kind": "fail"
},
"file": "starters/MQ_109.mojo",
"id": "quest/MQ-109/starter",
"meta": {
"concept": "A single star (`*`) in the argument list marks the following arguments as keyword-only",
"docUrl": "https://mojolang.org/docs/manual/functions/#positional-only-and-keyword-only-arguments",
"file": "src/diag.mojo",
"hint": "Everything after the bare `*` is keyword-only — supply that flag by name at the call site rather than positionally.",
"title": "Pass the keyword-only diagnostic flag",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-109",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "sum: 12"
},
"kind": "pass"
},
"file": "solutions/MQ_110.mojo",
"id": "quest/MQ-110/solution",
"meta": {
"concept": "Use the variadic argument syntax `*argument_name` to accept a variable number of arguments",
"docUrl": "https://mojolang.org/docs/manual/functions/#variadic-arguments",
"file": "src/sum_readings.mojo",
"hint": "Prefix the argument with `*` so it collects all the positional arguments into one iterable you can loop over.",
"title": "Sum a variadic list of readings",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_110.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "sum: 12"
},
"kind": "fail"
},
"file": "starters/MQ_110.mojo",
"id": "quest/MQ-110/starter",
"meta": {
"concept": "Use the variadic argument syntax `*argument_name` to accept a variable number of arguments",
"docUrl": "https://mojolang.org/docs/manual/functions/#variadic-arguments",
"file": "src/sum_readings.mojo",
"hint": "Prefix the argument with `*` so it collects all the positional arguments into one iterable you can loop over.",
"title": "Sum a variadic list of readings",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-110",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "self-test stub ran"
},
"kind": "pass"
},
"file": "solutions/MQ_111.mojo",
"id": "quest/MQ-111/solution",
"meta": {
"concept": "Use `pass` as a no-op placeholder when a block requires a body but has nothing to do",
"docUrl": "https://mojolang.org/docs/manual/functions/#anatomy-of-a-function",
"file": "src/self_test.mojo",
"hint": "An indented block cannot be empty, and a comment does not count as a statement. Add the do-nothing placeholder statement (`pass`) as the function body so it compiles.",
"title": "Stub out the self-test routine",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_111.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "self-test stub ran"
},
"kind": "fail"
},
"file": "starters/MQ_111.mojo",
"id": "quest/MQ-111/starter",
"meta": {
"concept": "Use `pass` as a no-op placeholder when a block requires a body but has nothing to do",
"docUrl": "https://mojolang.org/docs/manual/functions/#anatomy-of-a-function",
"file": "src/self_test.mojo",
"hint": "An indented block cannot be empty, and a comment does not count as a statement. Add the do-nothing placeholder statement (`pass`) as the function body so it compiles.",
"title": "Stub out the self-test routine",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-111",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "16 6"
},
"kind": "pass"
},
"file": "solutions/MQ_113.mojo",
"id": "quest/MQ-113/solution",
"meta": {
"concept": "Implement separate versions of a function with different argument types to \"overload\" it",
"docUrl": "https://mojolang.org/docs/manual/functions/#overloaded-functions",
"file": "src/footprint.mojo",
"hint": "Mojo picks an overload by argument count/types. Add a second `def` with the same name but two `Int` arguments, alongside the existing one.",
"title": "Overload the footprint helper",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_113.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "16 6"
},
"kind": "fail"
},
"file": "starters/MQ_113.mojo",
"id": "quest/MQ-113/starter",
"meta": {
"concept": "Implement separate versions of a function with different argument types to \"overload\" it",
"docUrl": "https://mojolang.org/docs/manual/functions/#overloaded-functions",
"file": "src/footprint.mojo",
"hint": "Mojo picks an overload by argument count/types. Add a second `def` with the same name but two `Int` arguments, alongside the existing one.",
"title": "Overload the footprint helper",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-113",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "reading: 20"
},
"kind": "pass"
},
"file": "solutions/MQ_115.mojo",
"id": "quest/MQ-115/solution",
"meta": {
"concept": "Functions are non-raising by default; add the `raises` keyword to propagate an error to the caller",
"docUrl": "https://mojolang.org/docs/manual/functions/#raising-and-non-raising-functions",
"file": "src/sensor_read.mojo",
"hint": "Add `raises` to `main`’s signature so it can propagate the error from `read_sensor`.",
"title": "Propagate a raising sensor read",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_115.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "reading: 20"
},
"kind": "fail"
},
"file": "starters/MQ_115.mojo",
"id": "quest/MQ-115/starter",
"meta": {
"concept": "Functions are non-raising by default; add the `raises` keyword to propagate an error to the caller",
"docUrl": "https://mojolang.org/docs/manual/functions/#raising-and-non-raising-functions",
"file": "src/sensor_read.mojo",
"hint": "Add `raises` to `main`’s signature so it can propagate the error from `read_sensor`.",
"title": "Propagate a raising sensor read",
"topic": "Functions"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-115",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Declare `tick_count` explicitly with the `var` keyword.",
"patterns": [
"\\bvar\\s+tick_count\\b"
]
},
"kind": "pass"
},
"file": "solutions/MQ_201.mojo",
"id": "quest/MQ-201/solution",
"meta": {
"concept": "Explicitly-declared variables are created with the `var` keyword",
"docUrl": "https://mojolang.org/docs/manual/variables/#explicitly-declared-variables",
"file": "src/odometry.mojo",
"hint": "Without an explicit declaration keyword, the first assignment isn't a real variable definition. Add `var` to the line that first sets the counter.",
"title": "Declare the odometry tick counter with `var`",
"topic": "Variables"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_201.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Declare `tick_count` explicitly with the `var` keyword.",
"patterns": [
"\\bvar\\s+tick_count\\b"
]
},
"kind": "fail"
},
"file": "starters/MQ_201.mojo",
"id": "quest/MQ-201/starter",
"meta": {
"concept": "Explicitly-declared variables are created with the `var` keyword",
"docUrl": "https://mojolang.org/docs/manual/variables/#explicitly-declared-variables",
"file": "src/odometry.mojo",
"hint": "Without an explicit declaration keyword, the first assignment isn't a real variable definition. Add `var` to the line that first sets the counter.",
"title": "Declare the odometry tick counter with `var`",
"topic": "Variables"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-201",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "threshold: 10"
},
"kind": "pass"
},
"file": "solutions/MQ_202.mojo",
"id": "quest/MQ-202/solution",
"meta": {
"concept": "Late initialization works only if the variable is declared with a type",
"docUrl": "https://mojolang.org/docs/manual/variables/#explicitly-declared-variables",
"file": "src/threshold.mojo",
"hint": "When a `var` has no initializer, Mojo can’t infer its type — give the declaration an explicit `Int` type annotation after the name.",
"title": "Annotate a late-initialized variable",
"topic": "Variables"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_202.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "threshold: 10"
},
"kind": "fail"
},
"file": "starters/MQ_202.mojo",
"id": "quest/MQ-202/starter",
"meta": {
"concept": "Late initialization works only if the variable is declared with a type",
"docUrl": "https://mojolang.org/docs/manual/variables/#explicitly-declared-variables",
"file": "src/threshold.mojo",
"hint": "When a `var` has no initializer, Mojo can’t infer its type — give the declaration an explicit `Int` type annotation after the name.",
"title": "Annotate a late-initialized variable",
"topic": "Variables"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-202",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "count: 5"
},
"kind": "pass"
},
"file": "solutions/MQ_203.mojo",
"id": "quest/MQ-203/solution",
"meta": {
"concept": "Since variables are strongly typed, you can't assign a value of a different type",
"docUrl": "https://mojolang.org/docs/manual/variables/#type-annotations",
"file": "src/cast.mojo",
"hint": "Replace the quoted `\"5\"` with the integer `5` — the value must match the declared `Int` type.",
"title": "Fix the sensor-count type mismatch",
"topic": "Variables"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_203.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "count: 5"
},
"kind": "fail"
},
"file": "starters/MQ_203.mojo",
"id": "quest/MQ-203/starter",
"meta": {
"concept": "Since variables are strongly typed, you can't assign a value of a different type",
"docUrl": "https://mojolang.org/docs/manual/variables/#type-annotations",
"file": "src/cast.mojo",
"hint": "Replace the quoted `\"5\"` with the integer `5` — the value must match the declared `Int` type.",
"title": "Fix the sensor-count type mismatch",
"topic": "Variables"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-203",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "a: 4 b: 3"
},
"kind": "pass"
},
"file": "solutions/MQ_207.mojo",
"id": "quest/MQ-207/solution",
"meta": {
"concept": "A variable owns its value; ownership is transferred with the `^` sigil, which leaves the source uninitialized",
"docUrl": "https://mojolang.org/docs/manual/variables/#variable-semantics",
"file": "src/copy_move.mojo",
"hint": "The `^` hands ownership away, leaving the original consumed. Mojo wants copies to be explicit, so ask the list for one with its `.copy()` method instead of moving it.",
"title": "Keep the original after handing one off",
"topic": "Value Semantics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_207.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "a: 4 b: 3"
},
"kind": "fail"
},
"file": "starters/MQ_207.mojo",
"id": "quest/MQ-207/starter",
"meta": {
"concept": "A variable owns its value; ownership is transferred with the `^` sigil, which leaves the source uninitialized",
"docUrl": "https://mojolang.org/docs/manual/variables/#variable-semantics",
"file": "src/copy_move.mojo",
"hint": "The `^` hands ownership away, leaving the original consumed. Mojo wants copies to be explicit, so ask the list for one with its `.copy()` method instead of moving it.",
"title": "Keep the original after handing one off",
"topic": "Value Semantics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-207",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "first: 99"
},
"kind": "pass"
},
"file": "solutions/MQ_208.mojo",
"id": "quest/MQ-208/solution",
"meta": {
"concept": "Use the `ref name` syntax to bind a reference to a value rather than an owned copy",
"docUrl": "https://mojolang.org/docs/manual/values/lifetimes/",
"file": "src/ref_bind.mojo",
"hint": "Bind the name with `ref` instead of `var` so it aliases the list element in place rather than copying it out.",
"title": "Bind a mutable reference into the buffer",
"topic": "Value Semantics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_208.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "first: 99"
},
"kind": "fail"
},
"file": "starters/MQ_208.mojo",
"id": "quest/MQ-208/starter",
"meta": {
"concept": "Use the `ref name` syntax to bind a reference to a value rather than an owned copy",
"docUrl": "https://mojolang.org/docs/manual/values/lifetimes/",
"file": "src/ref_bind.mojo",
"hint": "Bind the name with `ref` instead of `var` so it aliases the list element in place rather than copying it out.",
"title": "Bind a mutable reference into the buffer",
"topic": "Value Semantics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-208",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total: 1100"
},
"kind": "pass"
},
"file": "solutions/MQ_210.mojo",
"id": "quest/MQ-210/solution",
"meta": {
"concept": "Numeric operators don't automatically narrow or widen operands to a common type",
"docUrl": "https://mojolang.org/docs/manual/types/#numeric-type-conversion",
"file": "src/numeric_types.mojo",
"hint": "Widen the narrow value to `Int64` before the addition so both operands share the same type.",
"title": "Add across two integer widths",
"topic": "Types"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_210.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total: 1100"
},
"kind": "fail"
},
"file": "starters/MQ_210.mojo",
"id": "quest/MQ-210/starter",
"meta": {
"concept": "Numeric operators don't automatically narrow or widen operands to a common type",
"docUrl": "https://mojolang.org/docs/manual/types/#numeric-type-conversion",
"file": "src/numeric_types.mojo",
"hint": "Widen the narrow value to `Int64` before the addition so both operands share the same type.",
"title": "Add across two integer widths",
"topic": "Types"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-210",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "avg latency: 3.5"
},
"kind": "pass"
},
"file": "solutions/MQ_211.mojo",
"id": "quest/MQ-211/solution",
"meta": {
"concept": "Convert the operands to the target type's constructor before dividing to avoid integer truncation",
"docUrl": "https://mojolang.org/docs/manual/types/#numeric-type-conversion",
"file": "src/latency.mojo",
"hint": "Dividing two whole numbers happens in integer space and drops the remainder before the value is ever widened to a float, so 7 over 2 loses its .5. Convert each operand to a floating-point type first, then divide.",
"title": "Stop truncating the average loop latency",
"topic": "Types"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_211.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "avg latency: 3.5"
},
"kind": "fail"
},
"file": "starters/MQ_211.mojo",
"id": "quest/MQ-211/starter",
"meta": {
"concept": "Convert the operands to the target type's constructor before dividing to avoid integer truncation",
"docUrl": "https://mojolang.org/docs/manual/types/#numeric-type-conversion",
"file": "src/latency.mojo",
"hint": "Dividing two whole numbers happens in integer space and drops the remainder before the value is ever widened to a float, so 7 over 2 loses its .5. Convert each operand to a floating-point type first, then divide.",
"title": "Stop truncating the average loop latency",
"topic": "Types"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-211",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Velocity lane 0: 1.0"
},
"kind": "pass"
},
"file": "solutions/MQ_213.mojo",
"id": "quest/MQ-213/solution",
"meta": {
"concept": "A `SIMD` value is a fixed-size vector defined by two parameters: a `DType` and the number of elements",
"docUrl": "https://mojolang.org/docs/manual/types/#simd-and-dtype",
"file": "src/velocity.mojo",
"hint": "The name `Velocity` is undefined until you create it. Bind it with `comptime` at file scope (above `main`) to that 4-lane float32 SIMD type so it is in scope when `main` constructs it.",
"title": "Define the velocity vector type",
"topic": "SIMD & DType"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_213.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Velocity lane 0: 1.0"
},
"kind": "fail"
},
"file": "starters/MQ_213.mojo",
"id": "quest/MQ-213/starter",
"meta": {
"concept": "A `SIMD` value is a fixed-size vector defined by two parameters: a `DType` and the number of elements",
"docUrl": "https://mojolang.org/docs/manual/types/#simd-and-dtype",
"file": "src/velocity.mojo",
"hint": "The name `Velocity` is undefined until you create it. Bind it with `comptime` at file scope (above `main`) to that 4-lane float32 SIMD type so it is in scope when `main` constructs it.",
"title": "Define the velocity vector type",
"topic": "SIMD & DType"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-213",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Combined counts: [11, 22, 33, 44]"
},
"kind": "pass"
},
"file": "solutions/MQ_214.mojo",
"id": "quest/MQ-214/solution",
"meta": {
"concept": "Math operations on SIMD values are applied elementwise, on each individual element in the vector",
"docUrl": "https://mojolang.org/docs/manual/types/#simd-and-dtype",
"file": "src/imu_counts.mojo",
"hint": "The helper returns only the first IMU as written. Combine both vectors with the addition operator — on SIMD values it adds lane by lane — and return that instead.",
"title": "Combine per-axis counts from two IMUs",
"topic": "SIMD & DType"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_214.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Combined counts: [11, 22, 33, 44]"
},
"kind": "fail"
},
"file": "starters/MQ_214.mojo",
"id": "quest/MQ-214/starter",
"meta": {
"concept": "Math operations on SIMD values are applied elementwise, on each individual element in the vector",
"docUrl": "https://mojolang.org/docs/manual/types/#simd-and-dtype",
"file": "src/imu_counts.mojo",
"hint": "The helper returns only the first IMU as written. Combine both vectors with the addition operator — on SIMD values it adds lane by lane — and return that instead.",
"title": "Combine per-axis counts from two IMUs",
"topic": "SIMD & DType"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-214",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "MQ-AMR"
},
"kind": "pass"
},
"file": "solutions/MQ_215.mojo",
"id": "quest/MQ-215/solution",
"meta": {
"concept": "`String` supports a variety of operators and common methods, such as `upper()`",
"docUrl": "https://mojolang.org/docs/std/builtin/string_literal/StringLiteral/#upper",
"file": "src/device_tag.mojo",
"hint": "The pieces are joined correctly, but the registry only accepts a single case. String has a method that returns an upper-cased copy — apply it to the whole joined tag, watching the parentheses so the entire string is transformed.",
"title": "Emit device tags in uppercase",
"topic": "Strings"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_215.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "MQ-AMR"
},
"kind": "fail"
},
"file": "starters/MQ_215.mojo",
"id": "quest/MQ-215/starter",
"meta": {
"concept": "`String` supports a variety of operators and common methods, such as `upper()`",
"docUrl": "https://mojolang.org/docs/std/builtin/string_literal/StringLiteral/#upper",
"file": "src/device_tag.mojo",
"hint": "The pieces are joined correctly, but the registry only accepts a single case. String has a method that returns an upper-cased copy — apply it to the whole joined tag, watching the parentheses so the entire string is transformed.",
"title": "Emit device tags in uppercase",
"topic": "Strings"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-215",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "first waypoint: 15\nwaypoints: 3"
},
"kind": "pass"
},
"file": "solutions/MQ_219.mojo",
"id": "quest/MQ-219/solution",
"meta": {
"concept": "Index a `List` with `list[i]` to read an element; assign to `list[i]` to replace it in place",
"docUrl": "https://mojolang.org/docs/manual/types/#list",
"file": "src/path.mojo",
"hint": "Remove the `append` call and write directly to the slot: `path[0] = corrected`.",
"title": "Correct the first waypoint in the path",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_219.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "first waypoint: 15\nwaypoints: 3"
},
"kind": "fail"
},
"file": "starters/MQ_219.mojo",
"id": "quest/MQ-219/starter",
"meta": {
"concept": "Index a `List` with `list[i]` to read an element; assign to `list[i]` to replace it in place",
"docUrl": "https://mojolang.org/docs/manual/types/#list",
"file": "src/path.mojo",
"hint": "Remove the `append` call and write directly to the slot: `path[0] = corrected`.",
"title": "Correct the first waypoint in the path",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-219",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "scans: 4\npoints: 512"
},
"kind": "pass"
},
"file": "solutions/MQ_220.mojo",
"id": "quest/MQ-220/solution",
"meta": {
"concept": "A `Tuple` is an ordered collection; unpack it or index it to get individual values",
"docUrl": "https://mojolang.org/docs/manual/types/#tuples",
"file": "src/telemetry.mojo",
"hint": "A tuple keeps its elements in the order they were packed. The pair is built as (scans, then points), but the two reads pull from the opposite slots. Match each index to the position it was placed in.",
"title": "Unpack the telemetry stats in the right order",
"topic": "Tuples"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_220.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "scans: 4\npoints: 512"
},
"kind": "fail"
},
"file": "starters/MQ_220.mojo",
"id": "quest/MQ-220/starter",
"meta": {
"concept": "A `Tuple` is an ordered collection; unpack it or index it to get individual values",
"docUrl": "https://mojolang.org/docs/manual/types/#tuples",
"file": "src/telemetry.mojo",
"hint": "A tuple keeps its elements in the order they were packed. The pair is built as (scans, then points), but the two reads pull from the opposite slots. Match each index to the position it was placed in.",
"title": "Unpack the telemetry stats in the right order",
"topic": "Tuples"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-220",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Queued waypoints: 2"
},
"kind": "pass"
},
"file": "solutions/MQ_221.mojo",
"id": "quest/MQ-221/solution",
"meta": {
"concept": "A given `List` can only hold one type of value, specified at compile time as a parameter",
"docUrl": "https://mojolang.org/docs/manual/types/#list",
"file": "src/waypoints.mojo",
"hint": "`List` is generic, so it must know what it holds. Specify the element type in square brackets when you construct it.",
"title": "Type the waypoint queue",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_221.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Queued waypoints: 2"
},
"kind": "fail"
},
"file": "starters/MQ_221.mojo",
"id": "quest/MQ-221/starter",
"meta": {
"concept": "A given `List` can only hold one type of value, specified at compile time as a parameter",
"docUrl": "https://mojolang.org/docs/manual/types/#list",
"file": "src/waypoints.mojo",
"hint": "`List` is generic, so it must know what it holds. Specify the element type in square brackets when you construct it.",
"title": "Type the waypoint queue",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-221",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "joint angle: 128\njoints: 2"
},
"kind": "pass"
},
"file": "solutions/MQ_222.mojo",
"id": "quest/MQ-222/solution",
"meta": {
"concept": "`Dict` holds key-value pairs; specify the key type and value type as parameters",
"docUrl": "https://mojolang.org/docs/manual/types/#dict",
"file": "src/joint_map.mojo",
"hint": "Two fixes. Add the missing entry with `joint_angles[\"joint_8\"] = 256`. And because looking a key up in a `Dict` can fail when the key is absent, that read is a raising call — a function that calls something raising must advertise it, so add `raises` to the header of `main`.",
"title": "Compile the joint-angle lookup",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_222.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "joint angle: 128\njoints: 2"
},
"kind": "fail"
},
"file": "starters/MQ_222.mojo",
"id": "quest/MQ-222/starter",
"meta": {
"concept": "`Dict` holds key-value pairs; specify the key type and value type as parameters",
"docUrl": "https://mojolang.org/docs/manual/types/#dict",
"file": "src/joint_map.mojo",
"hint": "Two fixes. Add the missing entry with `joint_angles[\"joint_8\"] = 256`. And because looking a key up in a `Dict` can fail when the key is absent, that read is a raising call — a function that calls something raising must advertise it, so add `raises` to the header of `main`.",
"title": "Compile the joint-angle lookup",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-222",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "unique: 2"
},
"kind": "pass"
},
"file": "solutions/MQ_223.mojo",
"id": "quest/MQ-223/solution",
"meta": {
"concept": "`Set` represents a collection of unique values",
"docUrl": "https://mojolang.org/docs/manual/types/#set",
"file": "src/unique_ids.mojo",
"hint": "Specify the element type when constructing: `Set[Int]()`.",
"title": "Deduplicate sensor ids with a Set",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_223.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "unique: 2"
},
"kind": "fail"
},
"file": "starters/MQ_223.mojo",
"id": "quest/MQ-223/starter",
"meta": {
"concept": "`Set` represents a collection of unique values",
"docUrl": "https://mojolang.org/docs/manual/types/#set",
"file": "src/unique_ids.mojo",
"hint": "Specify the element type when constructing: `Set[Int]()`.",
"title": "Deduplicate sensor ids with a Set",
"topic": "Collections"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-223",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "hit: 512\nmiss: None"
},
"kind": "pass"
},
"file": "solutions/MQ_224.mojo",
"id": "quest/MQ-224/solution",
"meta": {
"concept": "An `Optional` represents a value that may or may not be present",
"docUrl": "https://mojolang.org/docs/manual/types/#optional",
"file": "src/calib_cache.mojo",
"hint": "The return type `Int` cannot represent “no value”. Import the right type from `std.collections` and use it as a wrapper around `Int` in the return annotation — that tells Mojo the function may return nothing.",
"title": "Type a calibration-cache miss",
"topic": "Options"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_224.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "hit: 512\nmiss: None"
},
"kind": "fail"
},
"file": "starters/MQ_224.mojo",
"id": "quest/MQ-224/starter",
"meta": {
"concept": "An `Optional` represents a value that may or may not be present",
"docUrl": "https://mojolang.org/docs/manual/types/#optional",
"file": "src/calib_cache.mojo",
"hint": "The return type `Int` cannot represent “no value”. Import the right type from `std.collections` and use it as a wrapper around `Int` in the return annotation — that tells Mojo the function may return nothing.",
"title": "Type a calibration-cache miss",
"topic": "Options"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-224",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "area: 16"
},
"kind": "pass"
},
"file": "solutions/MQ_301.mojo",
"id": "quest/MQ-301/solution",
"meta": {
"concept": "Exponentiation uses two stars (`**`), not a caret",
"docUrl": "https://mojolang.org/docs/manual/operators/#arithmetic-operators",
"file": "src/exponent.mojo",
"hint": "Multiplying by 2 only doubles. Reach for the exponentiation operator (`**`) to raise the side to the power 2.",
"title": "Square the value with exponentiation",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_301.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "area: 16"
},
"kind": "fail"
},
"file": "starters/MQ_301.mojo",
"id": "quest/MQ-301/starter",
"meta": {
"concept": "Exponentiation uses two stars (`**`), not a caret",
"docUrl": "https://mojolang.org/docs/manual/operators/#arithmetic-operators",
"file": "src/exponent.mojo",
"hint": "Multiplying by 2 only doubles. Reach for the exponentiation operator (`**`) to raise the side to the power 2.",
"title": "Square the value with exponentiation",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-301",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "bins: 3 left: 2"
},
"kind": "pass"
},
"file": "solutions/MQ_302.mojo",
"id": "quest/MQ-302/solution",
"meta": {
"concept": "Use `//` for floor division; the modulo operator `%` returns the remainder",
"docUrl": "https://mojolang.org/docs/manual/operators/#arithmetic-operators",
"file": "src/divmod.mojo",
"hint": "`//` gives the whole number of bins; `%` gives the remainder. They are swapped — exchange them.",
"title": "Split readings into full bins",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_302.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "bins: 3 left: 2"
},
"kind": "fail"
},
"file": "starters/MQ_302.mojo",
"id": "quest/MQ-302/starter",
"meta": {
"concept": "Use `//` for floor division; the modulo operator `%` returns the remainder",
"docUrl": "https://mojolang.org/docs/manual/operators/#arithmetic-operators",
"file": "src/divmod.mojo",
"hint": "`//` gives the whole number of bins; `%` gives the remainder. They are swapped — exchange them.",
"title": "Split readings into full bins",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-302",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "low: True"
},
"kind": "pass"
},
"file": "solutions/MQ_303.mojo",
"id": "quest/MQ-303/solution",
"meta": {
"concept": "Mojo provides six comparison operators: `==`, `!=`, `<`, `<=`, `>`, and `>=`, each returning a `Bool`",
"docUrl": "https://mojolang.org/docs/manual/operators/#comparison-operators",
"file": "src/compare.mojo",
"hint": "A strict `<` excludes the boundary. Use `<=` so 20 counts as low.",
"title": "Flag a low battery at the threshold",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_303.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "low: True"
},
"kind": "fail"
},
"file": "starters/MQ_303.mojo",
"id": "quest/MQ-303/starter",
"meta": {
"concept": "Mojo provides six comparison operators: `==`, `!=`, `<`, `<=`, `>`, and `>=`, each returning a `Bool`",
"docUrl": "https://mojolang.org/docs/manual/operators/#comparison-operators",
"file": "src/compare.mojo",
"hint": "A strict `<` excludes the boundary. Use `<=` so 20 counts as low.",
"title": "Flag a low battery at the threshold",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-303",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "in range: False"
},
"kind": "pass"
},
"file": "solutions/MQ_304.mojo",
"id": "quest/MQ-304/solution",
"meta": {
"concept": "You can chain comparisons; `a < b < c` is equivalent to `(a < b) and (b < c)`",
"docUrl": "https://mojolang.org/docs/manual/operators/#comparison-operators",
"file": "src/chained.mojo",
"hint": "Extend the single comparison into a chained one that also tests the upper bound (85) in the same expression.",
"title": "Bound-check with a chained comparison",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_304.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "in range: False"
},
"kind": "fail"
},
"file": "starters/MQ_304.mojo",
"id": "quest/MQ-304/starter",
"meta": {
"concept": "You can chain comparisons; `a < b < c` is equivalent to `(a < b) and (b < c)`",
"docUrl": "https://mojolang.org/docs/manual/operators/#comparison-operators",
"file": "src/chained.mojo",
"hint": "Extend the single comparison into a chained one that also tests the upper bound (85) in the same expression.",
"title": "Bound-check with a chained comparison",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-304",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "armed: True"
},
"kind": "pass"
},
"file": "solutions/MQ_305.mojo",
"id": "quest/MQ-305/solution",
"meta": {
"concept": "Bitwise OR (`|`) keeps bits that are set in either operand",
"docUrl": "https://mojolang.org/docs/manual/operators/#bitwise-operators",
"file": "src/flags.mojo",
"hint": "Combining flags means setting both bits — that’s bitwise OR (`|`), not AND. The `&` in the test below is correct; it checks whether a bit is set.",
"title": "Combine status flags with bitwise OR",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_305.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "armed: True"
},
"kind": "fail"
},
"file": "starters/MQ_305.mojo",
"id": "quest/MQ-305/starter",
"meta": {
"concept": "Bitwise OR (`|`) keeps bits that are set in either operand",
"docUrl": "https://mojolang.org/docs/manual/operators/#bitwise-operators",
"file": "src/flags.mojo",
"hint": "Combining flags means setting both bits — that’s bitwise OR (`|`), not AND. The `&` in the test below is correct; it checks whether a bit is set.",
"title": "Combine status flags with bitwise OR",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-305",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "go: False"
},
"kind": "pass"
},
"file": "solutions/MQ_306.mojo",
"id": "quest/MQ-306/solution",
"meta": {
"concept": "With `and`, both operands must be truthy; if the left side is falsy, the right side isn't evaluated",
"docUrl": "https://mojolang.org/docs/manual/operators/#boolean-operators",
"file": "src/preconditions.mojo",
"hint": "Replace `or` with `and` so both preconditions are required before driving.",
"title": "Require both preconditions",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_306.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "go: False"
},
"kind": "fail"
},
"file": "starters/MQ_306.mojo",
"id": "quest/MQ-306/starter",
"meta": {
"concept": "With `and`, both operands must be truthy; if the left side is falsy, the right side isn't evaluated",
"docUrl": "https://mojolang.org/docs/manual/operators/#boolean-operators",
"file": "src/preconditions.mojo",
"hint": "Replace `or` with `and` so both preconditions are required before driving.",
"title": "Require both preconditions",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-306",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "ok: True"
},
"kind": "pass"
},
"file": "solutions/MQ_308.mojo",
"id": "quest/MQ-308/solution",
"meta": {
"concept": "The `in` operator checks whether a collection contains a value",
"docUrl": "https://mojolang.org/docs/manual/operators/#membership-operators",
"file": "src/membership.mojo",
"hint": "You want to test for presence, not absence — drop the `not` so it uses the plain membership operator.",
"title": "Check membership in the allow-list",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_308.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "ok: True"
},
"kind": "fail"
},
"file": "starters/MQ_308.mojo",
"id": "quest/MQ-308/starter",
"meta": {
"concept": "The `in` operator checks whether a collection contains a value",
"docUrl": "https://mojolang.org/docs/manual/operators/#membership-operators",
"file": "src/membership.mojo",
"hint": "You want to test for presence, not absence — drop the `not` so it uses the plain membership operator.",
"title": "Check membership in the allow-list",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-308",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "mode: fast"
},
"kind": "pass"
},
"file": "solutions/MQ_309.mojo",
"id": "quest/MQ-309/solution",
"meta": {
"concept": "A conditional expression has the form `value_if_true if condition else value_if_false`",
"docUrl": "https://mojolang.org/docs/manual/operators/#conditional-expressions",
"file": "src/ternary.mojo",
"hint": "Mojo has no `? :` operator. Rewrite it in the `value if condition else other` form.",
"title": "Pick a label with a conditional expression",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_309.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "mode: fast"
},
"kind": "fail"
},
"file": "starters/MQ_309.mojo",
"id": "quest/MQ-309/starter",
"meta": {
"concept": "A conditional expression has the form `value_if_true if condition else value_if_false`",
"docUrl": "https://mojolang.org/docs/manual/operators/#conditional-expressions",
"file": "src/ternary.mojo",
"hint": "Mojo has no `? :` operator. Rewrite it in the `value if condition else other` form.",
"title": "Pick a label with a conditional expression",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-309",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "scale: 6"
},
"kind": "pass"
},
"file": "solutions/MQ_310.mojo",
"id": "quest/MQ-310/solution",
"meta": {
"concept": "Compound assignment forms like `*=` update the left-hand value instead of creating a new one",
"docUrl": "https://mojolang.org/docs/manual/operators/#assignment-operators",
"file": "src/assign_op.mojo",
"hint": "Plain `=` replaces the value. Use the compound multiply-assign operator (`*=`) so it multiplies the existing value instead.",
"title": "Scale a value in place",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_310.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "scale: 6"
},
"kind": "fail"
},
"file": "starters/MQ_310.mojo",
"id": "quest/MQ-310/starter",
"meta": {
"concept": "Compound assignment forms like `*=` update the left-hand value instead of creating a new one",
"docUrl": "https://mojolang.org/docs/manual/operators/#assignment-operators",
"file": "src/assign_op.mojo",
"hint": "Plain `=` replaces the value. Use the compound multiply-assign operator (`*=`) so it multiplies the existing value instead.",
"title": "Scale a value in place",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-310",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total distance: 20"
},
"kind": "pass"
},
"file": "solutions/MQ_312.mojo",
"id": "quest/MQ-312/solution",
"meta": {
"concept": "Precedence determines what runs first (multiply before add); when in doubt, use parentheses",
"docUrl": "https://mojolang.org/docs/manual/operators/#precedence",
"file": "src/path_cost.mojo",
"hint": "Multiplication binds tighter than addition, so the multiply happens first as written. Group the addition so it evaluates before the multiply.",
"title": "Fix the path-cost formula",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_312.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total distance: 20"
},
"kind": "fail"
},
"file": "starters/MQ_312.mojo",
"id": "quest/MQ-312/starter",
"meta": {
"concept": "Precedence determines what runs first (multiply before add); when in doubt, use parentheses",
"docUrl": "https://mojolang.org/docs/manual/operators/#precedence",
"file": "src/path_cost.mojo",
"hint": "Multiplication binds tighter than addition, so the multiply happens first as written. Group the addition so it evaluates before the multiply.",
"title": "Fix the path-cost formula",
"topic": "Operators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-312",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "overflow-core\nfast-core"
},
"kind": "pass"
},
"file": "solutions/MQ_320.mojo",
"id": "quest/MQ-320/solution",
"meta": {
"concept": "The `if` statement executes an indented block when its boolean expression evaluates to `True`",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#the-if-statement",
"file": "src/scheduler_route.mojo",
"hint": "A deep queue means that core is busy. Read the condition against the threshold: a queue of 250 should reach the overflow branch, but the comparison currently sends it the other way. Flip the relational operator.",
"title": "Route deep task queues to the backup core",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_320.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "overflow-core\nfast-core"
},
"kind": "fail"
},
"file": "starters/MQ_320.mojo",
"id": "quest/MQ-320/starter",
"meta": {
"concept": "The `if` statement executes an indented block when its boolean expression evaluates to `True`",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#the-if-statement",
"file": "src/scheduler_route.mojo",
"hint": "A deep queue means that core is busy. Read the condition against the threshold: a queue of 250 should reach the overflow branch, but the comparison currently sends it the other way. Flip the relational operator.",
"title": "Route deep task queues to the backup core",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-320",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Retry budget: 15"
},
"kind": "pass"
},
"file": "solutions/MQ_321.mojo",
"id": "quest/MQ-321/solution",
"meta": {
"concept": "The `while` loop repeatedly executes a block while its boolean expression evaluates to `True`",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#the-while-statement",
"file": "src/reconnect.mojo",
"hint": "The loop variable never changes, so the condition stays true forever. Advance it by one at the end of each pass so the loop can eventually finish.",
"title": "Stop the reconnect loop from spinning forever",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_321.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Retry budget: 15"
},
"kind": "fail"
},
"file": "starters/MQ_321.mojo",
"id": "quest/MQ-321/starter",
"meta": {
"concept": "The `while` loop repeatedly executes a block while its boolean expression evaluates to `True`",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#the-while-statement",
"file": "src/reconnect.mojo",
"hint": "The loop variable never changes, so the condition stays true forever. Advance it by one at the end of each pass so the loop can eventually finish.",
"title": "Stop the reconnect loop from spinning forever",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-321",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Scheduled units: 27"
},
"kind": "pass"
},
"file": "solutions/MQ_322.mojo",
"id": "quest/MQ-322/solution",
"meta": {
"concept": "In a `for` loop, `continue` skips the rest of the block and resumes with the next element",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#for-loop-control-statements",
"file": "src/loop_scheduler.mojo",
"hint": "You want the loop-control statement that abandons only the current iteration and moves on to the next — not the one that exits the loop entirely. Put it where the comment is.",
"title": "Skip reserved slots in the loop scheduler",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_322.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Scheduled units: 27"
},
"kind": "fail"
},
"file": "starters/MQ_322.mojo",
"id": "quest/MQ-322/starter",
"meta": {
"concept": "In a `for` loop, `continue` skips the rest of the block and resumes with the next element",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#for-loop-control-statements",
"file": "src/loop_scheduler.mojo",
"hint": "You want the loop-control statement that abandons only the current iteration and moves on to the next — not the one that exits the loop entirely. Put it where the comment is.",
"title": "Skip reserved slots in the loop scheduler",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-322",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "boost\ncruise\nsleep"
},
"kind": "pass"
},
"file": "solutions/MQ_323.mojo",
"id": "quest/MQ-323/solution",
"meta": {
"concept": "Use `elif` to add another condition to an `if`, checked only when the earlier branches were false",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#the-if-statement",
"file": "src/power_mode.mojo",
"hint": "The two-way `if`/`else` has no slot for the middle tier, so 50 falls through to `sleep`. Insert an `elif level >= 30:` branch between the `if` and the `else` that returns `cruise`.",
"title": "Add the cruise power tier",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_323.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "boost\ncruise\nsleep"
},
"kind": "fail"
},
"file": "starters/MQ_323.mojo",
"id": "quest/MQ-323/starter",
"meta": {
"concept": "Use `elif` to add another condition to an `if`, checked only when the earlier branches were false",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#the-if-statement",
"file": "src/power_mode.mojo",
"hint": "The two-way `if`/`else` has no slot for the middle tier, so 50 falls through to `sleep`. Insert an `elif level >= 30:` branch between the `if` and the `else` that returns `cruise`.",
"title": "Add the cruise power tier",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-323",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total: 20"
},
"kind": "pass"
},
"file": "solutions/MQ_324.mojo",
"id": "quest/MQ-324/solution",
"meta": {
"concept": "A range is a sequence of integers generated by `range(start, stop, step)`",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#iterating-over-a-range",
"file": "src/range_step.mojo",
"hint": "`range` takes an optional third argument for the step. Give it one so the loop advances two at a time.",
"title": "Step through every other slot",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_324.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total: 20"
},
"kind": "fail"
},
"file": "starters/MQ_324.mojo",
"id": "quest/MQ-324/starter",
"meta": {
"concept": "A range is a sequence of integers generated by `range(start, stop, step)`",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#iterating-over-a-range",
"file": "src/range_step.mojo",
"hint": "`range` takes an optional third argument for the step. Give it one so the loop advances two at a time.",
"title": "Step through every other slot",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-324",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "first: 11"
},
"kind": "pass"
},
"file": "solutions/MQ_325.mojo",
"id": "quest/MQ-325/solution",
"meta": {
"concept": "Add the `ref` keyword before the loop variable to bind a reference and mutate the collection in place",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#iterating-by-reference",
"file": "src/iter_ref.mojo",
"hint": "Add `ref` to the loop binding so each element is aliased in place; then the `+= 10` writes back to the list instead of to a copy.",
"title": "Mutate readings in place while iterating",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_325.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "first: 11"
},
"kind": "fail"
},
"file": "starters/MQ_325.mojo",
"id": "quest/MQ-325/starter",
"meta": {
"concept": "Add the `ref` keyword before the loop variable to bind a reference and mutate the collection in place",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#iterating-by-reference",
"file": "src/iter_ref.mojo",
"hint": "Add `ref` to the loop binding so each element is aliased in place; then the `+= 10` writes back to the list instead of to a copy.",
"title": "Mutate readings in place while iterating",
"topic": "Control Flow"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-325",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total points: 45"
},
"kind": "pass"
},
"file": "solutions/MQ_326.mojo",
"id": "quest/MQ-326/solution",
"meta": {
"concept": "All collection types in the `collections` module support `for` loop iteration over each element",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#iterating-over-mojo-collections",
"file": "src/scan_meter.mojo",
"hint": "The loop visits every return, but each pass throws away what came before and keeps only the current value — that is why you see the final element instead of the sum. The accumulator should grow with each item.",
"title": "Sum every point in the scan batch",
"topic": "Iterators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_326.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "total points: 45"
},
"kind": "fail"
},
"file": "starters/MQ_326.mojo",
"id": "quest/MQ-326/starter",
"meta": {
"concept": "All collection types in the `collections` module support `for` loop iteration over each element",
"docUrl": "https://mojolang.org/docs/manual/control-flow/#iterating-over-mojo-collections",
"file": "src/scan_meter.mojo",
"hint": "The loop visits every return, but each pass throws away what came before and keeps only the current value — that is why you see the final element instead of the sum. The accumulator should grow with each item.",
"title": "Sum every point in the scan batch",
"topic": "Iterators"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-326",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Raise an `Error` in the invalid-velocity branch, and declare both `validate_velocity` and `main` as `raises`.",
"patterns": [
"validate_velocity\\([^)]*\\)\\s+raises",
"def\\s+main\\(\\)\\s+raises",
"raise\\s+Error\\("
]
},
"kind": "pass"
},
"file": "solutions/MQ_401.mojo",
"id": "quest/MQ-401/solution",
"meta": {
"concept": "By declaring `raises`, you tell Mojo a function may raise an error; raise one with `raise Error(\"...\")`",
"docUrl": "https://mojolang.org/docs/manual/errors/#raise-an-error",
"file": "src/limits.mojo",
"hint": "Three edits. Replace the placeholder in the `if n <= 0` branch with `raise Error(\"velocity must be positive\")`. Add `raises` to `validate_velocity`'s signature (after the argument list, before `-> Int`). Then add `raises` to `main` so the error can propagate out of it.",
"title": "Reject invalid velocity commands with an error",
"topic": "Error Handling"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_401.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Raise an `Error` in the invalid-velocity branch, and declare both `validate_velocity` and `main` as `raises`.",
"patterns": [
"validate_velocity\\([^)]*\\)\\s+raises",
"def\\s+main\\(\\)\\s+raises",
"raise\\s+Error\\("
]
},
"kind": "fail"
},
"file": "starters/MQ_401.mojo",
"id": "quest/MQ-401/starter",
"meta": {
"concept": "By declaring `raises`, you tell Mojo a function may raise an error; raise one with `raise Error(\"...\")`",
"docUrl": "https://mojolang.org/docs/manual/errors/#raise-an-error",
"file": "src/limits.mojo",
"hint": "Three edits. Replace the placeholder in the `if n <= 0` branch with `raise Error(\"velocity must be positive\")`. Add `raises` to `validate_velocity`'s signature (after the argument list, before `-> Int`). Then add `raises` to `main` so the error can propagate out of it.",
"title": "Reject invalid velocity commands with an error",
"topic": "Error Handling"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-401",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "value: 0"
},
"kind": "pass"
},
"file": "solutions/MQ_402.mojo",
"id": "quest/MQ-402/solution",
"meta": {
"concept": "Mojo uses `try`/`except` to detect and handle errors",
"docUrl": "https://mojolang.org/docs/manual/errors/#handle-an-error",
"file": "src/catch_fallback.mojo",
"hint": "Put the call inside a `try:` block and print the fallback in an `except:` block.",
"title": "Catch the error and fall back",
"topic": "Error Handling"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_402.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "value: 0"
},
"kind": "fail"
},
"file": "starters/MQ_402.mojo",
"id": "quest/MQ-402/starter",
"meta": {
"concept": "Mojo uses `try`/`except` to detect and handle errors",
"docUrl": "https://mojolang.org/docs/manual/errors/#handle-an-error",
"file": "src/catch_fallback.mojo",
"hint": "Put the call inside a `try:` block and print the fallback in an `except:` block.",
"title": "Catch the error and fall back",
"topic": "Error Handling"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-402",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Re-raise the caught error by transferring it with the `^` sigil: `raise e^`.",
"patterns": [
"raise\\s+e\\s*\\^"
]
},
"kind": "pass"
},
"file": "solutions/MQ_403.mojo",
"id": "quest/MQ-403/solution",
"meta": {
"concept": "To re-raise a caught error, use `raise` with the `^` sigil to transfer ownership of the error value",
"docUrl": "https://mojolang.org/docs/manual/errors/#re-raise-an-error",
"file": "src/reraise.mojo",
"hint": "Re-raise the same error you caught: add `raise e^` as the last line of the `except e` block. The `^` transfers ownership of the caught error `e` back out.",
"title": "Log and re-raise the fault",
"topic": "Error Handling"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_403.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Re-raise the caught error by transferring it with the `^` sigil: `raise e^`.",
"patterns": [
"raise\\s+e\\s*\\^"
]
},
"kind": "fail"
},
"file": "starters/MQ_403.mojo",
"id": "quest/MQ-403/starter",
"meta": {
"concept": "To re-raise a caught error, use `raise` with the `^` sigil to transfer ownership of the error value",
"docUrl": "https://mojolang.org/docs/manual/errors/#re-raise-an-error",
"file": "src/reraise.mojo",
"hint": "Re-raise the same error you caught: add `raise e^` as the last line of the `except e` block. The `^` transfers ownership of the caught error `e` back out.",
"title": "Log and re-raise the fault",
"topic": "Error Handling"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-403",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "max_speed=1.5"
},
"kind": "pass"
},
"file": "solutions/MQ_412.mojo",
"id": "quest/MQ-412/solution",
"meta": {
"concept": "A `with` statement context manager releases its resource at the end of the block, even if an error occurs",
"docUrl": "https://mojolang.org/docs/manual/errors/#use-a-context-manager",
"file": "src/calibration.mojo",
"hint": "A file opened with `with ... as f:` is only in scope inside that block — Mojo closes the file and releases `f` as soon as the block ends. The read currently runs after the block, where `f` no longer exists. Do the reading inside the `with` block.",
"title": "Read the calibration profile with a `with` block",
"topic": "Context Managers"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_412.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "max_speed=1.5"
},
"kind": "fail"
},
"file": "starters/MQ_412.mojo",
"id": "quest/MQ-412/starter",
"meta": {
"concept": "A `with` statement context manager releases its resource at the end of the block, even if an error occurs",
"docUrl": "https://mojolang.org/docs/manual/errors/#use-a-context-manager",
"file": "src/calibration.mojo",
"hint": "A file opened with `with ... as f:` is only in scope inside that block — Mojo closes the file and releases `f` as soon as the block ends. The read currently runs after the block, where `f` no longer exists. Do the reading inside the `with` block.",
"title": "Read the calibration profile with a `with` block",
"topic": "Context Managers"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-412",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total points: 264"
},
"kind": "pass"
},
"file": "solutions/MQ_501.mojo",
"id": "quest/MQ-501/solution",
"meta": {
"concept": "All struct fields are declared with `var` and a type annotation, and must be initialized in the constructor",
"docUrl": "https://mojolang.org/docs/manual/structs/#fields",
"file": "src/scan.mojo",
"hint": "`total()` and the constructor both reference a second field that doesn't exist yet. Declare it next to the existing field with the same integer type, then set it from the matching constructor argument.",
"title": "Finish the LidarScan struct",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_501.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total points: 264"
},
"kind": "fail"
},
"file": "starters/MQ_501.mojo",
"id": "quest/MQ-501/starter",
"meta": {
"concept": "All struct fields are declared with `var` and a type annotation, and must be initialized in the constructor",
"docUrl": "https://mojolang.org/docs/manual/structs/#fields",
"file": "src/scan.mojo",
"hint": "`total()` and the constructor both reference a second field that doesn't exist yet. Declare it next to the existing field with the same integer type, then set it from the matching constructor argument.",
"title": "Finish the LidarScan struct",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-501",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "low: True"
},
"kind": "pass"
},
"file": "solutions/MQ_502.mojo",
"id": "quest/MQ-502/solution",
"meta": {
"concept": "An instance method takes `self` as an explicit first argument, letting it act on a particular instance of the struct",
"docUrl": "https://mojolang.org/docs/manual/structs/#methods",
"file": "src/battery.mojo",
"hint": "Add a method (a `def` taking `self`) inside the struct that returns the `Bool` result of comparing the charge against 20.",
"title": "Add the low-battery method",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_502.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "low: True"
},
"kind": "fail"
},
"file": "starters/MQ_502.mojo",
"id": "quest/MQ-502/starter",
"meta": {
"concept": "An instance method takes `self` as an explicit first argument, letting it act on a particular instance of the struct",
"docUrl": "https://mojolang.org/docs/manual/structs/#methods",
"file": "src/battery.mojo",
"hint": "Add a method (a `def` taking `self`) inside the struct that returns the `Bool` result of comparing the charge against 20.",
"title": "Add the low-battery method",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-502",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Frames handled: 2"
},
"kind": "pass"
},
"file": "solutions/MQ_503.mojo",
"id": "quest/MQ-503/solution",
"meta": {
"concept": "To let a method mutate the instance, declare its receiver as `mut self`",
"docUrl": "https://mojolang.org/docs/manual/structs/#mutating-a-struct",
"file": "src/frame_counter.mojo",
"hint": "The method updates one of its own fields, which it can't do through a read-only `self`. Mark its `self` argument as mutable.",
"title": "Let FrameCounter mutate itself",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_503.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Frames handled: 2"
},
"kind": "fail"
},
"file": "starters/MQ_503.mojo",
"id": "quest/MQ-503/starter",
"meta": {
"concept": "To let a method mutate the instance, declare its receiver as `mut self`",
"docUrl": "https://mojolang.org/docs/manual/structs/#mutating-a-struct",
"file": "src/frame_counter.mojo",
"hint": "The method updates one of its own fields, which it can't do through a read-only `self`. Mark its `self` argument as mutable.",
"title": "Let FrameCounter mutate itself",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-503",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "ppr: 4096"
},
"kind": "pass"
},
"file": "solutions/MQ_504.mojo",
"id": "quest/MQ-504/solution",
"meta": {
"concept": "A `@staticmethod` can be called without an instance and doesn't receive `self`, so it can't access fields",
"docUrl": "https://mojolang.org/docs/manual/structs/#static-methods",
"file": "src/encoder_static.mojo",
"hint": "Put `@staticmethod` on the line above `def ticks_per_rev()` so it belongs to the type, not an instance.",
"title": "Expose the encoder constant as a static method",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_504.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "ppr: 4096"
},
"kind": "fail"
},
"file": "starters/MQ_504.mojo",
"id": "quest/MQ-504/starter",
"meta": {
"concept": "A `@staticmethod` can be called without an instance and doesn't receive `self`, so it can't access fields",
"docUrl": "https://mojolang.org/docs/manual/structs/#static-methods",
"file": "src/encoder_static.mojo",
"hint": "Put `@staticmethod` on the line above `def ticks_per_rev()` so it belongs to the type, not an instance.",
"title": "Expose the encoder constant as a static method",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-504",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total points: 264"
},
"kind": "pass"
},
"file": "solutions/MQ_505.mojo",
"id": "quest/MQ-505/solution",
"meta": {
"concept": "The `@fieldwise_init` decorator generates a field-wise constructor, so you don't have to write `__init__` by hand",
"docUrl": "https://mojolang.org/docs/manual/structs/#struct-definition",
"file": "src/scan_fieldwise.mojo",
"hint": "The struct has fields but no constructor, so `LidarScan(8, 256)` has nothing to call. Add `@fieldwise_init` on the line directly above `struct LidarScan` to have Mojo generate a constructor that takes one argument per field.",
"title": "Synthesize the LidarScan constructor",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_505.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total points: 264"
},
"kind": "fail"
},
"file": "starters/MQ_505.mojo",
"id": "quest/MQ-505/starter",
"meta": {
"concept": "The `@fieldwise_init` decorator generates a field-wise constructor, so you don't have to write `__init__` by hand",
"docUrl": "https://mojolang.org/docs/manual/structs/#struct-definition",
"file": "src/scan_fieldwise.mojo",
"hint": "The struct has fields but no constructor, so `LidarScan(8, 256)` has nothing to call. Add `@fieldwise_init` on the line directly above `struct LidarScan` to have Mojo generate a constructor that takes one argument per field.",
"title": "Synthesize the LidarScan constructor",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-505",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "fd: 3"
},
"kind": "pass"
},
"file": "solutions/MQ_507.mojo",
"id": "quest/MQ-507/solution",
"meta": {
"concept": "A move-only type is `Movable` but not `Copyable`; transfer it with the `^` sigil",
"docUrl": "https://mojolang.org/docs/manual/values/ownership/#transfer-arguments-var-and-",
"file": "src/move_only.mojo",
"hint": "A move-only value can’t be copied into the call — hand it over with the `^` transfer operator on the argument.",
"title": "Hand off a move-only handle",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_507.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "fd: 3"
},
"kind": "fail"
},
"file": "starters/MQ_507.mojo",
"id": "quest/MQ-507/starter",
"meta": {
"concept": "A move-only type is `Movable` but not `Copyable`; transfer it with the `^` sigil",
"docUrl": "https://mojolang.org/docs/manual/values/ownership/#transfer-arguments-var-and-",
"file": "src/move_only.mojo",
"hint": "A move-only value can’t be copied into the call — hand it over with the `^` transfer operator on the argument.",
"title": "Hand off a move-only handle",
"topic": "Structs"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-507",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "combined budget: 156"
},
"kind": "pass"
},
"file": "solutions/MQ_510.mojo",
"id": "quest/MQ-510/solution",
"meta": {
"concept": "Mojo evaluates `a + b` by calling `a.__add__(b)`",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-binary-arithmetic",
"file": "src/energy.mojo",
"hint": "Mojo evaluates `a + b` as `a.__add__(b)`, so `+` only works if the type defines `__add__`. Add a `def __add__(self, other: Self) -> Self` method that returns a new `EnergyBudget` summing both sides’ `millijoules`.",
"title": "Combine two energy budgets with `+`",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_510.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "combined budget: 156"
},
"kind": "fail"
},
"file": "starters/MQ_510.mojo",
"id": "quest/MQ-510/starter",
"meta": {
"concept": "Mojo evaluates `a + b` by calling `a.__add__(b)`",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-binary-arithmetic",
"file": "src/energy.mojo",
"hint": "Mojo evaluates `a + b` as `a.__add__(b)`, so `+` only works if the type defines `__add__`. Add a `def __add__(self, other: Self) -> Self` method that returns a new `EnergyBudget` summing both sides’ `millijoules`.",
"title": "Combine two energy budgets with `+`",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-510",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "neg: -5"
},
"kind": "pass"
},
"file": "solutions/MQ_511.mojo",
"id": "quest/MQ-511/solution",
"meta": {
"concept": "A unary operator like `-x` calls `__neg__()`, returning a new value representing the result",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-unary-operators",
"file": "src/offset.mojo",
"hint": "Mojo evaluates `-x` as `x.__neg__()`, so unary `-` only works if the type defines `__neg__`. Add a `def __neg__(self) -> Self` that builds and returns a new `Self` from the negated field.",
"title": "Negate an offset with a unary operator",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_511.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "neg: -5"
},
"kind": "fail"
},
"file": "starters/MQ_511.mojo",
"id": "quest/MQ-511/starter",
"meta": {
"concept": "A unary operator like `-x` calls `__neg__()`, returning a new value representing the result",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-unary-operators",
"file": "src/offset.mojo",
"hint": "Mojo evaluates `-x` as `x.__neg__()`, so unary `-` only works if the type defines `__neg__`. Add a `def __neg__(self) -> Self` that builds and returns a new `Self` from the negated field.",
"title": "Negate an offset with a unary operator",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-511",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "equal: True"
},
"kind": "pass"
},
"file": "solutions/MQ_512.mojo",
"id": "quest/MQ-512/solution",
"meta": {
"concept": "Implement `__eq__()` to support `==`; the `Equatable` trait provides `__eq__()` and `__ne__()`",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-comparisons",
"file": "src/version.mojo",
"hint": "Define the equality dunder (`__eq__`) taking `other: Self` and returning whether the two majors match.",
"title": "Compare two firmware versions",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_512.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "equal: True"
},
"kind": "fail"
},
"file": "starters/MQ_512.mojo",
"id": "quest/MQ-512/starter",
"meta": {
"concept": "Implement `__eq__()` to support `==`; the `Equatable` trait provides `__eq__()` and `__ne__()`",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-comparisons",
"file": "src/version.mojo",
"hint": "Define the equality dunder (`__eq__`) taking `other: Self` and returning whether the two majors match.",
"title": "Compare two firmware versions",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-512",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "channel 1: 20"
},
"kind": "pass"
},
"file": "solutions/MQ_513.mojo",
"id": "quest/MQ-513/solution",
"meta": {
"concept": "Implement `__getitem__()` to support subscript reads (`obj[i]`)",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-subscripting",
"file": "src/frame.mojo",
"hint": "Define the subscript dunder (`__getitem__`) taking an `Int` index and returning the matching field for 0, 1, or 2.",
"title": "Index into a frame with a subscript",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_513.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "channel 1: 20"
},
"kind": "fail"
},
"file": "starters/MQ_513.mojo",
"id": "quest/MQ-513/starter",
"meta": {
"concept": "Implement `__getitem__()` to support subscript reads (`obj[i]`)",
"docUrl": "https://mojolang.org/docs/manual/structs/operator-support/#support-subscripting",
"file": "src/frame.mojo",
"hint": "Define the subscript dunder (`__getitem__`) taking an `Int` index and returning the matching field for 0, 1, or 2.",
"title": "Index into a frame with a subscript",
"topic": "Operator Overloading"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-513",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Square root: 12.0"
},
"kind": "pass"
},
"file": "solutions/MQ_520.mojo",
"id": "quest/MQ-520/solution",
"meta": {
"concept": "`from module import name` imports a specific member from a module",
"docUrl": "https://mojolang.org/docs/manual/packages/#mojo-modules",
"file": "src/geometry.mojo",
"hint": "`sqrt` lives in the standard library’s `math` module, so the name is unknown until you bring it into scope. Fully qualify it with `std.` — `from std.math import …` — at the top of the file.",
"title": "Import sqrt from the math module",
"topic": "Modules"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_520.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Square root: 12.0"
},
"kind": "fail"
},
"file": "starters/MQ_520.mojo",
"id": "quest/MQ-520/starter",
"meta": {
"concept": "`from module import name` imports a specific member from a module",
"docUrl": "https://mojolang.org/docs/manual/packages/#mojo-modules",
"file": "src/geometry.mojo",
"hint": "`sqrt` lives in the standard library’s `math` module, so the name is unknown until you bring it into scope. Fully qualify it with `std.` — `from std.math import …` — at the top of the file.",
"title": "Import sqrt from the math module",
"topic": "Modules"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-520",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total distance: 20"
},
"kind": "pass"
},
"file": "solutions/MQ_601.mojo",
"id": "quest/MQ-601/solution",
"meta": {
"concept": "Arguments are read-only by default; the `mut` convention lets the function write back to the caller's value",
"docUrl": "https://mojolang.org/docs/manual/values/ownership/#mutable-arguments-mut",
"file": "src/odometer.mojo",
"hint": "Arguments are read-only by default, so the in-place update is rejected. Mark the argument you write to as mutable so the change reaches the caller.",
"title": "Let the odometer update the running total",
"topic": "Value Semantics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_601.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Total distance: 20"
},
"kind": "fail"
},
"file": "starters/MQ_601.mojo",
"id": "quest/MQ-601/starter",
"meta": {
"concept": "Arguments are read-only by default; the `mut` convention lets the function write back to the caller's value",
"docUrl": "https://mojolang.org/docs/manual/values/ownership/#mutable-arguments-mut",
"file": "src/odometer.mojo",
"hint": "Arguments are read-only by default, so the in-place update is rejected. Mark the argument you write to as mutable so the change reaches the caller.",
"title": "Let the odometer update the running total",
"topic": "Value Semantics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-601",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Pass ownership into the call using the `^` transfer operator on the argument.",
"patterns": [
"load_map\\(\\s*cells\\s*\\^\\s*\\)"
]
},
"kind": "pass"
},
"file": "solutions/MQ_602.mojo",
"id": "quest/MQ-602/solution",
"meta": {
"concept": "The `^` transfer sigil ends a variable's lifetime and transfers ownership into a `var` argument",
"docUrl": "https://mojolang.org/docs/manual/values/ownership/#transfer-arguments-var-and-",
"file": "src/map_loader.mojo",
"hint": "The loader takes ownership and a `List` won't copy implicitly, so the plain call won't compile. You don't use `cells` afterward — hand it over with the `^` transfer operator (the compiler even suggests it) rather than making an explicit `.copy()`.",
"title": "Transfer the map buffer into the loader",
"topic": "Ownership"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_602.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Pass ownership into the call using the `^` transfer operator on the argument.",
"patterns": [
"load_map\\(\\s*cells\\s*\\^\\s*\\)"
]
},
"kind": "fail"
},
"file": "starters/MQ_602.mojo",
"id": "quest/MQ-602/starter",
"meta": {
"concept": "The `^` transfer sigil ends a variable's lifetime and transfers ownership into a `var` argument",
"docUrl": "https://mojolang.org/docs/manual/values/ownership/#transfer-arguments-var-and-",
"file": "src/map_loader.mojo",
"hint": "The loader takes ownership and a `List` won't copy implicitly, so the plain call won't compile. You don't use `cells` afterward — hand it over with the `^` transfer operator (the compiler even suggests it) rather than making an explicit `.copy()`.",
"title": "Transfer the map buffer into the loader",
"topic": "Ownership"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-602",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "queue depth: 10"
},
"kind": "pass"
},
"file": "solutions/MQ_604.mojo",
"id": "quest/MQ-604/solution",
"meta": {
"concept": "A `ref` return value must name an origin; it returns a reference to an existing value, not a copy",
"docUrl": "https://mojolang.org/docs/manual/values/lifetimes/#ref-return-values",
"file": "src/command_queue.mojo",
"hint": "A returned reference carries an origin describing exactly which storage it borrows. The method hands back one field, but the declared origin names the entire enclosing value — those do not line up. Point the origin at the same thing the `return` statement does.",
"title": "Fix the mutable handle into the command queue",
"topic": "Lifetimes"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_604.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "queue depth: 10"
},
"kind": "fail"
},
"file": "starters/MQ_604.mojo",
"id": "quest/MQ-604/starter",
"meta": {
"concept": "A `ref` return value must name an origin; it returns a reference to an existing value, not a copy",
"docUrl": "https://mojolang.org/docs/manual/values/lifetimes/#ref-return-values",
"file": "src/command_queue.mojo",
"hint": "A returned reference carries an origin describing exactly which storage it borrows. The method hands back one field, but the declared origin names the entire enclosing value — those do not line up. Point the origin at the same thing the `return` statement does.",
"title": "Fix the mutable handle into the command queue",
"topic": "Lifetimes"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-604",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "y: 7"
},
"kind": "pass"
},
"file": "solutions/MQ_702.mojo",
"id": "quest/MQ-702/solution",
"meta": {
"concept": "By the end of a constructor, all of the struct's fields must be initialized",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#field-initialization",
"file": "src/waypoint_init.mojo",
"hint": "Every field must be assigned before `__init__` returns. Assign the second field from its matching argument too.",
"title": "Initialize every field in the constructor",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_702.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "y: 7"
},
"kind": "fail"
},
"file": "starters/MQ_702.mojo",
"id": "quest/MQ-702/starter",
"meta": {
"concept": "By the end of a constructor, all of the struct's fields must be initialized",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#field-initialization",
"file": "src/waypoint_init.mojo",
"hint": "Every field must be assigned before `__init__` returns. Assign the second field from its matching argument too.",
"title": "Initialize every field in the constructor",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-702",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Robot: arm max_rate: 512"
},
"kind": "pass"
},
"file": "solutions/MQ_703.mojo",
"id": "quest/MQ-703/solution",
"meta": {
"concept": "Like any method, `__init__()` can be overloaded to construct the object from different arguments",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#overloading-the-constructor",
"file": "src/robot_config.mojo",
"hint": "The console builds a config from a name plus an existing config (a template), but the only constructor expects a name and an `Int`. A struct can have more than one `__init__`: add a second `__init__(out self, name: String, template: Self)` that keeps the new name and copies `max_rate` from the template — and make sure it assigns every field.",
"title": "Re-badge a RobotConfig with a second constructor",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_703.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Robot: arm max_rate: 512"
},
"kind": "fail"
},
"file": "starters/MQ_703.mojo",
"id": "quest/MQ-703/starter",
"meta": {
"concept": "Like any method, `__init__()` can be overloaded to construct the object from different arguments",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#overloading-the-constructor",
"file": "src/robot_config.mojo",
"hint": "The console builds a config from a name plus an existing config (a template), but the only constructor expects a name and an `Int`. A struct can have more than one `__init__`: add a second `__init__(out self, name: String, template: Self)` that keeps the new name and copies `max_rate` from the template — and make sure it assigns every field.",
"title": "Re-badge a RobotConfig with a second constructor",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-703",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "temp: 25"
},
"kind": "pass"
},
"file": "solutions/MQ_704.mojo",
"id": "quest/MQ-704/solution",
"meta": {
"concept": "An `@implicit` single-argument constructor enables implicit conversion from the source type",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#constructors-and-implicit-conversion",
"file": "src/celsius.mojo",
"hint": "Put `@implicit` on the line above the single-argument `__init__` so an `Int` converts to a `Celsius` automatically.",
"title": "Allow implicit construction of Celsius",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_704.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "temp: 25"
},
"kind": "fail"
},
"file": "starters/MQ_704.mojo",
"id": "quest/MQ-704/starter",
"meta": {
"concept": "An `@implicit` single-argument constructor enables implicit conversion from the source type",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#constructors-and-implicit-conversion",
"file": "src/celsius.mojo",
"hint": "Put `@implicit` on the line above the single-argument `__init__` so an `Int` converts to a `Celsius` automatically.",
"title": "Allow implicit construction of Celsius",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-704",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "snapshot size: 3\nworking size: 4"
},
"kind": "pass"
},
"file": "solutions/MQ_705.mojo",
"id": "quest/MQ-705/solution",
"meta": {
"concept": "Conforming to `Copyable` gives a type a compiler-synthesized `.copy()` method",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#copy-constructor",
"file": "src/scan_buffer.mojo",
"hint": "The recorder asks the buffer for a copy of itself, but the struct never declared it can be copied. Add the `Copyable` trait to the struct header; the compiler then synthesizes a `.copy()` that duplicates each field — including the `List`, which it deep-copies — so the buffers stay independent. No copy constructor needed.",
"title": "Give ScanBuffer an independent copy",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_705.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "snapshot size: 3\nworking size: 4"
},
"kind": "fail"
},
"file": "starters/MQ_705.mojo",
"id": "quest/MQ-705/starter",
"meta": {
"concept": "Conforming to `Copyable` gives a type a compiler-synthesized `.copy()` method",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#copy-constructor",
"file": "src/scan_buffer.mojo",
"hint": "The recorder asks the buffer for a copy of itself, but the struct never declared it can be copied. Add the `Copyable` trait to the struct header; the compiler then synthesizes a `.copy()` that duplicates each field — including the `List`, which it deep-copies — so the buffers stay independent. No copy constructor needed.",
"title": "Give ScanBuffer an independent copy",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-705",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "a: 5 b: 5"
},
"kind": "pass"
},
"file": "solutions/MQ_706.mojo",
"id": "quest/MQ-706/solution",
"meta": {
"concept": "The `ImplicitlyCopyable` trait lets the compiler copy a value on a plain assignment (`var b = a`)",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#implicitly-copyable-types",
"file": "src/implicit_copy.mojo",
"hint": "Add `ImplicitlyCopyable` to the struct’s trait list so a plain `var b = a` copies it.",
"title": "Make readings implicitly copyable",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_706.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "a: 5 b: 5"
},
"kind": "fail"
},
"file": "starters/MQ_706.mojo",
"id": "quest/MQ-706/starter",
"meta": {
"concept": "The `ImplicitlyCopyable` trait lets the compiler copy a value on a plain assignment (`var b = a`)",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/life/#implicitly-copyable-types",
"file": "src/implicit_copy.mojo",
"hint": "Add `ImplicitlyCopyable` to the struct’s trait list so a plain `var b = a` copies it.",
"title": "Make readings implicitly copyable",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-706",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Acquired motor 0\nDriving with motor 0\nReleased motor 0\nScheduler idle"
},
"kind": "pass"
},
"file": "solutions/MQ_710.mojo",
"id": "quest/MQ-710/solution",
"meta": {
"concept": "Mojo calls a value's `__deinit__()` destructor when its lifetime ends (ASAP, last-use destruction)",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/death/#destructor",
"file": "src/motor_handle.mojo",
"hint": "The handle announces when it is acquired but never when it is released, so the release line is missing. Mojo runs a struct’s destructor automatically the moment a value leaves scope — add that destructor and have it print the release. Note its `self` must be taken specially as `deinit self`, not a plain `self`.",
"title": "Release the motor handle on teardown",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_710.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Acquired motor 0\nDriving with motor 0\nReleased motor 0\nScheduler idle"
},
"kind": "fail"
},
"file": "starters/MQ_710.mojo",
"id": "quest/MQ-710/starter",
"meta": {
"concept": "Mojo calls a value's `__deinit__()` destructor when its lifetime ends (ASAP, last-use destruction)",
"docUrl": "https://mojolang.org/docs/manual/lifecycle/death/#destructor",
"file": "src/motor_handle.mojo",
"hint": "The handle announces when it is acquired but never when it is released, so the release line is missing. Mojo runs a struct’s destructor automatically the moment a value leaves scope — add that destructor and have it print the release. Note its `self` must be taken specially as `deinit self`, not a plain `self`.",
"title": "Release the motor handle on teardown",
"topic": "Value Lifecycle"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-710",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Declare `tick_budget` as a compile-time constant with the `comptime` keyword.",
"patterns": [
"\\bcomptime\\s+tick_budget\\b"
]
},
"kind": "pass"
},
"file": "solutions/MQ_801.mojo",
"id": "quest/MQ-801/solution",
"meta": {
"concept": "Assign an expression to a compile-time constant with `comptime`, which evaluates it once at compile time",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/comptime-evaluation/",
"file": "src/control_rate.mojo",
"hint": "A value fully known at build time can be a compile-time constant. Swap `var` for `comptime` on the `tick_budget` declaration so the expression is evaluated at compile time rather than at run time.",
"title": "Bake the control rate in at compile time",
"topic": "Metaprogramming"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_801.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Declare `tick_budget` as a compile-time constant with the `comptime` keyword.",
"patterns": [
"\\bcomptime\\s+tick_budget\\b"
]
},
"kind": "fail"
},
"file": "starters/MQ_801.mojo",
"id": "quest/MQ-801/starter",
"meta": {
"concept": "Assign an expression to a compile-time constant with `comptime`, which evaluates it once at compile time",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/comptime-evaluation/",
"file": "src/control_rate.mojo",
"hint": "A value fully known at build time can be a compile-time constant. Swap `var` for `comptime` on the `tick_budget` declaration so the expression is evaluated at compile time rather than at run time.",
"title": "Bake the control rate in at compile time",
"topic": "Metaprogramming"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-801",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "axis sum: 6"
},
"kind": "pass"
},
"file": "solutions/MQ_803.mojo",
"id": "quest/MQ-803/solution",
"meta": {
"concept": "`comptime for` fully unrolls a loop at compile time over a compile-time sequence like `range(LIMIT)`",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/comptime-evaluation/#comptime-for",
"file": "src/drive_axes.mojo",
"hint": "A `comptime for` loop is unrolled while the program is compiled, so the compiler must already know how many iterations there are. A `var` is only decided at run time — bind the count as a compile-time constant instead.",
"title": "Unroll the drive-axis loop at compile time",
"topic": "Metaprogramming"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_803.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "axis sum: 6"
},
"kind": "fail"
},
"file": "starters/MQ_803.mojo",
"id": "quest/MQ-803/starter",
"meta": {
"concept": "`comptime for` fully unrolls a loop at compile time over a compile-time sequence like `range(LIMIT)`",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/comptime-evaluation/#comptime-for",
"file": "src/drive_axes.mojo",
"hint": "A `comptime for` loop is unrolled while the program is compiled, so the compiler must already know how many iterations there are. A `var` is only decided at run time — bind the count as a compile-time constant instead.",
"title": "Unroll the drive-axis loop at compile time",
"topic": "Metaprogramming"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-803",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Scaled: 42"
},
"kind": "pass"
},
"file": "solutions/MQ_810.mojo",
"id": "quest/MQ-810/solution",
"meta": {
"concept": "Parameters in `[]` are compile-time inputs; arguments in `()` are run-time values",
"docUrl": "https://mojolang.org/docs/manual/parameters/#parameterized-functions",
"file": "src/gain.mojo",
"hint": "The value in square brackets at the call site is a compile-time parameter, but the function only declares runtime arguments in parentheses. Move the gain factor into the function’s `[...]` parameter list so it is known at compile time.",
"title": "Bake the control gain in at compile time",
"topic": "Parameterization"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_810.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Scaled: 42"
},
"kind": "fail"
},
"file": "starters/MQ_810.mojo",
"id": "quest/MQ-810/starter",
"meta": {
"concept": "Parameters in `[]` are compile-time inputs; arguments in `()` are run-time values",
"docUrl": "https://mojolang.org/docs/manual/parameters/#parameterized-functions",
"file": "src/gain.mojo",
"hint": "The value in square brackets at the call site is a compile-time parameter, but the function only declares runtime arguments in parentheses. Move the gain factor into the function’s `[...]` parameter list so it is known at compile time.",
"title": "Bake the control gain in at compile time",
"topic": "Parameterization"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-810",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "capacity: 8\nsize: 8"
},
"kind": "pass"
},
"file": "solutions/MQ_812.mojo",
"id": "quest/MQ-812/solution",
"meta": {
"concept": "A parameterized struct adds compile-time parameters in `[]` after its name; they are accessible on instances (e.g. `b.size`)",
"docUrl": "https://mojolang.org/docs/manual/parameters/#parameterized-structs",
"file": "src/buffer_param.mojo",
"hint": "Add a compile-time parameter list (`[size: Int]`) to the struct header, before the trait list — `Self.size` and `b.size` then resolve.",
"title": "Parameterize the buffer by size",
"topic": "Parameterization"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_812.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "capacity: 8\nsize: 8"
},
"kind": "fail"
},
"file": "starters/MQ_812.mojo",
"id": "quest/MQ-812/starter",
"meta": {
"concept": "A parameterized struct adds compile-time parameters in `[]` after its name; they are accessible on instances (e.g. `b.size`)",
"docUrl": "https://mojolang.org/docs/manual/parameters/#parameterized-structs",
"file": "src/buffer_param.mojo",
"hint": "Add a compile-time parameter list (`[size: Int]`) to the struct header, before the trait list — `Self.size` and `b.size` then resolve.",
"title": "Parameterize the buffer by size",
"topic": "Parameterization"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-812",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Reading from lidar-front"
},
"kind": "pass"
},
"file": "solutions/MQ_825.mojo",
"id": "quest/MQ-825/solution",
"meta": {
"concept": "Declare trait conformance in parentheses after the struct name; the compiler enforces the trait's requirements",
"docUrl": "https://mojolang.org/docs/manual/traits/#adding-traits-to-structs",
"file": "src/sensors.mojo",
"hint": "The generic function only accepts trait conformers. Declare that the struct conforms by listing the trait in parentheses after the struct name.",
"title": "Register Lidar as a Sensor",
"topic": "Traits"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_825.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Reading from lidar-front"
},
"kind": "fail"
},
"file": "starters/MQ_825.mojo",
"id": "quest/MQ-825/starter",
"meta": {
"concept": "Declare trait conformance in parentheses after the struct name; the compiler enforces the trait's requirements",
"docUrl": "https://mojolang.org/docs/manual/traits/#adding-traits-to-structs",
"file": "src/sensors.mojo",
"hint": "The generic function only accepts trait conformers. Declare that the struct conforms by listing the trait in parentheses after the struct name.",
"title": "Register Lidar as a Sensor",
"topic": "Traits"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-825",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "hello amr"
},
"kind": "pass"
},
"file": "solutions/MQ_827.mojo",
"id": "quest/MQ-827/solution",
"meta": {
"concept": "A trait can include a default method implementation that conforming structs inherit unless they override it",
"docUrl": "https://mojolang.org/docs/manual/traits/#default-method-implementations",
"file": "src/trait_default.mojo",
"hint": "Replace the `...` in the trait’s `greet` with a real body — `return \"hello \" + self.name()`. Conformers then inherit it.",
"title": "Give the trait a default greeting",
"topic": "Traits"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_827.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "hello amr"
},
"kind": "fail"
},
"file": "starters/MQ_827.mojo",
"id": "quest/MQ-827/starter",
"meta": {
"concept": "A trait can include a default method implementation that conforming structs inherit unless they override it",
"docUrl": "https://mojolang.org/docs/manual/traits/#default-method-implementations",
"file": "src/trait_default.mojo",
"hint": "Replace the `...` in the trait’s `greet` with a real body — `return \"hello \" + self.name()`. Conformers then inherit it.",
"title": "Give the trait a default greeting",
"topic": "Traits"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-827",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "len: 5"
},
"kind": "pass"
},
"file": "solutions/MQ_830.mojo",
"id": "quest/MQ-830/solution",
"meta": {
"concept": "The `Sized` trait requires a type to implement `__len__()`, which the built-in `len()` function uses",
"docUrl": "https://mojolang.org/docs/manual/traits/#the-sized-trait",
"file": "src/track_sized.mojo",
"hint": "Declare `Sized` conformance on the struct and give it a `__len__` method that returns `len(self.waypoints)`.",
"title": "Make the track report its length",
"topic": "Traits"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_830.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "len: 5"
},
"kind": "fail"
},
"file": "starters/MQ_830.mojo",
"id": "quest/MQ-830/starter",
"meta": {
"concept": "The `Sized` trait requires a type to implement `__len__()`, which the built-in `len()` function uses",
"docUrl": "https://mojolang.org/docs/manual/traits/#the-sized-trait",
"file": "src/track_sized.mojo",
"hint": "Declare `Sized` conformance on the struct and give it a `__len__` method that returns `len(self.waypoints)`.",
"title": "Make the track report its length",
"topic": "Traits"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-830",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "telemetry: 42\ntelemetry: ready"
},
"kind": "pass"
},
"file": "solutions/MQ_835.mojo",
"id": "quest/MQ-835/solution",
"meta": {
"concept": "`Some[Trait]` is shorthand for a trait-constrained generic parameter; `def f(v: Some[Writable])` is equivalent to `def f[T: Writable](v: T)`",
"docUrl": "https://mojolang.org/docs/manual/generics/#setting-generic-parameter-bounds",
"file": "src/telemetry_log.mojo",
"hint": "You reference a type that was never introduced. Either add `[T: Writable]` before the argument list and change the argument type to `T`, or use the `Some` shorthand: replace `T` with `Some[Writable]` and drop the `[]` entirely.",
"title": "Make the telemetry logger generic",
"topic": "Generics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_835.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "telemetry: 42\ntelemetry: ready"
},
"kind": "fail"
},
"file": "starters/MQ_835.mojo",
"id": "quest/MQ-835/starter",
"meta": {
"concept": "`Some[Trait]` is shorthand for a trait-constrained generic parameter; `def f(v: Some[Writable])` is equivalent to `def f[T: Writable](v: T)`",
"docUrl": "https://mojolang.org/docs/manual/generics/#setting-generic-parameter-bounds",
"file": "src/telemetry_log.mojo",
"hint": "You reference a type that was never introduced. Either add `[T: Writable]` before the argument list and change the argument type to `T`, or use the `Some` shorthand: replace `T` with `Some[Writable]` and drop the `[]` entirely.",
"title": "Make the telemetry logger generic",
"topic": "Generics"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-835",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Drive slots: 512"
},
"kind": "pass"
},
"file": "solutions/MQ_845.mojo",
"id": "quest/MQ-845/solution",
"meta": {
"concept": "`comptime assert cond, \"msg\"` asserts a condition at compile time; if false, compilation fails",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/constraints/#compile-time-assertions",
"file": "src/drive_train.mojo",
"hint": "The `comptime assert` statement is a compile-time assertion: it stops the build whenever its condition is false for the chosen parameter. Read the message, then instantiate the function with a parameter value that satisfies it — do not weaken the guard.",
"title": "Guard the motor count",
"topic": "Constraints"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_845.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Drive slots: 512"
},
"kind": "fail"
},
"file": "starters/MQ_845.mojo",
"id": "quest/MQ-845/starter",
"meta": {
"concept": "`comptime assert cond, \"msg\"` asserts a condition at compile time; if false, compilation fails",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/constraints/#compile-time-assertions",
"file": "src/drive_train.mojo",
"hint": "The `comptime assert` statement is a compile-time assertion: it stops the build whenever its condition is false for the chosen parameter. Read the message, then instantiate the function with a parameter value that satisfies it — do not weaken the guard.",
"title": "Guard the motor count",
"topic": "Constraints"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-845",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "matrix entries: 64"
},
"kind": "pass"
},
"file": "solutions/MQ_852.mojo",
"id": "quest/MQ-852/solution",
"meta": {
"concept": "The `comptime` keyword forces an expression to be evaluated at compile time",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/materialization/#using-the-comptime-keyword",
"file": "src/transform.mojo",
"hint": "A value in a parameter list (the square brackets) has to be settled while the program compiles, but a `var` is only decided at run time, so the compiler refuses to use it there. Declare the dimension as a compile-time constant so it can flow into the parameter list — its result is then materialized into the runtime print.",
"title": "Materialize the transform-matrix size",
"topic": "Materialization"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_852.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "matrix entries: 64"
},
"kind": "fail"
},
"file": "starters/MQ_852.mojo",
"id": "quest/MQ-852/starter",
"meta": {
"concept": "The `comptime` keyword forces an expression to be evaluated at compile time",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/materialization/#using-the-comptime-keyword",
"file": "src/transform.mojo",
"hint": "A value in a parameter list (the square brackets) has to be settled while the program compiles, but a `var` is only decided at run time, so the compiler refuses to use it there. Declare the dimension as a compile-time constant so it can flow into the parameter list — its result is then materialized into the runtime print.",
"title": "Materialize the transform-matrix size",
"topic": "Materialization"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-852",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "RobotConfig fields: 3"
},
"kind": "pass"
},
"file": "solutions/MQ_858.mojo",
"id": "quest/MQ-858/solution",
"meta": {
"concept": "Use `reflect[T]` to inspect a type at compile time, querying members like `field_count()`",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/reflection/#inspect-a-type",
"file": "src/config_inspect.mojo",
"hint": "The handle has no `num_fields` method — that is the wrong name. Open the linked reflection docs, find the accessor that returns how many fields the struct declares, and call it with parentheses.",
"title": "Count the robot-config fields by reflection",
"topic": "Reflection"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_858.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "RobotConfig fields: 3"
},
"kind": "fail"
},
"file": "starters/MQ_858.mojo",
"id": "quest/MQ-858/starter",
"meta": {
"concept": "Use `reflect[T]` to inspect a type at compile time, querying members like `field_count()`",
"docUrl": "https://mojolang.org/docs/manual/metaprogramming/reflection/#inspect-a-type",
"file": "src/config_inspect.mojo",
"hint": "The handle has no `num_fields` method — that is the wrong name. Open the linked reflection docs, find the accessor that returns how many fields the struct declares, and call it with parentheses.",
"title": "Count the robot-config fields by reflection",
"topic": "Reflection"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-858",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Encoder count: 99"
},
"kind": "pass"
},
"file": "solutions/MQ_901.mojo",
"id": "quest/MQ-901/solution",
"meta": {
"concept": "Use the free function `unsafe_alloc[T](n)` to allocate space for `n` uninitialized values of `T`",
"docUrl": "https://mojolang.org/docs/manual/pointers/unsafe-pointers/#allocating-memory",
"file": "src/scratch.mojo",
"hint": "You need to tell `unsafe_alloc` what type to allocate, so it can work out the size. Give it the element type as a parameter in brackets, before the count. Everything after the allocation is already correct.",
"title": "Allocate the encoder-sample scratch buffer",
"topic": "Pointers"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_901.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "Encoder count: 99"
},
"kind": "fail"
},
"file": "starters/MQ_901.mojo",
"id": "quest/MQ-901/starter",
"meta": {
"concept": "Use the free function `unsafe_alloc[T](n)` to allocate space for `n` uninitialized values of `T`",
"docUrl": "https://mojolang.org/docs/manual/pointers/unsafe-pointers/#allocating-memory",
"file": "src/scratch.mojo",
"hint": "You need to tell `unsafe_alloc` what type to allocate, so it can work out the size. Give it the element type as a parameter in brackets, before the count. Everything after the allocation is already correct.",
"title": "Allocate the encoder-sample scratch buffer",
"topic": "Pointers"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-901",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "second: 20"
},
"kind": "pass"
},
"file": "solutions/MQ_903.mojo",
"id": "quest/MQ-903/solution",
"meta": {
"concept": "With space for multiple values, `ptr[unsafe_offset=i]` accesses the element at offset `i`",
"docUrl": "https://mojolang.org/docs/manual/pointers/unsafe-pointers/#storing-multiple-values",
"file": "src/ptr_index.mojo",
"hint": "The second slot lives at index 1, not 0 — dereference that index instead.",
"title": "Read the right slot of the scratch buffer",
"topic": "Pointers"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_903.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "second: 20"
},
"kind": "fail"
},
"file": "starters/MQ_903.mojo",
"id": "quest/MQ-903/starter",
"meta": {
"concept": "With space for multiple values, `ptr[unsafe_offset=i]` accesses the element at offset `i`",
"docUrl": "https://mojolang.org/docs/manual/pointers/unsafe-pointers/#storing-multiple-values",
"file": "src/ptr_index.mojo",
"hint": "The second slot lives at index 1, not 0 — dereference that index instead.",
"title": "Read the right slot of the scratch buffer",
"topic": "Pointers"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-903",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Keep the `assert_equal` check in place and make it pass.",
"patterns": [
"assert_equal\\("
]
},
"kind": "pass"
},
"file": "solutions/MQ_950.mojo",
"id": "quest/MQ-950/solution",
"meta": {
"concept": "`assert_equal` from the `testing` module asserts that two values are equal",
"docUrl": "https://mojolang.org/docs/manual/errors/",
"file": "src/odometry_test.mojo",
"hint": "The function under test is correct — add a near distance of 100 and a far distance of 50 by hand and compare with the number the assertion checks against. One of those two numbers is wrong, and it is not the one the code computes.",
"title": "Make the odometry test pass",
"topic": "Testing"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_950.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"flags": "",
"message": "Keep the `assert_equal` check in place and make it pass.",
"patterns": [
"assert_equal\\("
]
},
"kind": "fail"
},
"file": "starters/MQ_950.mojo",
"id": "quest/MQ-950/starter",
"meta": {
"concept": "`assert_equal` from the `testing` module asserts that two values are equal",
"docUrl": "https://mojolang.org/docs/manual/errors/",
"file": "src/odometry_test.mojo",
"hint": "The function under test is correct — add a near distance of 100 and a far distance of 50 by hand and compare with the number the assertion checks against. One of those two numbers is wrong, and it is not the one the code computes.",
"title": "Make the odometry test pass",
"topic": "Testing"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-950",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "raised as expected"
},
"kind": "pass"
},
"file": "solutions/MQ_951.mojo",
"id": "quest/MQ-951/solution",
"meta": {
"concept": "`assert_raises` from the `testing` module is a context manager that asserts its `with` block raises an error",
"docUrl": "https://mojolang.org/docs/manual/errors/",
"file": "src/test_raises.mojo",
"hint": "The `assert_raises` block only passes if its body actually raises. Give `clamp` a negative input so it hits the `raise`.",
"title": "Assert that bad input raises",
"topic": "Testing"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "exercises/MQ_951.mojo",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
},
{
"dialect": {},
"expect": {
"check": {
"stdout": "raised as expected"
},
"kind": "fail"
},
"file": "starters/MQ_951.mojo",
"id": "quest/MQ-951/starter",
"meta": {
"concept": "`assert_raises` from the `testing` module is a context manager that asserts its `with` block raises an error",
"docUrl": "https://mojolang.org/docs/manual/errors/",
"file": "src/test_raises.mojo",
"hint": "The `assert_raises` block only passes if its body actually raises. Give `clamp` a negative input so it hits the `raise`.",
"title": "Assert that bad input raises",
"topic": "Testing"
},
"mode": "run",
"provenance": {
"commit": "3576e6105381bb6f956f405408ea8202ddf1eb6e",
"license": "Apache-2.0 WITH LLVM-exception per file headers; the repo has no LICENSE file, so confirm with Modular before showing exercises to students",
"path": "src/data/issues.ts#MQ-951",
"repo": "modular/mojo-quest",
"source": "mojo-quest",
"zipSha256": "8b64817dbe07aa133589accd7eb4fa01ce0cdb2ea154bb3b65835b7086c62b0c"
}
}
],
"processor": "quest"
}