I am bound to an infinitely wide command line.

I have one line of text that my user will likely spend hours analysing for whatever reason. It is important that they can tell very easily and very quickly how many characters in from the start they are.

The stock standard way of doing this is writing out 123456789012345678901234567890 on the line below. This is all well and good for up to maybe 40 characters. One could put markers down on the third line every 25 characters noting the multiple of 25 making this valid for far longer strings.

The rest is up to you to work out. You can do better than '123...' or '^n*25'. Remember, this is an infinitely wide cmd-style console not a web page so there is no way of showing popups when the user mouses over something.

  • This question appears to be off-topic because it is a challenge. This site is not for challenges to which you already have an intended answer in mind before you ask the question. – Rahul Dec 5 '14 at 9:54

Any chance for doing what Notepad++ does by telling a column number in the footer of the window?

My cursor is in front of "command" and at the bottom you can see "Col: 18"

enter image description here

|improve this answer|||||
  • That's a valid answer, to an extent. The col value is dynamic and the challenge is to get that value, or a form of it, near to the text itself on the line(s) above and / or below. – Scruffy Oct 3 '14 at 2:15

What about display the counting number with the following format "10k+"

  • 0 - 999: display as it is 1,000 - 999,999: strip off the "thousand" part e.g. 56k for 56,000. And when the strip-off part excess certain ratio of the original value add the plus sign "+" e.g. 56k+ for
  • 56,200. You might as well use the minus sign e.g. 56k- for 55,950.
  • And the same when you go to million, trillion,... e.g 32M+
|improve this answer|||||
  • That's a valid contribution to an extent. Take for example the case of 32456381. That would appear as '32M+' under your system but it is not plausible to count 456381 characters in a short time frame and be accurate. The nature of the problem! – Scruffy Sep 28 '14 at 7:54
100       100
20        30

And no way it can be infinitely long.

|improve this answer|||||
  • The infinite length factor is purely hypothetical. Further, I disagree. It is entirely possible to have 'it' infinitely long. Please explain how that is not the case. – Scruffy Sep 28 '14 at 7:50
  • 1
    @TheJavaNot-So-Pro A computer has finite capacity. – paparazzo Sep 28 '14 at 11:38
  • Consider a program that deployed a human to detect patterns in a pseudorandom sequence and could therefore calculate the value of any position in an infinite string with far less that a megabyte of memory and far less than a CPU megacycle. – Scruffy Sep 28 '14 at 11:42
  • 1
    An infinite string does not even have a finite length for the position of the last position. A person does not have the capacity to evaluate an infinite string. You cannot even represent and infinite number with a megabyte of memory. – paparazzo Sep 28 '14 at 11:50
  • 1
    Oh so now we have a person that can live to infinity with a computer that can count to infinity with a megabyte of memory. – paparazzo Sep 28 '14 at 12:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.