Cute text message... In code?

Discussion in 'Community Discussion' started by anjinha, Jan 20, 2011.

  1. anjinha macrumors 604

    anjinha

    Joined:
    Oct 21, 2006
    Location:
    San Francisco, CA
    #1
    My boyfriend is a programmer. I wanted to send him a cute message/email but in code. That would get me soooooo many brownie points. :D Of course I know pretty close to nothing about programming so... Any help? :p
     
  2. TheOnlyJon macrumors 6502a

    TheOnlyJon

    Joined:
    Jul 25, 2009
    Location:
    Indianapolis
    #3
    Try something sappy and cutesy like:

    Code:
    int main() {
    	while(1) {
    		doesLove(you);
    	}
    }
    
    doesLove(String str) {
    	printf("I love %s!", str);
    }
     
  3. anjinha thread starter macrumors 604

    anjinha

    Joined:
    Oct 21, 2006
    Location:
    San Francisco, CA
    #4
    Hehehe, sounds perfect. :D

    Can you explain it to me though? :eek::p

    EDIT: Also more suggestions are welcome. Valentine's Day is coming up and all. :D
     
  4. yg17 macrumors G5

    yg17

    Joined:
    Aug 1, 2004
    Location:
    St. Louis, MO
    #5
    It would keep printing "I love you" to the screen in an endless loop ;)
     
  5. anjinha thread starter macrumors 604

    anjinha

    Joined:
    Oct 21, 2006
    Location:
    San Francisco, CA
    #6
    Awwww. :eek:
     
  6. TheOnlyJon macrumors 6502a

    TheOnlyJon

    Joined:
    Jul 25, 2009
    Location:
    Indianapolis
    #7
    Bingo ;)
     
  7. NickZac macrumors 68000

    NickZac

    Joined:
    Dec 11, 2010
    #8
    One word, Wingdings
    [​IMG]

    I started sending emails in Wingdings to some of the federal administrators I work with, and they actually (older and not super computer savvy) were able to decode it and respond to me in binary code. I'll tell you one thing. A 5-page report in Times New Roman is no longer 5 pages when it becomes binary code... You send a text in binary code, and your carrier will show up at your house with a flat bed and one of those PODS completely filled with nothing but your monthly bill.
     
  8. gr8whtd0pe macrumors 6502a

    gr8whtd0pe

    Joined:
    Feb 21, 2008
    Location:
    Belle, WV
    #9
    or the iOS alternative to that, EMoji's
     
  9. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #10
    There's always the old unix joke. Not quite code, but still. All valid unix commands.

    Code:
    date ; unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ; umount ; sleep
    Here's a more SMS friendly version of the code above that actually works.

    Code:
    #include<stdio.h>
    main() {while("I") doesLove("you");}
    doesLove(char *str) {printf("I love %s!", str);}
    
    B
     
  10. (marc) macrumors 6502a

    (marc)

    Joined:
    Sep 15, 2010
    Location:
    the woods
    #11
    You (hopefully) know your boyfriend better than I do, so this might not be true for him. But I'm a programmer and I wouldn't want my girlfriend to be nerdy at all. There are enough nerds around at work ;)
     
  11. littleman23408 macrumors 6502

    Joined:
    Jun 18, 2009
    #12
    Where (or which program) do you put that code in to do that loop? Not trying to steal the idea, but I want to try it out. Seems cool.
     
  12. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #13
    Any C compiler will do, Macs ship with Xcode as an optional install on the second disk that came with your Mac.

    Save the modified version I posted (it won't work as originally posted) to a file on your Desktop called love.c.

    Then, open Terminal.app and type
    Code:
    cd ~/Desktop
    make love
    ./love
    
    B
     
  13. littleman23408 macrumors 6502

    Joined:
    Jun 18, 2009
    #14
    Thanks!
     
  14. snberk103 macrumors 603

    Joined:
    Oct 22, 2007
    Location:
    An Island in the Salish Sea
    #15
    Not War


    :D
     
  15. Tomorrow macrumors 604

    Tomorrow

    Joined:
    Mar 2, 2008
    Location:
    Always a day away
    #16
    Perhaps, but one of anjinha's many charms is that she is a geek girl. I'm not so sure she's suggesting this solely because her BF is a coder; I'm sure she enjoys that sort of humor, too.

    I say it's a great idea. Wish I had something cute to contribute, but I'm a different kind of geek. :eek:
     
  16. impulse462 Suspended

    impulse462

    Joined:
    Jun 3, 2009
    #17
    I totally agree.

    Wish i could meet a cool geek girl :|
     
  17. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #18
    We have a great pair of programming forums at MR. Join us if you ever really get the urge to try your hand at programming http://forums.macrumors.com/forumdisplay.php?f=142

    It might actually have been easier in a different programming language like java, python, perl or ruby that wouldn't require a compiler and was pre-installed with OS X.

    B
     
  18. anjinha, Jan 20, 2011
    Last edited: Jan 20, 2011

    anjinha thread starter macrumors 604

    anjinha

    Joined:
    Oct 21, 2006
    Location:
    San Francisco, CA
    #19
    So I used that "I love you" loop. He loved it. Thanks. :)

    Exactly. :) I'm as much a geek as he is, I just don't know any programming (not yet anyway).
     
  19. anjinha thread starter macrumors 604

    anjinha

    Joined:
    Oct 21, 2006
    Location:
    San Francisco, CA
    #21
    ( • )( • )
     
  20. pilotError macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #23
    OK,

    Bad Love Test I found on the Web. Just cut/paste into an HTML file.

    Code:
    
    <!-- TWO STEPS TO INSTALL LOVE TEST:
    
      1.  Copy the coding into the HEAD of your HTML document
      2.  Add the last code into the BODY of your HTML document  -->
    
    <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
    
    <HEAD>
    
    <SCRIPT LANGUAGE="JavaScript">
    
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    function calc() {
    
    first = document.loveform.name1.value.toUpperCase();
    firstlength = document.loveform.name1.value.length;
    second = document.loveform.name2.value.toUpperCase();
    secondlength = document.loveform.name2.value.length;
    var LoveCount=0;
    
    for (Count=0; Count < firstlength; Count++) {
    letter1=first.substring(Count,Count+1);
    if (letter1=='L') LoveCount+=2; 
    if (letter1=='O') LoveCount+=2; 
    if (letter1=='V') LoveCount+=2; 
    if (letter1=='E') LoveCount+=2; 
    if (letter1=='Y') LoveCount+=3; 
    if (letter1=='O') LoveCount+=1; 
    if (letter1=='U') LoveCount+=3;
    }
    
    for (Count=0; Count < secondlength; Count++) {
    letter2=second.substring(Count,Count+1);
    if (letter2=='L') LoveCount+=2;
    if (letter2=='O') LoveCount+=2; 
    if (letter2=='V') LoveCount+=2; 
    if (letter2=='E') LoveCount+=2;
    if (letter2=='Y') LoveCount+=3;
    if (letter2=='O') LoveCount+=1;
    if (letter2=='U') LoveCount+=3; 
    }
    
    amount=0;
    if (LoveCount> 0) amount=  5-((firstlength+secondlength)/2)
    if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2)
    if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2)
    if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2)
    if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2)
    if (LoveCount>10) amount= 50-((firstlength+secondlength)/2)
    if (LoveCount>12) amount= 60-((firstlength+secondlength)/2)
    if (LoveCount>14) amount= 70-((firstlength+secondlength)/2)
    if (LoveCount>16) amount= 80-((firstlength+secondlength)/2)
    if (LoveCount>18) amount= 90-((firstlength+secondlength)/2)
    if (LoveCount>20) amount=100-((firstlength+secondlength)/2)
    if (LoveCount>22) amount=110-((firstlength+secondlength)/2)
    
    if (firstlength==0 || secondlength==0) amount= "Err";
    if (amount < 0) amount= 0;
    if (amount >99) amount=99;
    
    document.loveform.output.value=amount+"%";
    }
    //  End -->
    </script>
    
    <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
    
    <BODY>
    
    <form name=loveform>
    <input value="Bill Clinton" name="name1" type="text" size="20"> + 
    <input value="Monica Lewinsky" name="name2" type="text" size="20"> = 
    <input value="" name="output" type="text" size="6">
    <br>
    <br>
    <input value="Calculate!" name="calculate" type="button" value="calculate" onclick="calc()">
    </form>
    
    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>
    
    <!-- Script Size:  2.65 KB -->
    
     
  21. anjinha thread starter macrumors 604

    anjinha

    Joined:
    Oct 21, 2006
    Location:
    San Francisco, CA

Share This Page