Juliette Published & Destroyed that

From Hackers & Designers
Revision as of 20:32, 11 February 2016 by Hdsb (talk | contribs) (Created page with "=Justin Bieber's Purpose Generator= ==Justin Bieber as a fortune teller==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Justin Bieber's Purpose Generator

Justin Bieber as a fortune teller

                             .                                                 
                        .:dO0000xlc;,.....col::;,..                          
                     .l0KXKXX0kOOOkdkKX0xddoxkKX0NNX0O:                        
                   :OXNXXXXXK0OOOxdxkOKX0oolc:xXO00X0Okkc.                     
               .;dKNNNNX0OO000OOOOxxxxx0XxdxkOlO0dkXkddol.                     
              :NWWWWWNNXXNNNNNKkOk0KXXXKKOkddxlokxd0Kc,,,:'                    
             oWMWWNNNNWWWWWMMWWNOKXXXKK0OkxlddddOOco0x....                   
           .OWWWNXXXXNNNWMMMWWWNKXKK0Oxxddoooodddkddkx;'.....                  
          ,0NNNNXKKXNNWN0KNNXK0kxOkk00OxdooxkO00000Oklllc.....                 
        .KKNWWWWNNXXXKXKkkkxxdo:,,:lodxO0xoc;:codkO00dllOl'...                 
       .kNNXNNWNXNNNNN0xkOKXOdodo:,,lxkxxdxo:'..:xOkKx;dc...                 
     .cONWNNNNWNKXNWXNX0kKWWNKdokOx:....';:c;;ll:,lddodx,;:,..                 
    ,kxKWWWNWWWWXkKNNKXX0xXWWWKxdd0Kx;.....',....lkxc::,,...                 
   .XNNWWWWWWWMWWKx0NXKOKKkONMWOdOkkXXx:,,;,:l:;;,,ddc,,. ...                
   :WWWWWWWWWWWWWW0x0XXXOkKkdkXW00XK0XNKOxdxx::clddolcxd;..   .                
   oWWWWWWWWWWMWWWNK0KKXWXKKxddx0NNNNXXNNNXX0Kkddooodocc'.                     
   .KWWWWWWWWWWWMWWXXX00XWWNXkk0kONWWNNNWNNNXKKOxol;;;'......                  
     l0XNNWWWWWWWWWWNNWK0XNWWNKKNKKNWNNXNNXKKOolc;,.... .....                
        ONNWWWWWWWWWWWWWNKNNWWNNNNKKKKK00Oxdc;'.....'..........                
        cKNNNNWWWWWWWWWWWWWWNNNXK0Okkxdoc;,'......,'...',';l.                
         ,KNXNNNNWWWWWWNNNNXXK0Okxolc;,'...........',,,,;,,:lkl                
          .KXXNNNNNNNNXXXKKK0Okxolc:;,................',:::cld;.,'             
           ,0XNNNNNNXXKKK000Okxdool:;;,.............'c:::'..,00.            
            ;XNNNNXXKKK0OOOOkxddolc:,...............':::'.';:kK'            
             0NNNNNXXK000OOOkkkkxxdoc;;:;,'.............::;'ckOkxK.            
             xWMMMMWWNXK0OOOkkkk0KXNNXXXXK0Okxoc,.......,:c'lOKKk0             
             :XKKXXXXXXXK0OOOkOO0KKK00000Okxdl:;,.......'cl,:dok0,             
             .00KNWWWWNXK0OOOkkxxxxkOKXXNNXKK0xl;'.......:o:oclk'              
              kXNWNXNWWWWWNK0koccldOXN0k00Ox:c:;,'.......:::llo,               
              ;XNNXNNNWWWWWWXO:...';dOOOxdoc;'..........';:cll;                
               0NNXXKXXNWWWWNk;......;ldddl:;'..........,:.';                  
               ;XNNNNNNWWNNNNx:........',;;,,'.........',c                     
                dXNNNNNNNNNNXx;......'',,,........',;c                     
                 kXXNNNNNXXNXd,.....'::;,,,,,'.......,:c                     
                 .OKXXXXXXNNKd,......clc:;;,....;l,                     
                  .OKKXXXXKX0d;......,ccc:;,'......,;c;                      
                   ,0KXXXNXK0kdlodl'.',;::,,'......',;::                       
                    ,0KXXNNNNK00kc'....,,'......',;::                        
                     ;0KKXXNN0dxd;.........;:c;                         
                      ;O00KXXXKOkxddoc:cl:;,',;cl'                          
                       .x0XNNWWNNX0Oxoccc:;,,,,;:l:                            
                         lO00KK00Okdolc::::::;:c:.                             
                          ;O000KKK0Okxdoccc::::.                               
                           .k0KK0Oxolc:;;,;;:.                                 
                             lOOOkkxolcc:c;.                                   
                              .:coooooc;.    

With only answering 3 simple questions you can generate your own Justin Bieber life purpose.

Juliette collected the lyrics of the songs from Justin's last album Purpose. The algorythm picks randomly lines from those songs and generates a new combination. Three recurrent words have been selected and are replaced by the answers of the questions. The text is automatically printed.


The Bieber algorythm

import sys

import random from subprocess import call

set the variable'Italic text var1 = raw_input("Enter your name: ") var2 = raw_input("A verb that defines you: ") var3 = raw_input("One word that inspires you: ")

txt = lines = []

'lyrics file'Bold text f = open("justinbieber.txt", "r") image turned into textItalic text f2 = open("justin.txt", "r")

justin = f2.read() txt += justin

txt += "\n" txt += "JUSTIN BIEBER'S PURPOSE GENERATOR\n" txt += "\n" txt += "\n"

for line in f.readlines():

       lines.append(line.strip())

number of lines between 25 and 42Italic text for i in range(random.randint(25,42)):

       l = random.choice(lines)

replace functionItalic text

       l = l.replace("your",var1+"'s")
       l = l.replace("you",var1)
       l = l.replace("make",var2)
       l = l.replace("I ",var3+" ")
       l = l.replace("I'",var3+"'")
       txt += l +  "\n"

printItalic text output = open("output.txt", "w") output.write(txt) output.close()

basic layout for the pageItalic text call(["lp", "-d", "HP_LaserJet_8150_Series__0030C1CCDDF2_", "-o", "page-left=72", "-o", "cpi=15","-o", "lpi=9", "-o", "page-bottom=36", "-o", "page-top=28", "-o", "page-right=42", "output.txt"])

save the file in a folderBold text output = open("biebs/" + str(int(round(time.time()))) + ".txt", "w") output.write(txt) output.close()