Bacon cipher: Difference between revisions

No edit summary
Line 537:
 
=={{header|Lua}}==
Based on C++ version
<lang Lua>
function Bacon( txt, secret, e )
Line 644 ⟶ 645:
end
 
local a = Bacon( "oneChase morning,the whenpig gregoraround samsathe wokehouse frompresent belly, scratch hand when troubledstroked. dreams"..
"When in doubt, wash jump around on couch, meow constantly until given food, "..
", he found himself transformed in his bed into a horrible "..
"favor packaging over toy. And sometimes switches in french and say 'miaou' "..
"vermin. he lay on his armour-like back, and if he lifted "..
"just because well why not has closed eyes but still sees you lick yarn hanging "..
"his head a little he could see his brown belly, slightly "..
"out of own butt so pelt "domedaround the house and dividedup byand archesdown intostairs stiffchasing sectionsphantoms.",
"Fall over dead, not really but gets sypathy", 1 )
"This is a Bacon cipher test", 1 )
print( a )
print( Bacon( "", a, 0 ) )
print( a )
print( Bacon( "", a, 0 ) )
Line 655 ⟶ 658:
{{out}}
<pre>
>lua -e "io.stdout:setvbuf 'no'" "bco.lua"
sh-4.3$ lua main.lua
chAsE the pig ArOUnD tHE HOuSe pRESeNt BeLly, ScrAtch HANd When sTRokEd. when in douBT, WAsH jUMp AroUNd On COUcH, meOW COnStAntlY unTil given fOoD, FaVoR PACkagINg Over toY. AnD soMetIMES sWitcHEs in FreNch AND saY 'mIAoU' jUst BeCAuse wELL Why not Has CLosED EYEs bu
One MOrnING, wHen gRegOr SAmSa wOke fRom TrOUbLed dreaMS, hE found Himself trAnsFORmeD In HIS bEd intO a hOrribLE VErmIN.
FALL OVER DEAD NOT REALLY BUT GETS SYPATHY
He lAy oN his ARMoUr-LikE BacK, anD if He LifTE
THIS IS A BACON CIPHER TEST
</pre>
 
=={{header|Perl 6}}==
Not truly a Bacon Cipher as it doesn't encode using font variations. But fits with the spirit if not the exact definition.