Created
August 8, 2011 18:39
-
-
Save wharrell1271/1132391 to your computer and use it in GitHub Desktop.
MHLL standoff markup primitive JS function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i,l, | |
str = 'Mary had a little lamb, Its fleece was white as snow, And every where that Mary went The lamb was sure to go;', | |
poetryM = {'stanza':[[0,109]],'line':[[0,23],[24,53],[54,84],[85,109]]}; | |
console.log('the poem is '+str.length+' characters long'); | |
for(i=0,l=poetryM.line.length;i<l;i++){ | |
console.log('line '+i+': '+str.slice(poetryM.line[i][0],poetryM.line[i][1])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment