From 2ff21c708cd53d73e2eb2e2958fda8f9e92b169e Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 24 Nov 2023 18:27:32 +0100 Subject: [PATCH] fix(algorithms): fix the admonitions in Karel Signed-off-by: Matej Focko --- algorithms/04-recursion/2022-11-29-karel-1.md | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/algorithms/04-recursion/2022-11-29-karel-1.md b/algorithms/04-recursion/2022-11-29-karel-1.md index e30750e..d3cad44 100644 --- a/algorithms/04-recursion/2022-11-29-karel-1.md +++ b/algorithms/04-recursion/2022-11-29-karel-1.md @@ -79,12 +79,15 @@ You can see an example of such map here: As a first step write down any ideas and things that you have noticed or came to your mind. Ideally: -- Write down a nested list of the problems, e.g. +1. Write down a nested list of the problems +2. Write down list of problems that can happen +3. Write down **anything** you consider important to solving the problem - :::info Example +:::tip Example - Problem: I want to find out whether the display on smartphone should rotate. +**Problem**: I want to find out whether the display on smartphone should rotate. +- nested list of problems - Check if display has been rotated - Read data from some sensor - From what sensor @@ -92,30 +95,16 @@ your mind. Ideally: - How do I communicate with the sensor? - What is the meaning of the data that I got? - How can I process it? - - ::: - -- Write down list of problems that can happen, e.g. - - :::info Example continued - - Following the same problem. - +- any problems that can happen - What if the sensor doesn't work? - What if the data doesn't conform to the specification? - What if my formulas are wrong? - - ::: - -- Write down **anything** you consider important to solving the problem, e.g. - - :::info Example continued once again - +- anything important - I could probably use gyroscope. - I should probably look up the datasheet for that module. - I could write some tests to verify that my computations are correct. - ::: +::: ## »Rough« pseudocode @@ -155,7 +144,9 @@ the ZIP-file, you can there: - `skeleton.py` - skeleton for your solution, needs to be put in the same directory as `karel_tk.py` and takes path to the world as a first argument, example usage: - $ python3 skeleton.py stairs.kw + ``` + $ python3 skeleton.py stairs.kw + ``` - of course, this file can be renamed ;)