Changing a caller’s value through a pointer

F-PARAM-V4-3hard

Plant every bed

Repair the planning-file import helpers: add seedlings to a retained bed record, append picked quantities to a harvest record, then apply bulk additions and between-record transfers. All quantities describe the software’s plan and inventory records.

What needs to change

Repair Plant and plantAll so every bed gets the planted seedlings.

Reproduce

  1. Pipe the sample garden into go run main.go and compare every bed line with the expected stdout.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

The file contains its imports, readLines, the Bed type, move and the complete main.

Input: 1 to 100 whole starting counts from 0 to 100, then up to 100 commands "plant N" or "move A B N". N is a whole count from 0 to 100; A and B name valid beds numbered from 1. Moves may produce a negative planning balance; a move within one bed changes nothing. The supplied reader receives valid data.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in