Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Post the "Do you even lift" one.

Name: Anonymous 2013-09-23 21:22

Do you guys like my program? I did it half assed yesterday but got it right after messing with it a bit more.

import sys
i = int(sys.argv[1])

psth = "Post the " ; qpsth = "\"Post the " ; one = " one" ; qone = " one\"" ; dye = "\"Do you even lift?\""
   
print (psth + qpsth * i + dye + qone * i + one)


http://s11.postimg.org/krhruoju9/Screenshot_9.png

Name: Anonymous 2013-09-23 21:33

___________
< EXCELLENT >
 -----------

      /\_)o<
     |      \
     | O . O|
      \_____/

Name: Anonymous 2013-09-24 0:53

You can do this without separate quoted versions of the strings.

Also you've got your base case wrong. I say it makes more sense for n = 0 to print "Do You even lift?" alone, that way n corresponds directly to the number of times the phrase is quoted rather than n + 1 times like in your program.

I've also taken the liberty to upgrade the language used:

n = ARGV.size >= 1 ? Integer(ARGV[0]) : 0
n.times { print("Post the \"") }
print "Do you even lift?"
n.times { print("\" one") }


I'm glad I could be of assistance. Please read your SICP today.

Name: Anonymous 2013-09-24 2:30

>>3
Simply amazing.

Name: Anonymous 2013-09-24 15:42

f 0 = "Do you even lift?"
f n = "Post the \"" ++ f (n-1) ++ "\" one"

Name: Anonymous 2013-09-24 17:29

while True:
    print('Post the "')

Name: Anonymous 2013-09-25 0:59

Why are you nerd saging so hard?

Name: Anonymous 2013-09-25 2:42

>>1
just to clarify, do you in fact pipe the output of your post.py script into another script which places the input over a picture in the font ``impact´´ (with a black stroke outline of typically 1-5px)?
To clarify on that, does said program feature auto-centre, word wrap and perhaps even adjustment of font sizing depending on the amount of text, as to ensure a good, firm, even coverage?
I wouldn't doubt it, but certainly I'd be impressed.
And remember kids, it's not scope creep, it's FEATURE RICH.

Name: Anonymous 2013-09-25 4:09

>>8
I spent like 2 hours last night fucking around with imagemagick trying to get it to this correctly. Never got it right.

Name: Anonymous 2013-09-25 14:09

It's not TEX quality word wrapping, but it works.

#!/bin/sh
n=20
in_img=in.jpg
out_img=lift.png
str=`perl -e '$i = shift; print "Post the \""x$i . "Do you even lift?" . "\" one"x$i;' $n`
size=`identify $in_img | cut -d" " -f3`
convert $in_img -size $size -background none -gravity center -font Impact -fill white -stroke black -strokewidth 2 caption:"$str" -composite $out_img

Name: facepalm.out 2013-09-25 15:05

  #!/bin/sh
[...]
str=`perl -e [...]

Name: Anonymous 2013-09-25 15:27

>>11
It's IMAGEBOARD QUALITY

Don't change these.
Name: Email:
Entire Thread Thread List