Hi Folks,
I am playing around with planting on a farm. I have seed that has a number called weight and I want the player to be able to plant a weight of weed. This version of the code works (doesn’t do anythinn yet just trace the variables)
Understand "sow [seed] [number]" as sowing it . Sowing it is an action applying to one thing and one number.
Carry out sowing it:
say "[noun]";
say "[number understood]"
The syntax for the player > sow barley 50 is awkward.
I have had absolutely no luck getting the coding right for the alternative, which I would like >sow 50 barley The Understand statement should begin like this, I (think I) know
Understand "sow [number] [seed]" as ...
No permutation I’ve run seems to work.
I’m sure it’s simple but it’s a wall for me.
Thanks,
Jeremiah McCall
Thanks Juhana. My problem isn’t solved probably because I left out the clarifying details.
So the understand statement you suggested compiles fine.
My problem is how to actually make that work in the carry out segment.
Ultimately each type of seed (wheat, barley, etc.) has a number called weight indicating the amount available, so one can’t plant or eat more than they have.
So I would like to code in my
carry out sowing it:
statement some conditional checks on the number entered and the seed type.
As a reminder, the player will enter
sow 20 wheat
or
sow 40 barley
When I use the statement you provided
Understand "sow [number] [seed]" as sowing it . Sowing it is an action applying to one number and one thing.
I’m not having luck with a test run of the carry out statement. More precisely, what exact terms store the number and the noun
So I tried:
Carry out sowing it:Carry out sowing it:
say "[number understood]
say "[noun]";".
When I run the program and enter >sow 50 barley as a playtester
The output is “50 nothing” (i.e. empty object)
Using [noun understood] generates an error.
So really it’s getting the carry out properly coded and using the right terms for noun and number that are not working for me.
Any help is much appreciated.