Finding the Largest Value with Little Man Computer

  • Thread starter Thread starter buttonmutton
  • Start date Start date
  • Tags Tags
    Computer
AI Thread Summary
To write a Little Man program that accepts an indefinite number of input values and outputs the largest value, it is not necessary to store all input values. Instead, the program can maintain a single variable to keep track of the largest value encountered during input. As each new value is entered, the program compares it to the current largest value and updates accordingly. This approach minimizes memory usage, as only one value needs to be stored at any time. The discussion emphasizes that storing all inputs is unnecessary and inefficient, as the goal is simply to identify the maximum value from the inputs provided.
buttonmutton
Messages
4
Reaction score
0
How do you write a Little Man program which accepts an indefinite number of input values given the conditions that the output value has to be the largest of the input values.

Is it just by entering and storing input or otherwise?
 
Technology news on Phys.org
How much would you need to store in that case?
 
there's no limit
 
I think you misunderstood verty's post. You don't need to store all the input.
 
Then how do you write it?
 
Any suggestions?
 
Please give a detailed rationale why would you would need to store stuff without limit. What would you do with that stored stuff anyway?
 
Back
Top