One of the places I have noticed this on my MBP is in the Swift Playgrounds Learn to Code 2 "Moving Further Forward" Page.
After successfully getting the "expert" to the end of the maze puzzle a box pops up. It talks about defining a function using parameters to make the function more reusable. To make the function work I wrote:
If I try to put moveForward() without expert. as a prefix I get an error. That's OK by me.
However, the 'success box' after completing the maze says:
Not knowing the correct words to use in a search on the internet makes it difficult to find an answer.
I tried querying define a function as a method for an instance, or something like that.
Is there a way to write the function so it becomes a method that I can call with either expert.move(distance: 4), or character.move(distance: 4), or even beginner.move(distance: 4)?
When searching these forums I don't find a way to refine the search, or search through the results. Putting quote marks around part of the search doesn't search for that phrase. Most annoying having two phrases in quotes results in 403 Forbidden. The forbidden search is:
Swift Playgrounds "Learn to Code 2" "Moving Further Forward" Page
Why would searching for a phrase not work and searching two phrases be forbidden? WOW! 😳
After successfully getting the "expert" to the end of the maze puzzle a box pops up. It talks about defining a function using parameters to make the function more reusable. To make the function work I wrote:
Code Block let expert = Expert() func move(distance: Int) { for i in 1 ... distance { expert.moveForward() } }
If I try to put moveForward() without expert. as a prefix I get an error. That's OK by me.
However, the 'success box' after completing the maze says:
I do not see how to define the function so that I can call it this way in Learn to Code 2."Now that you've defined move, you'll be able to use is as a method on the Character and Expert types. For example, expert.move(distance: 4) will move the expert instance forward four tiles."
Not knowing the correct words to use in a search on the internet makes it difficult to find an answer.
I tried querying define a function as a method for an instance, or something like that.
Is there a way to write the function so it becomes a method that I can call with either expert.move(distance: 4), or character.move(distance: 4), or even beginner.move(distance: 4)?
When searching these forums I don't find a way to refine the search, or search through the results. Putting quote marks around part of the search doesn't search for that phrase. Most annoying having two phrases in quotes results in 403 Forbidden. The forbidden search is:
Swift Playgrounds "Learn to Code 2" "Moving Further Forward" Page
Why would searching for a phrase not work and searching two phrases be forbidden? WOW! 😳