cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Repeat Cycle

ValeryOchkov
24-Ruby IV

Repeat Cycle

We have two cycles in Mathcad - while and for. But some tasks need the repeat cyle - this for example - http://communities.ptc.com/message/180846

It will be good to have this cycle in Mathcad Prime 3.0.

See too http://communities.ptc.com/docs/DOC-2161

2 REPLIES 2

Agree and then there is a most important version of "for" that is missing. The notation of piecewise function! This is a single (or plural) line "for" where for is ";" We had it almost in Mathcad - had to use "for" and doublicate a single line.

It will be good - if we not insert in the placeholder of the while cycle something - it will be an invisible 1.

Compare please two programs:

Fisermans-Fishers.png

Fish2.png

We need to have infinity cycle with one or more exits. An exit in the top of this cycles - we have a while cycle, an exit in the below of this cycle - we have a repeat cycle etc

PS

The task

Three fishermen lay down to sleep, not having counted or divided their catch. In the night, one of them woke up, and (not quite trusting the others) decided to divide the pile of fish and take his share. But the number of fish wasn't visible by three. However, he found he could throw one fish away, then take exactly a third. This he did (noting, in the true spirit of fairness, that an even number of fish was left for his comrades) and went back to sleep. Later, the second and third fishermen woke in turn, and each went through the same process. The question is, what is the MINIMUM number of fish in the catch that fulfils these conditions?

Top Tags