Just in time processing on a character stream: Difference between revisions

From Rosetta Code
Content added Content deleted
(This task was inspired by the movie National Treasure)
 
m (fix typo)
Line 10: Line 10:
Provide a reasonably interesting message to be decoded, e.g. Silence-Dogood. Your choice.
Provide a reasonably interesting message to be decoded, e.g. Silence-Dogood. Your choice.


This task was inspired by the movie "[[wp:National_Treasure_%28film%29|National Treasure]]" with referes to a "[[wp:Book cipher|book cipher]]".
This task was inspired by the movie "[[wp:National_Treasure_%28film%29|National Treasure]]" with refers to a "[[wp:Book cipher|book cipher]]".

Revision as of 10:25, 15 December 2013

Just in time processing on a character stream is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Given a stream of characters, presumably (simulated) from a keyboard, that contain the separators "formfeed", "linefeed", "tab" and "space" characters. Print out the ith character of the ith tab-field of the ith line of the ith page to reveal a secret password.

Stop processing immediately upon encountering a "!" found uniquely in this i,i,i,i position (least the system self destruct). The "!" may be found/permitted else where however, in which case it should be ignored.

Ideally this can be generalise as follows:

  • The separators (formfeed,linefeed,tab,space) provided from a user supplied array and can include additional separators.
  • These selection criterial is generalised ith,ith,ith,ith to a boolean function of f(page,line,field,word,...) or f(ith,jth,kth,lth,mth,etc...)

Provide a reasonably interesting message to be decoded, e.g. Silence-Dogood. Your choice.

This task was inspired by the movie "National Treasure" with refers to a "book cipher".