Skip to main content

If you have read in your childhood a Geronimo Stilton's book i, I am sure that you remember the style of the text, sometimes the words waswere decorated for making the act of reading more funny for kids,: example.

But when you are an adult you dontdon't have that little entertainment in your readings... why? In a nostalgic attack iI have decided to make an algorithm to create that output with every text in the world.

ItsIt's not very similar, but itsit's curious.

(ThisThese outputs are an imageimages because there isare two ways to create the output, show it in your program some way or create an output htmlHTML like mine.) thatsThis is my trulyraw output:

I have made an example of the algorithm (not golfed) in javaJava: Here is it This is the list of steps that you have to follow starting whit the base input:

  1. Start catching a random word in position 5-20(words)
  2. If the word is less or equals to 3 char long (e.g. her, a) catch the next word until you find someone whit more than 3 char
  3. "Clean the word", the transformed word cant contain characters like " or .. The modified word has to starts and end whit [A-Z][a-z] and only whit that characters so... clean it if you need is the 3th step
Examples of this step:
if you word is    | word cleaned
------------------|----------------
"Geronimo,        | Geronimo
final.            | final
air-conditioner   | air-conditioner  (DontDon't remove special characters inside the word)
  1. Put it randomly (1/3 cases) in bold, cursive or underlined (Only one at the same time for word)
  2. Give the word a bigger size than the rest of the text (how much big is your election)
  3. Give the word a random color (Try to make this in the most ranguewidest range of colors that you can, in my code creates an rgbRGB with javaJava random function in every color that goes from 0 to 255)
  4. Give the word any font... (What you want, doesntdoesn't matter what you use but must be diferentdifferent to the text font)
  5. fromFrom this word repeat the 1st step for grab a new one random word next to this
In step one by a random decision betwenbetween 5 and 20 you have to start in word 7 for example:
It was in the morning of *June* 21, and I had just set
paw in the office.

On time that you have modified that word you start again the random fuctionfunction and 
you add the result to your actual position for get the next word... the result 
of the random function this time has been 8:
It was in the morning of *June* 21, and I had just set
paw *in* the office.

But that word is 2 char long and the next one too so we take the word "office"
It was in the morning of *June* 21, and I had just set
paw in the *office.*

Office has a point at the end, lets clean it:
It was in the morning of *June* 21, and I had just set
paw in the *office*.

And the last step is modify this last word
  • As iI have said, the output can be show in your program (or directly in htmlHTML if you uses javascriptuse JavaScript or something like that) or ouputsoutputs an htmlHTML text whit all the properties in it.
  • The structure of the htmlHTML can be as you want always that, as long as when you execute it the result should follow the rules. Basically, you dontdon't have to make it like my example output.
  • The base font and size can be what you want, iI have used Verdana in my example because iI think that the output is more... "beautiful"? and my code is not golfed.
  • If you can, put a picture to the executed htmlHTML in your solution please.
  • In reference to the randomness, the only thing that is relevant is that the output text has diferentdifferent colors, styles and words every time you run the program, if there is a more probablysome options are more probable (for example red is more problablyprobable than green at theas a color) dont mindthat doesn't matter.
  • And in reference to the randomness of the colors, itsit's not necesarynecessary that all colors are contempledcontemplated in the output, try to put the most colorcolors you can... I know that this is not very mathematecallymathematically precise because is a problem to talk about colors when there isare so much ways to create them (rgbRGB, hexadecimal, hsvHSV...) so imI'm going to try to put a "minimal" rule:
  • Lets say that the "extreme" colors must have non 0 probability, for example in rgb iRGB I mean that this colors are mandatory: 0,0,0 255,255,255 255,0,0 0,255,0 0,0,255 255,0,255 0,255,255 255,255,0 but if you want you can use too the colors in betwenbetween (That is the principal idea) And if for some reason you cant use that rule of extreme colors have in mind that at least the output must be 8 diferentdifferent colors.
  • This is codegolfcode golf, so the shortest code wins.

If you have read in your childhood a Geronimo Stilton's book i am sure that you remember the style of the text, sometimes the words was decorated for making the act of reading more funny for kids, example

But when you are an adult you dont have that little entertainment in your readings... why? In a nostalgic attack i have decided to make an algorithm to create that output with every text in the world

Its not very similar, but its curious

(This outputs are an image because there is two ways to create the output, show it in your program some way or create an output html like mine) thats my truly output:

I have made an example of the algorithm (not golfed) in java: Here is it This is the list of steps that you have to follow starting whit the base input:

  1. Start catching a random word in position 5-20(words)
  2. If the word is less or equals to 3 char long her a catch the next word until you find someone whit more than 3 char
  3. "Clean the word", the transformed word cant contain characters like " or .. The modified word has to starts and end whit [A-Z][a-z] and only whit that characters so... clean it if you need is the 3th step
Examples of this step:
if you word is    | word cleaned
------------------|----------------
"Geronimo,        | Geronimo
final.            | final
air-conditioner   | air-conditioner  (Dont remove special characters inside the word)
  1. Put it randomly (1/3 cases) in bold, cursive or underlined (Only one at the same time for word)
  2. Give the word a bigger size than the rest of the text (how much big is your election)
  3. Give the word a random color (Try to make this in the most rangue of colors that you can, in my code creates an rgb with java random function in every color that goes from 0 to 255)
  4. Give the word any font... (What you want, doesnt matter what you use but must be diferent to the text font)
  5. from this word repeat the step for grab a new one random word next to this
In step one by a random decision betwen 5 and 20 you have to start in word 7 for example:
It was in the morning of *June* 21, and I had just set
paw in the office.

On time that you have modified that word you start again the random fuction and 
you add the result to your actual position for get the next word... the result 
of the random function this time has been 8:
It was in the morning of *June* 21, and I had just set
paw *in* the office.

But that word is 2 char long and the next one too so we take the word "office"
It was in the morning of *June* 21, and I had just set
paw in the *office.*

Office has a point at the end, lets clean it:
It was in the morning of *June* 21, and I had just set
paw in the *office*.

And the last step is modify this last word
  • As i have said, the output can be show in your program (or directly in html if you uses javascript or something like that) or ouputs an html text whit all the properties in it.
  • The structure of the html can be as you want always that when you execute it the result follow the rules. Basically, you dont have to make it like my example output.
  • The base font and size can be what you want, i have used Verdana in my example because i think that the output is more... "beautiful"? and my code is not golfed.
  • If you can put a picture to the executed html in your solution please.
  • In reference to the randomness, the only thing that is relevant is that the output text has diferent colors, styles and words every time you run the program, if there is a more probably options (for example red is more problably than green at the color) dont mind.
  • And in reference to the randomness of the colors, its not necesary that all colors are contempled in the output, try to put the most color you can... I know that this is not very mathematecally precise because is a problem to talk about colors when there is so much ways to create them (rgb, hexadecimal, hsv...) so im going to try to put a "minimal" rule:
  • Lets say that the "extreme" colors must have non 0 probability, for example in rgb i mean that this colors are mandatory: 0,0,0 255,255,255 255,0,0 0,255,0 0,0,255 255,0,255 0,255,255 255,255,0 but if you want you can use too the colors in betwen (That is the principal idea) And if for some reason you cant use that rule of extreme colors have in mind that at least the output must be 8 diferent colors.
  • This is codegolf so the shortest code wins

If you have read in your childhood a Geronimo Stilton's book, I am sure that you remember the style of the text, sometimes the words were decorated for making the act of reading more funny for kids: example.

But when you are an adult you don't have that little entertainment in your readings... why? In a nostalgic attack I have decided to make an algorithm to create that output with every text in the world.

It's not very similar, but it's curious.

(These outputs are images because there are two ways to create the output, show it in your program some way or create an output HTML like mine.) This is my raw output:

I have made an example of the algorithm (not golfed) in Java: Here is it This is the list of steps that you have to follow starting whit the base input:

  1. Start catching a random word in position 5-20(words)
  2. If the word is less or equals to 3 char long (e.g. her, a) catch the next word until you find someone whit more than 3 char
  3. "Clean the word", the transformed word cant contain characters like " or .. The modified word has to starts and end whit [A-Z][a-z] and only whit that characters so... clean it if you need is the 3th step
Examples of this step:
if you word is    | word cleaned
------------------|----------------
"Geronimo,        | Geronimo
final.            | final
air-conditioner   | air-conditioner  (Don't remove special characters inside the word)
  1. Put it randomly (1/3 cases) in bold, cursive or underlined (Only one at the same time for word)
  2. Give the word a bigger size than the rest of the text (how much big is your election)
  3. Give the word a random color (Try to make this in the widest range of colors that you can, in my code creates an RGB with Java random function in every color that goes from 0 to 255)
  4. Give the word any font... (What you want, doesn't matter what you use but must be different to the text font)
  5. From this word repeat the 1st step for grab a new one random word next to this
In step one by a random decision between 5 and 20 you have to start in word 7 for example:
It was in the morning of *June* 21, and I had just set
paw in the office.

On time that you have modified that word you start again the random function and 
you add the result to your actual position for get the next word... the result 
of the random function this time has been 8:
It was in the morning of *June* 21, and I had just set
paw *in* the office.

But that word is 2 char long and the next one too so we take the word "office"
It was in the morning of *June* 21, and I had just set
paw in the *office.*

Office has a point at the end, lets clean it:
It was in the morning of *June* 21, and I had just set
paw in the *office*.

And the last step is modify this last word
  • As I have said, the output can be show in your program (or directly in HTML if you use JavaScript or something like that) or outputs an HTML text whit all the properties in it.
  • The structure of the HTML can be as you want, as long as when you execute it the result should follow the rules. Basically, you don't have to make it like my example output.
  • The base font and size can be what you want, I have used Verdana in my example because I think that the output is more... "beautiful"? and my code is not golfed.
  • If you can, put a picture to the executed HTML in your solution please.
  • In reference to the randomness, the only thing that is relevant is that the output text has different colors, styles and words every time you run the program, if there some options are more probable (for example red is more probable than green as a color) that doesn't matter.
  • And in reference to the randomness of the colors, it's not necessary that all colors are contemplated in the output, try to put the most colors you can... I know that this is not very mathematically precise because is a problem to talk about colors when there are so much ways to create them (RGB, hexadecimal, HSV...) so I'm going to try to put a "minimal" rule:
  • Lets say that the "extreme" colors must have non 0 probability, for example in RGB I mean that this colors are mandatory: 0,0,0 255,255,255 255,0,0 0,255,0 0,0,255 255,0,255 0,255,255 255,255,0 but if you want you can use too the colors in between (That is the principal idea) And if for some reason you cant use that rule of extreme colors have in mind that at least the output must be 8 different colors.
  • This is code golf, so the shortest code wins.
Retag
Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240
added 666 characters in body
Source Link
  • As i have said, the output can be show in your program (or directly in html if you uses javascript or something like that) or ouputs an html text whit all the properties in it.
  • The structure of the html can be as you want always that when you execute it the result follow the rules. Basically, you dont have to make it like my example output.
  • The base font and size can be what you want, i have used Verdana in my example because i think that the output is more... "beautiful"? and my code is not golfed.
  • If you can put a picture to the executed html in your solution please.
  • In reference to the randomness, the only thing that is relevant is that the output text has diferent colors, styles and words every time you run the program, if there is a more probably options (for example red is more problably than green at the color) dont mind.
  • And in reference to the randomness of the colors, its not necesary that all colors are contempled in the output, try to put the most color you can... I know that this is not very mathematecally precise because is a problem to talk about colors when there is so much ways to create them (rgb, hexadecimal, hsv...) so im going to try to put a "minimal" rule:
  • Lets say that the "extreme" colors must have non 0 probability, for example in rgb i mean that this colors are mandatory: 0,0,0 255,255,255 255,0,0 0,255,0 0,0,255 255,0,255 0,255,255 255,255,0 but if you want you can use too the colors in betwen (That is the principal idea) And if for some reason you cant use that rule of extreme colors have in mind that at least the output must be 8 diferent colors.
  • This is codegolf so the shortest code wins
  • As i have said, the output can be show in your program (or directly in html if you uses javascript or something like that) or ouputs an html text whit all the properties in it.
  • The structure of the html can be as you want always that when you execute it the result follow the rules. Basically, you dont have to make it like my example output.
  • The base font and size can be what you want, i have used Verdana in my example because i think that the output is more... "beautiful"? and my code is not golfed.
  • If you can put a picture to the executed html in your solution please.
  • In reference to the randomness, the only thing that is relevant is that the output text has diferent colors, styles and words every time you run the program, if there is a more probably options (for example red is more problably than green at the color) dont mind.
  • This is codegolf so the shortest code wins
  • As i have said, the output can be show in your program (or directly in html if you uses javascript or something like that) or ouputs an html text whit all the properties in it.
  • The structure of the html can be as you want always that when you execute it the result follow the rules. Basically, you dont have to make it like my example output.
  • The base font and size can be what you want, i have used Verdana in my example because i think that the output is more... "beautiful"? and my code is not golfed.
  • If you can put a picture to the executed html in your solution please.
  • In reference to the randomness, the only thing that is relevant is that the output text has diferent colors, styles and words every time you run the program, if there is a more probably options (for example red is more problably than green at the color) dont mind.
  • And in reference to the randomness of the colors, its not necesary that all colors are contempled in the output, try to put the most color you can... I know that this is not very mathematecally precise because is a problem to talk about colors when there is so much ways to create them (rgb, hexadecimal, hsv...) so im going to try to put a "minimal" rule:
  • Lets say that the "extreme" colors must have non 0 probability, for example in rgb i mean that this colors are mandatory: 0,0,0 255,255,255 255,0,0 0,255,0 0,0,255 255,0,255 0,255,255 255,255,0 but if you want you can use too the colors in betwen (That is the principal idea) And if for some reason you cant use that rule of extreme colors have in mind that at least the output must be 8 diferent colors.
  • This is codegolf so the shortest code wins
Became Hot Network Question
added 1 character in body
Source Link
Loading
added 840 characters in body
Source Link
Loading
Tweeted twitter.com/StackCodeGolf/status/1394986202089066496
added 429 characters in body
Source Link
Loading
Source Link
Loading