README.md

Star Wars lorem ipsum generator

Using ForcemJS, this package produces Star Wars filler text.

if(!(require(devtools))) install.package("devtools")
devtools::install_github("MangoTheCat/swli")

How it works - reference wrappers

library(swli)
aNewHope(paragraphs = 1)
#> [1] "Biggs, Wedge, let's close it up. We're going in. We're going in full throttle. Right with you, boss. Luke, at that speed will you be able to pull out in time? It'll be just like Beggar's Canyon back home. We'll stay back far enough to cover you. My scope shows the tower, but I can't see the exhaust port! Are you sure the computer can hit it? Watch yourself! Increase speed full throttle! What about the tower? You worry about those fighters! I'll worry about the tower! Artoo...that, that stabilizer's broken loose again! See if you can't lock it down! I'm hit! I can't stay with you. Get clear, Wedge. You can't do any more good back there! Sorry!"
theEmpireStrikesBack(paragraphs = 1)
#> [1] "Admiral. Yes, Captain I think we've got something, sir. The report is only a fragment from a probe droid in the Hoth system, but it's the best lead we've had. We have thousands of probe droids searching the galaxy. I want proof, not leads! The visuals indicate life readings. It could mean anything. If we followed every lead... But, sir, the Hoth system is supposed to be devoid of human forms. You found something? Yes, my lord. That's it. The Rebels are there. My lord, there are so many uncharted settlements. It could be smugglers, it could be... hat is the system. And I'm sure Skywalker is with them. Set your course for the Hoth system. General Veers, prepare you men."
returnOfTheJedi(paragraphs = 1)
#> [1] "This is a Rebel that surrendered to us. Although he denies it, I believe there may be more of them, and I request permission to conduct a further search of the area. He was armed only with this. Good work, Commander. Leave us. Conduct your search and bring his companions to me. Yes, my Lord. The Emperor has been expecting you. I know, father. So, you have accepted the truth. I've accepted the truth that you were once Anakin Skywalker, my father. That name no longer has any meaning for me."
places(paragraphs = 1)
#> [1] "Mrlsst"
people(paragraphs = 1)
#> [1] "Moruth Doole"

How it works - root function

library(swli)
# Change paragraphs
swli(paragraphs = 2)
#> [1] "Your friend is quite a mercenary. I wonder if he really cares about anything...or anyone. I care! So...what do you think of her, Han? I'm trying not to, kid! Good... Still, she's got a lot of spirit. I don't know, what do you think? Do you think a princess and a guy like me... No!"
#> [2] "Lock the door, Artoo. All right, check that side of the street. It's secure. Move on to the next door. I would much rather have gone with Master Luke than stay here with you. I don't know what all the trouble is about, but I'm sure it must be your fault. You watch your language!"
# Change type of return
swli(type = "e4")
#> [1] "Luke, take these two over to the garage, will you? I want you to have both of them cleaned up before dinner. But I was going into Toshi Station to pick up some power converters... You can waste time with your friends when your chores are done. Now come on, get to it! All right, come on! And the red one, come on. Well, come on, Red, let's go. Uncle Owen... Yeah?This R2 unit has a bad motivator. Look! Hey, what're you trying to push on us? Excuse me, sir, but that R2 unit is in prime condition. A real bargain. Uncle Owen... Yeah? What about that one? What about that blue one? We'll take that one. Yeah, take it away."
#> [2] "Not after we demonstrate the power of this station. In a way, you have determined the choice of the planet that'll be destroyed first. Since you are reluctant to provide us with the location of the Rebel base, I have chosen to test this station's destructive power... on your home planet of Alderaan. No! Alderaan is peaceful. We have no weapons. You can't possibly... You would prefer another target? A military target? Then name the system! I grow tired of asking this. So it'll be the last time. Where is the Rebel base? Dantooine. They're on Dantooine."                                                                 
#> [3] "Rendezvous at mark six point one. This is Red Two. Flying toward you. Red Three, standing by. Red Leader, this is Base One. Keep half your group out of range for the next run. Copy, Base One. Luke, take Red Two and Three. Hold up here and wait for my signal...to start your run. This is it! We should be able to see it by now. Keep your eyes open for those fighters! There's too much interference! Red Five, can you see them from where you are? No sign of any...wait! Coming in point three five. I see them. I'm in range. Target's coming up! Just hold them off for a few seconds."
# Get an item from each type
options <- c("e4", "e5", "e6", "places", "people")
mapply(swli,  type = options,  paragraphs = 1)
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             e4 
#> "You know, I think that R2 unit we bought might have been stolen. What makes you think that? Well, I stumbled across a recording while I was cleaning him. He says he belongs to someone called Obi-Wan Kenobi. I thought he might have meant old Ben. Do you know what he's talking about? Well, I wonder if he's related to Ben. That old man's just a crazy old wizard. Tomorrow I want you to take that R2 unit into Anchorhead and have its memory flushed. That'll be the end of it. It belongs to us now. But what if this Obi-Wan comes looking for him? He won't, I don't think he exists any more. He died about the same time as your father. He knew my father? I told you to forget it. Your only concern is to prepare the new droids for tomorrow. In the morning I want them on the south ridge working out those condensers." 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             e5 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                  "Captain Solo, this time you have gone too far. No, I will not be quiet, Chewbacca. Why doesn't anyone listen to me? The fleet is beginning to break up. Go back and stand by the manual release for the landing claw. I really don't see how thats going to help. Surrender is a perfectly acceptable alternative in extreme circumstances. The Empire may be gracious enough... Thank you." 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             e6 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "We're coming! Come on! Come on! Oh, Artoo, hurry! My goodness! Artoo, why did you have to be so brave? Well, I suppose I could hotwire this thing. I'll cover you." 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         places 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "Tynna" 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         people 
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "Bodo Baas"

Quirks & Bugs

Due to the randomisation of paragraphs for return, the original JS auther returns 5 paragraphs when a request for length 0 comes in.

The window scope in the original javascript errors when called by V8 so the version locally has this replaced with global.



MangoTheCat/swli documentation built on May 7, 2019, 2:23 p.m.