Locomotive_Engineer

Dear Colin,

thanks for that
I just looked it up…

and found:
in the Instructions - of Mixed_Juices the concept of Comprehensions is missing!

that’s how I didn’t know anything about it.

and now my hints/errors:

  1. (this is outdated because of what I just found out):
    the solution of Task 1 is logical, but not foreseeable, because the effect of [] (Comprehension) in code is not explained before, is it?

  2. wrong dimension #

map(x -> 2x, 1:3)
4-element Vector{Int64}:
→ it should be
3-element Vector{Int64}:
  1. Task 3:

some typografical errors, eg

add_missing_stops(Dict("from" => "New York", "to" => "Miami"),
                      stop_1= > ..
  • at stop1: Space at the wrong place
  • missing „“ at stop1…5
→add_missing_stops(Dict("from" => "New York", "to" => "Miami"), "stop_1" => "Washington, DC", "stop_2" => "Charlotte", "stop_3" => "Atlanta", "stop_4" => "Jacksonville", "stop_5" => "Orlando")
  1. Task 4:

some typografical errors,

extend_route_information(Dict("from" => "Berlin", "to" => "Hamburg"), :length = "100", :speed = "50")

→

extend_route_information(Dict("from" => "Berlin", "to" => "Hamburg"), length = "100", speed = "50")
  • And: please explain map() a bit further, give some more examples

Thanks

Hi Nisang!

Thanks for the feedback! Would you be interested in opening a PR with a fix for the typos?

As @colinleach pointed out, the basics are shown in the Loops concept introduction (see link in the comment above). The concept introduction can be different from the exercise introduction (and it is in this case), and should be accessed from clicking on the concept in the syllabus. If you click on the exercise, you will see the exercise introduction instead. Students aren’t required or even encouraged to use comprehensions in the task, so this part was deleted to keep the exercise introduction shorter and more relevant.

map() is a higher order function, which has its own concept later in the syllabus. While potentially useful here, it’s not technically needed for this exercise, so further explanation is also beyond the scope of this introduction as we don’t want to overload students with too much information (also you can note we left links to the Julia documentation of map and comprehensions, broadcasting and anonymous functions in the hints).

The main aim of this exercise was to get students to practice with different argument type with a special emphasis on splatting and slurping. Judicious use of the latter two can greatly simplify a solution. Careful reading of that section can help a lot with this exercise. In fact, many exercises are designed to use things explicitly mentioned in the introduction, so it’s always a good idea to read that carefully and maybe reread when getting stuck, but also don’t forget about the hints!

As an example, a solution to Task 1 is

get_vector_of_wagons(args...) = [args...]

or instead of [args...] a use of collect(args) can do the trick too, with both of these ideas mentioned in the hints.

Again, we appreciate your feedback, and we’ll look into improving the clarity of everything. You have given me a couple of ideas to help with making the hints better and there is one somewhat bothersome aspect about Task 3 which you’ve reminded me of.

Please let us know if you want to open that PR, otherwise, we’ll be happy to take care of it!

2 Likes

Hi Depial,

I can do that, but where?

And: In my opinion I (re)read the instructions carefully and did’nt know how to solve and did’nt want to use the hints to early
So it seems I should read the concepts in the syllabus to avoid missing something in the future

thanks for the extra information!
I wrote:
“please explain map() a bit further, give some more examples”
here I meant to explain this prior to the exercise.

best wishes

Nisang

Great! Here is the Julia repo on GitHub and this is a link to the Exercism docs for contributing if you want to have a look.

We don’t explain it prior to the exercise because its explanation (and potentially use) requires knowledge of Higher Order Functions, which is a concept that already exists further down the syllabus. We’ve left links to the Julia docs on it in case students want to explore on their own at this stage.

This is a great idea because there is always material in the introduction which is directly relevant to the exercise.

Remember, there is an introduction with learning material directly before/above the instructions and you can always look back to that while doing the exercise (since that is the one that has the highest percentage of exercise specific content out of all of them), but it’s still good to read the full version on the concept page.

Dear Depal,
well in my opinion that’s exactly what I did…
but didn’t progress
And, I don’t know,
but what does it mean,
that the syntax-Errors weren’t recognized or let’s say reported to you earlier?

And, isn’t this request a RP of the code error or
why is it neccessary to report again?

best wishes

Nisang

actually I’ll be happy if you take care of it!
my task list is overcrowded

one more question

what is the recommended exercise after Locomotive Engineer?

I startet “dominoes” before Locomotive Engineer
and it was too difficult and now I see it “in-progress” and no recommended exercise…

??

thanks for your answer!

Nisang

I’m not sure where you are on your journey, but, on the road to learning independence, there is a point where learners are more used to programmatic solutions, of the “plug-and-chug” variety. This is where an example is given and then a follow-up problem closely matches that example with only some slight variation. In this light, I understand how the section on slurping and splatting can be overlooked as irrelevant, since there aren’t any specific examples that can be copied into the exercise.

The way to gain a hint in this case is to try to take in all of the information from the lesson (i.e. the introduction) with equal weight/importance for all parts (e.g. “This is probably here for some reason!”). Then, try to use all of it somewhere (anywhere!) in the exercise. In effect, we are trying to find if there is a place the information can be applied, rather than being told where to apply it. A related idea is to focus on using the new information rather than just focusing on solving the problem.

This requires a bit more learning independence than a “plug-and-chug” situation since the gap between instruction and exercise is larger. Of course, we don’t expect all students to be at that stage, so we also provide hints to make the gap smaller for those who have not arrived there yet.

In short, we have to pass through these different stages on our way to full learning independence, so they can’t be skipped. For that reason, we try to cater to students at all stages, while encouraging them to take the next step in their journey.

We’ll get that taken care of!

You can always report bugs or typos here, and we’ll fix them. If you want to contribute more directly in the future, we make all of our changes to the website code on GitHub.

If you want an exercise that continues to practice the Functions concept you can do Two-Fer or if you want to start another concept, you can check out Function Composition, Nothingness or Random and their exercises.

Can I ask how you are going through the exercises? Are you following the syllabus on Learning Mode?

Or another way?

@AnandNisang, here’s the PR#1051 on GitHub. You can have a look and/or comment on it if you’d like :)

Hi Depial,

thanks for the recommendation!
and for your explanations, that I will answer to later.

actually I’m on practice mode.
as we diskussed above I will now read the concepts from Learning Mode to not to miss any explanations.

And why is it that there’s no recommended exercise right now…
because ‘dominoes’ is still in progress?

with best wishes

Nisang

Tracks are not linear. There’s never any recommended exercises. Exercises are either locked (learning mode only) or unlocked. Once you complete Hello World, you can work on any unlocked exercise in any order. It’s generally a good idea to work on the Easy exercises first, then Medium and then Hard.

Also, if you have learning mode on, you can go to the Learn tab (as seen in the photo above). From there, you can see what concept is needed to be completed to unlock more exercises.

For example, if you completed Locomotive Engineer, then this will open the three concepts I recommended to you along with their exercises.

It will probably be more instructive to follow the syllabus on the Learn tab than to go through the exercises on the Practice tab

Dear Colin,

thanks for that
I just had a look at it and saw that the function calls and hints were updatedt.

Yes, that’s what I’m used to
But how can I “focus on using the new information” if something crucial (Comprehension) is missing (here in the exercise “mixed Juices”)?

At the moment I cannot figure out at one glance what concept an exercise is related to or which exercises belong to a concept.

I Isaac

thanks for your answer
Is it really like that?

I think I saw recommended exercises before…
and now I don’t.
maybe because one exercise is “in-progress”??

And, can I reset an already started exercise [quote="AnandNisang, "]
“in-progress”
[/quote]
??

Thanks for answers

Nisang

You cannot mark a single exercise as not-started. You can reset the entire track, but not the status of one exercise.

Comprehensions are not crucial to the exercise, nor is map() nor broadcasting. Almost anything you can do with those, you can do with a for loop. These are just other ways of doing the same thing, which some students may want to try.

For example, the following are equivalent:

notacomp = []
for pair in iter
    push!(notacomp, last(pair))
end

acomp = [last(pair) for pair in iter]

And the following options will be equivalent if iter is a Vector (since they preserve the container):

abroadcast = last.(iter)
amap = map(pair -> last(pair), iter)
amap = map(last, iter)

If you don’t feel comfortable with these options, then there is always the for loop, but you can also do research into how to use any of them if you’d like, which is one reason we mention them. Otherwise you can continue in the syllabus and they will be covered in later concepts.

The exercises are meant to be self-contained, while keeping in mind that they come with prerequisites. Also, there are very often multiple ways of solving an exercise, and some students will prefer one method over another, so we try to give hints towards various options.

Instead of immediately trying to use everything, maybe a good technique for you to try at this stage would be to use basic functionality (e.g. for loops) to pass the tests, then try to refactor your code using alternatives that you have researched (e.g. map, comprehensions, etc). This is a good way to explore other options, but it requires curiosity and motivation to further explore a topic on your own because it is neither necessary nor expected.

Please read my last response before this one. It appears you are not using the syllabus on the Learn tab which I showed in a screenshot further above. This is where the concepts and concept exercises are organized together.

Okay,
I have to ask about this.
What are:

  • iter, does it refer to “Locomotive_Engineer”?
  • acomp
  • notacomp

That code shows two different ways to iterate over some iterable (iter), call last() on each value, and collect the result of that function call into an array/list/vector. One approach uses a compressive expression (acomp) and the other approach uses a loop, and not a comprehension expression (notacomp). Both accomplish the same thing.

1 Like

Exactly as @IsaacG said.

Also, in this case, you could use a dictionary from Locomotive Engineer as the iterable (iter) if you wanted and this code would give you its values.

If you want an iterable which will the same thing for all of the examples, you can use:

iter = [(1, 2), (3, 4), (5, 6)]