This is a follow up question to How do you solve $r=\operatorname{ceil}\left(\frac{l+r\cdot t}{c}\right)$ for $r$?
I am trying to create a function that prints mono-spaced text to a computer console and wraps the text with a certain number of tabs. The output looks something like this,
this is some t
ext that is wr
apped
or this:
this is so
me text th
at is wrap
ped
What I want to know is, given a certain string of text of length $l$, number of spaces to put before the text $t$, and maximum number of characters in a row $c$, is there a mathematical function that can produce the amount of rows $r$ the text will take up in the console?
In the examples above, such a function would work like this:
$f(l,t,c)=r$
$f(33,4,18)=3$
$f(33,8,18)=4$
I already have several other methods of printing wrapped text like this to the console without this mathematical function that involve programming loops, but I would like to see if there is a way to do it with a mathematical function.