[Question]
  [
# [Loves me, Loves me not](https://en.wikipedia.org/wiki/He_loves_me..._he_loves_me_not)
This simple kids' game is old, but still popular. Since we are living in 21st century now, let's digitize it!
# Specification
Program must take no input, unless you are using a language that can't generate random seed - in that case you are allowed to take the seed as an input. Your task is to write a program that will output randomly a total of 3 to 20 lines inclusive: "Loves me..." and "Loves me not..." in turns, as in the game (and one additional line; keep reading).
However, there are some restrictions. Each line should be followed by newline. The first line must be "Loves me...". The last line (either "Loves me" or "Loves me not") should end with exclamation mark or a single dot, respectively. After the last line, you need to output either a heart( `<3` ) or a broken heart ( `</3` ) in the new line, depending whether "Loves me!" or "Loves me not." was the last sentence.
Trailing whitespace are allowed.
# Example Output
Output:
> 
> Loves me...  
> 
> Loves me not...  
> 
> Loves me...  
> 
> Loves me not...  
> 
> Loves me!  
> 
> <3
> 
> 
> 
Another output:
> 
> Loves me...  
> 
> Loves me not...  
> 
> Loves me...  
> 
> Loves me not.  
> 
> </3
> 
> 
> 
## This is the [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest entry wins!
Also, my first challenge :) Good luck!
  
[Answer]
# Pyth, 54 53 51 50 48 bytes
```
pj+*3\.bm+W~!Z"Loves me"" not"+3O18@".!"Z%hZ"</3
```
[Answer]
# CJam, ~~53~~ ~~50~~ 49 bytes
*Thanks to Dennis for saving 1 byte.*
```
Imr3+{"Loves me"X!:X" not"*'.3*N}*&"!."X=N'<'/X*3
```
[Test it here.](http://cjam.aditsu.net/#code=Imr3%2B%7B%22Loves%20me%22X!%3AX%22%20not%22*'.3*N%7D*%26%22!.%22X%3DN'%3C'%2FX*3)
## Explanation
The code just dumps the string in bits and pieces onto the stack, which is printed automatically at the end of the program:
```
Imr3+         e# Generate a random number in [3,20]
{             e# Execute this block that many times.
  "Loves me"  e#   Push "Loves me", we always need that.
  X!:X        e#   Toggle X (initially 1) between 0 and 1 and leave it on the stack.
  " not"*     e#   Repeat " not" that many times, removing it on every other line.
  '.3*N       e#   Push "..." and a newline.
}*
&             e# Set intersection of "..." and newline, turning them into an empty array.
"!."X=        e# Select "!" or "." based on the last value of X.
N'<           e# Push a newline and "<".
'/X*          e# Include "/" or not depending on the last value of X.
3             e# Push a 3.
```
[Answer]
# Brainfuck, 2766 bytes (currently invalid)
Just because. I'll add an ungolfed version later.
### Code
```
>+<+[>[>[-]+<-]>[<+>>+[->,----------[<+>[>>>>>>>>>+<<<<<<<<<-]>>>>>>>>>[>+<<<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]]<]<-]>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>>>[<<<<<<<<<<+>>>>>>>>>>-]>[<<<<<<<<<<+>>>>>>>>>>-]<<<<<<<<+++++++[<+++++++++++>-]<[<<[>>>>>>>>>>+<<<<<<<+<<<-]>>>[<<<+>>>-]<<[>>>>>>>>>+<<<<<<<+>+<<<-]>>>[<<<+>>>-]<[>>>>>>>>+[<<<<<<<+>+>>>>>>-]<<<<<<[>>>>>>+<<<<<<-]+<[>-<[-]]>[>>>>>+<<<<<-]<<-]<-]++++++[>++++++++<-]>-[<<[>>>>>>>>>+<<<<<<<<+<-]>[<+>-]>-]<<<[-]>[-]+++++[<+++++>-]<[>>>>>>>>>>>+[<<<<<<<<<<+>+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]+<[>-<[-]]>[>>>>>>>>+<<<<<<<<-]<<-]++++++[>>>>>>>>>>+++++++++<<<<<<<<<<-]>>>>>>>>>>[<<+<<<<<<<<+>>>>>>>>>>-]<<<<<<<<<<[>>>>>>>>>>+<<<<<<<<<<-]>>>>>>>[-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>>[-]++++++++++++++++++++<<[<<<+>>>-]>>[<<<<<<<<+>+<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]>>[>>>-<<<[-]]<<<[-]>>>>>>>>[-]<[>+<<<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>>>>>[-]+++<<<[<<<<<+>>>>>-]>>>[<<<<<<<<<<<+>+<<+>>>>>>>>>>>>-]<<<<<<<<<<<<[>>>>>>>>>>>>+<<<<<<<<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]<[>>>>>>>>-<<<<<<<<[-]]>>>[-]>>>[<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>>-<<<<<<<[-]]>>>>>>>>>[<<<<<<<<<+>+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]<[>>>>>>>[-]-<<<<<<<[-]]>>>>>>>[>>>>>>+<<<<<<<<<<<<<<<->>>>>>>>>[-]]<<<<<<<<-]>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>+++++++++++[>+++++++>++++++++++>+++++++++>+++>++++<<<<<-]>-.>+.+++++++.>++.<---.>>-.<<------.>.>>++...[-]<[-]<[-]<[-]<[-]<++++++++++.[-]>>>>>>>[-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>->[-]<[>+<-][-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>>[-]<<[<<<<<<+>>>>>>-]->>[<<<<<<<<-<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>[>>>>>>+<<<<<<[-]]<->>>>>>>[<<<<<<<->>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[>>>>>>>>+<<<<<<<<<<<<<<<<<->>>>>>>>>[-]]<<<<<<<<-]<[>[-]+<-]>[<+>>++++++[>++++++++++<-]>.---------.[-]<<<-<->>-]>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>+++++++++++[>+++++++>++++++++++>+++++++++>+++>++++<<<<<-]>-.>+.+++++++.>++.<---.>>-.<<------.>.>.<<+.+.+++++.>>>++...[-]<[-]<[-]<[-]<[-]<++++++++++.[-]>>>>>>>[-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>->[-]<[>+<-][-]>[<+<<<<<<<+>>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>>[-]<<[<<<<<<+>>>>>>-]->>[<<<<<<<<-<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>[>>>>>>+<<<<<<[-]]<->>>>>>>[<<<<<<<->>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[>>>>>>>+<<<<<<<<<<<<<<<<->>>>>>>>>[-]]<<<<<<<<-]<[>[-]+<-]>[<+>>++++++[>++++++++++<-]>.-------------.++++.<<<<->>-]<<]
```
### Pseudocode
```
loop
    get a random byte
until random byte is >2 and <21
point to byte
[
    output "Loves me..."
    decrease byte by 1
    if byte is 0
        output "<3"
        exit
    eif
    output "Loves me not..."
    decrease byte by 1
]
output "</3"
```
### Sample
When run, the program enters an interactive session waiting for input. Input should be a number. This number is used as a seed.
**Seed: 1 (random number is 5, takes 218,168,042 operations)**
```
1              
Loves me...    
Loves me not...
Loves me...    
Loves me not...
Loves me...    
<3             
```
**Seed: 3 (random number is 20, takes 463,253,048 operations)**
```
3
Loves me...
Loves me not...
(...)
Loves me...
Loves me not...
</3
```
I'd suggest that you do not seed with `6`, as it takes `2,105,900,375` iterations to compute the result :).
### Compiling / Running
You need a fast interpreter for this. No online interpreter I've tested could handle the execution speed. The ips (iterations per second) should be more than `100,000,000`. So I came up with another solution.
This is a Brainfuck to C compiler written in Brainfuck. You can use any online interpreter to transpile my code to pure C. I suggest using [brainfuck.tk](http://brainfuck.tk). Paste my code in the stdin input, past this code in the code input:
```
+++[>+++++<-]>>+<[>>++++>++>+++++>+++++>+>>+<++[++<]>---]>++++.>>>.+++++.>------.<--.+++++++++.>+.+.<<<<---.[>]<<.<<<.-------.>++++.<+++++.+.>-----.>+.<++++.>>++.>-----.<<<-----.+++++.-------.<--.<<<.>>>.<<+.>------.-..--.+++.-----<++.<--[>+<-]>>>>>--.--.<++++.>>-.<<<.>>>--.>.<<<<-----.>----.++++++++.----<+.+++++++++>>--.+.++<<<<.[>]<.>>,[>>+++[<+++++++>-]<[<[-[-<]]>>[>]<-]<[<+++++>-[<+++>-[<-->-[<+++>-[<++++[>[->>]<[>>]<<-]>[<+++>-[<--->-[<++++>-[<+++[>[-[-[-[->>]]]]<[>>]<<-]>[<+>-[<->-[<++>-[<[-]>-]]]]]]]]]]]]]<[-[-[>+<-]>]<[<<<<.>+++.+.+++.-------.>---.++.<.>-.++<<<<.[>]>>>>>>>>>]<[[<]>++.--[>]>>>>>>>>]<[<<++..-->>>>>>]<[<<..>>>>>]<[<<..-.+>>>>]<[<<++..---.+>>>]<[<<<.>>.>>>>>]<[<<<<-----.+++++>.----.+++.+>---.<<<-.[>]>]<[<<<<.-----.>++++.<++.+++>----.>---.<<<.-[>]]<[<<<<<----.>>.<<.+++++.>>>+.++>.>>]<.>]>,]<<<<<.<+.>++++.<----.>>---.<<<-.>>>+.>.>.[<]>++.[>]<.>[.---->.---,....]
```
Download the source and compile it:
```
gcc.exe -c main.c -o main.o
gcc.exe main.o -o loveme.exe
```
You can also run a copy of the C code online here: [via. CodingGround](http://goo.gl/PQ5kBY).
### Optimizations
There is still some work to do, but the cell re-use is almost optimal.
### Remarks
You can use words or phrases as a seed:
```
Programming Puzzles & Code Golf
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
Loves me not...
Loves me...
<3
```
[Answer]
# Javascript (ES6), ~~119~~ ~~104~~ ~~99~~ 98 bytes
```
for(i=new Date%18+3,s=i&1?`!
<3`:`.
</3`;i--;)s=`...
Loves me`+(i&1?' not':'')+s
alert(s.slice(4))
```
[Answer]
# Python, 147
```
from random import*;t=randint(3,20)
print"\n".join("LLoovveess  mmee  n o t"[i%2::2].strip()+"..."*(i<t-1)for i in range(t))+"!.\n\n<<3/ 3"[t%2::2]
```
Uses the `from random import*` instead of `import random` and `randint` instead of `randrange` to save a few bytes. There's probably some bytes left to golf out.
[Answer]
# Javascript (ES6), ~~110~~ 102 bytes
```
a='';for(i=j=new Date%18+3;i--;)a+='Loves me'+(j-i&1?'':' not')+(i?`...
`:j&1?`!
<3`:`.
</3`);alert(a)
```
This was a short but fun little challenge. It may be possible to shorten more. Thanks to Mwr247 for some byte-saving tricks!
Alternate version using `repeat()`, 105 bytes:
```
a='';for(i=j=new Date%18+3;i;)a+='Loves me'+' not'.repeat(j-i--&1)+(i?`...
`:j&1?`!
<3`:`.
</3`);alert(a)
```
Darn JS 5+-char built-in names. Oh well. Suggestions welcome!
[Answer]
# Ruby, 91 bytes
```
(n=3+rand(18)).times{|i|puts"Loves me"+[""," not"][i%2]+(i<n-1?"...":i%2>0?".
</3":"!
<3")}
```
[Answer]
# Common Lisp ~~106~~ 104 bytes
```
(format t"~{Loves me~[ not~]~#[~:*~[.~%</~;!~%<~]3~:;...~]~%~}"(subseq'#1=(1 0 . #1#)0(+ 3(random 18))))
```
This only works on lisps that don't check for a proper sequence (e.g. cmucl, sbcl, clisp) ccl will check for circularity and error out on default safety level. ecl will loop forever.
## Explanation:
`#1=(1 0 . #1#)` generates a circular list containing `1` and `0` and `subseq` is used to make a list of length [3,20] (this is the only non-portable part, as `subseq` is only required by the standard to work on proper (i.e. non-circular) lists).
Our format is now operating on a list of `1 0 1 0...` of length [3,20]
### Explanation of `format` directives:
`~{` iterates over this list
`~[` followed by any number of `~;` and terminated with `~]` will select the Nth item, based on the value of the format argument. This is used here so that the first item in a `~[` will be the "loves me not" case and the second one the "loves me" case. Note that with `~[` a separator of `~:;` selects a default case.
`~#[` works like `~[` except the argument is the number of remaining arguments. 0 remaining arguments means we are at the end, the default case is to print `...`
`~:*` backs up the argument list one position, which allows us to print the correct trailer.
[Answer]
# [Perl 5](https://www.perl.org/) + `-M5.10.0`, 76 bytes
```
print"...
"x!!$_,"Loves me"," not"x$|--for 0..2+rand 18;say$|?"!
<3":".
</3"
```
[Try it online!](https://tio.run/##BcHRCoIwFAbg@z3F9rO73GkmQqTQC9QzhOAEoXbGNsTAZ@/0fSnkdy@S8horiEhhN8a@Gjx4C0V/AhroyBW7PZxbOGtPdDnlKc66vQ5l@trjDqPGDjeQGs8dRH6c6sqxiHv21Hryfw "Perl 5 – Try It Online")
[Answer]
# Julia, 98 bytes
```
r=rand(3:20)
for i=1:r println("Loves me"*(i%2>0?" not":"")*(i<r?"...":i%2>0?".\n</3":"!\n<3"))end
```
Ungolfed:
```
# Define a random number 3 ≤ r ≤ 20
r = rand(3:20)
for i = 1:r
    # The loveless lines occur when i is even
    println("Loves me" *
            (i % 2 > 0 ? " not" : "") *
            (i < r ? "..." : i % 2 > 0 ? ".\n</3" : "!\n<3"))
end
```
[Answer]
# UNIX shell, 193 bytes
```
t=$(seq 2 19|shuf|head -1)
l=t
p=...
while [ $t -ge 0 ];do
case $l:$t in t:0)p=!;h=\<3;;f:0)p=.;h=\</3;;esac
case $l in t)l=f;n=;; f)l=t;n=\ not;;esac
t=$((t-1))
echo Loves me$n$p
done
echo $h
```
[Answer]
# Java, ~~210~~ ~~209~~ ~~203~~ ~~200~~ 177 bytes
* ~~flipped `i%2==0` to `i%2<1`~~
* trimmed `{ ... }` braces for `for`-loop, moved `e` declaration to loop
* re-ordered conditionals
* removed modifiers and unnecessary parentheses, reworked [`Random` usage](https://codegolf.stackexchange.com/a/26026/21697) and increment for `i`
Note: newline is added below for formatting on this site, the count above is for a *single* line.
```
class F{public static void main(String[]a){for(int e=3+(int)(Math.random()*18),i=0;++i<=e;)
System.out.println("Loves me"+(i%2>0?i<e?"...":"!\n<3":" not."+(i<e?"..":"\n</3")));}}
```
Ungolfed:
```
class F {
    public static void main(String[] a) {
        for (int e = 3 + (int) (Math.random() * 18), i = 0; ++i <= e; )
            System.out.println("Loves me" + (i % 2 > 0 ? i < e ? "..." : "!\n<3"
                    : " not." + (i < e ? ".." : "\n</3")));
    }
}
```
[Answer]
# C, 123, 121, 109 106 characters (108 bytes)
(with a little ♥♥♥cheating♥♥♥)
```
O;main(o){for(o=time(O)%18+3;o-O++;printf("Loves me%s%s\n",O&1?"":" not",o-O?"...":O%2?"!\n♥":".\n</3"));}
```
There's also a [broken heart](http://graphemica.com/%F0%9F%92%94) Unicode point at 1f494, but I had difficulties finding a font which implements it.
[Answer]
# Python 2, ~~161~~ ~~159~~ ~~156~~ 144 bytes
```
from random import*;a=randrange(3,21)
for i in range(a):print'Loves me'+i%2*' not'+('...'if i!=a-1 else'.'if i%2 else'!')
print['<3','</3'][i%2]
```
It's 39 bytes just to get the random number.
A big thank you to [muddyfish](https://codegolf.stackexchange.com/users/32686/muddyfish), [fryamtheeggman](https://codegolf.stackexchange.com/users/31625/fryamtheeggman), and [orlp](https://codegolf.stackexchange.com/users/4162/orlp) for their help.
# [PYG](https://gist.github.com/Celeo/b6ba14082ae6677b3c75), 109 bytes
```
a=RR(3,21)
for i in R(a):P('Loves me'+i%2*' not'+('...'if i!=a-1 else'.'if i%2 else'!'))
P(['<3','</3'][i%2])
```
[Answer]
# PowerShell, ~~121~~ ~~119~~ 111 Bytes
```
$i=2..19|Random;1..$i|%{"Loves me$(if(!($_%2)){" not"})..."};"Loves me$(if(!($i%2)){"!`n<"}else{" not.`n</"})3"
```
Edit--actually shorter to explicitly include `"Loves me"` rather than declaring `$l`
Edit2--forgot that I can golf `for()` loops by pipelining...durr...
Not too shabby. Uses inline code execution blocks `$(...)` to dynamically adjust the printed string as we're `for()`-looping. Note that because this uses an implicit `Get-` in front of `Random` to save a couple bytes, this may operate extremely slowly on certain PowerShell versions. [Reference](https://codegolf.stackexchange.com/a/778/42963)
Expanded below for clarification:
```
# Create a collection of (2,3,4,...18,19) and pipe it as input to Get-Random
$i = 2..19 | Get-Random
# Create a collection of (1,2,...$i-1,$i) and pipe it to seed a ForEach-Object loop
1..$i | ForEach-Object {
  if(!($_%2)) {
    # If the input number is even, we're on an even line
    Write-Output "Loves me not..."
  }
  Else {
    # The input number is odd
    Write-Output "Loves me..."
  }
}
If(!($i%2)) {
  # Our random number is odd
  Write-Output "Loves me!"
  Write-Output "<3"
}
Else {
  # Our random number is even
  Write-Output "Loves me not."
  Write-Output "</3"
}
```
[Answer]
# C++, ~~210~~ ~~193~~ ~~184~~ 168 bytes
In C++.. because.. Why not?
:)
```
#include <iostream>
main(){auto&c=std::cout;srand(time(0));int i,j=3+rand()%18;while(i++<j)c<<"Loves me"<<(i%2?"":" not")<<(i==j?"":"...\n");c<<(j%2?"!\n<3":".\n</3");}
```
Live: 
~~[210](https://ideone.com/5n5sbi)~~
~~[193](https://ideone.com/5XwIuN)~~
~~[184](https://ideone.com/p8gZdN)~~
[168](https://ideone.com/WjnH0j)
Just hope that any of my changes are not platform dependent.
Thanks to [Ben Voigt](https://codegolf.stackexchange.com/users/11335/ben-voigt) for the help. Also, thanks to all the comments, they were very helpful.
[Answer]
# Groovy, 110 bytes
A groovy kind of love:
```
int r=Math.random()*18;print((0..r+2).collect{"Loves me"+" not"*(it%2)}.join('...\n')+['!\n<3','.\n</3'][r%2])
```
[Answer]
# Python 2, 117 bytes
```
from random import*
n=randint(3,20)
print"...\n".join("Loves me"+i%2*" not"for i in range(n))+[".\n</3","!\n<3"][n%2]
```
Observe that every `Loves me( not)?` is followed by `...` and a newline, except for the last one. So this looks like a job for `join`.
[Answer]
# R, ~~141~~ ~~132~~ ~~128~~ ~~114~~ ~~111~~ 109 bytes
### Code
```
k=sample(3:23,1);for(i in 1:k)cat("Loves",c("me not...\n","me...\n","me not.\n</3","me!\n<3")[1+i%%2+2*!i<k])
```
### Ungolfed
```
k <- sample(3:23, 1)        # Generates random "k" number from 3 to 23
for(i in 1:k) {             # Loop this block increasing i from 1 until k by 1
  cat                       # Concatenate and paste everything inside this block
  ("Loves",                 # Push "Loves" on every iterations of the loop
      c(                    # Create a vector of strings
        "me not...\n",      # Push string to the index "1" of vector
        "me...\n",          #   to the index "2"
        "me not.\n</3",     #   to the index "3"
        "me!\n<3"           #   to the index "4"
        )[1+i%%2            # Subset the vector by the index (1 or 2)
          +2*!i<k])}        #   if final iteration of loop then index += 2 (3 or 4)
```
I've took some inspiration from [Eric Brooks](https://codegolf.stackexchange.com/users/42322/eric-brooks) code.
Edit 1: Now the code correctly outputs the last punctuation as pointed
 out by [Martin](https://codegolf.stackexchange.com/users/8478)  
Edit 2: Changed the for loop to a sapply and included the hearts
 inside the last line string.  
Edit 3: Removed the `{}` and changed `+(x==k)*2` to `+2*!x<k`  
Edit 4: Back to for loop and removed the `()` from `(i%%2)+1`  
Edit 5: Wrote `me` 4 times and removed the `sep=""`
[Answer]
# R, ~~119~~ ~~111~~ 105 bytes
```
x<-sample(3:20,1);cat(rep(c("Loves me...\n","Loves me not...\n"),x)[1:x]);cat(ifelse(x%%2==1,"<3","</3"))
```
Edits 1,2: Coding the two options explicitly is saving space.
[Answer]
# C 226 bytes
```
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
void main(){srand(time(NULL));int i=rand()%18+3;int j;for(j=0;j<i;j++)printf("Loves me%s%s\n",(j%2)?" not":"",(j==i-1)?(j%2)?".":"!":"...");printf("<%s3\n",(j%2)?"":"/");}
```
(With formatting)
```
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
    srand(time(NULL));
    int i = rand()%18 + 3;
    int j;
    for (j = 0; j < i; j++)
        printf("Loves me%s%s\n", (j % 2) ? " not" : "", (j==i-1) ? (j % 2) ? "." : "!" : "...");
    printf("<%s3\n", (j%2) ? "" : "/");
    return 0;
}
```
[Answer]
# Python 2, 115 bytes
```
from random import*
n=randint(2,20)
print'...\n'.join('Loves me'+i%2*' not'for i in range(n))+'.!\n\n<</33'[n%2::2]
```
[Answer]
# PHP, 191 187 146 165 Bytes
```
$x=rand(5,22);for($i=2;++$i<=$x;){echo"\nLoves me";if($i%2<1)echo" not";if($i<$x)echo"...";if($i==$x&&$i%2<1){echo".\n</3\n";}elseif($i==$x&&$i%2>0){echo"!\n<3\n";}}
```
Ungolfed:
```
$x=rand(5,22);
for($i=2;++$i<=$x;){
    echo "\nLoves me";
    if($i%2<1) echo " not";
    if($i<$x) echo "...";
    if($i==$x && $i%2<1){
        echo ".\n</3\n";
    }
    elseif($i==$x && $i%2>0){
        echo "!\n<3\n";
    }
}
```
48,49 bytes for pyth and cjam ... wow :)
[Answer]
# mSL, 178 176 156 154 bytes
Edit 1: Changed `== 0` to `< 1`  
Edit 2: Removed unnecessary whitespace, thanks AlexA!  
Edit 3: Removed parentheses
```
alias l {
var %n 1
while %n <= $rand(3,20) {
var %m $+(Love me,$iif($calc(%n % 2) < 1,$chr(32) $+ not),...)
echo %m
inc %n
}
echo $iif(n isin %m,</3,<3)
}
```
[Answer]
## Perl, 97 bytes
```
$_='She loves me...
'x(3+rand 18);s/(me.*?)me/$1me not/gs;s/e...
$/e!
<3/;s/t...
$/t.
<\/3/;print
```
Readable version:
```
$_="She loves me...\n"x(3+rand 18);
s/(me.*?)me/$1me not/gs;
s/e...$/e!\n<3/;
s/t...$/t.\n<\/3/;
print
```
[Answer]
# [Hassium](https://github.com/HassiumTeam/Hassium), 265 Bytes
```
func main(){rnd=new Random();times=rnd.next(3,21);println("Loves me...");for(x=0;x<times-1;x++){if(x%2==0)println("Loves me not...");else println("Loves me...");}if((times-1)%2==0){println("Loves me not.");println("</3");}else{println("Loves me!");println("<3");}}
```
The answer has been golfed.
[Answer]
## C# (160)
The code is inspired by [**the answer**](https://codegolf.stackexchange.com/a/58062/15235) from [**h.j.k.**](https://codegolf.stackexchange.com/users/21697/h-j-k), credit goes to him.
```
class P{static void Main(){for(int e=3+new Random().Next(0,18),i=0;++i<=e;)Console.WriteLine("Loves me"+(i%2>0?i<e?"...":"!\n<3":" not."+(i<e?"..":"\n</3")));}}
```
Ungolfed:
```
class P
{
    private static void Main()
    {
        for (int e = 3 + new Random().Next(0, 18), i = 0; ++i <= e;)
            Console.WriteLine("Loves me" + (i % 2 > 0 ? i < e ? "..." : "!\n<3" : " not." + (i < e ? ".." : "\n</3")));
    }
}
```
[Answer]
## Lua, ~~137~~ 132 bytes
Probably can be golfed a lot more, but here it is for now:
```
t=math.random(3,20)for i=1,t do io.write(i%2==0 and"Loves me"or"Loves me not")print(i==t and(i%2==0 and"!\n<3"or".\n</3")or"...")end
```
Code explanation and ungolfed:
```
t=math.random(3,20) --Generates a random number between 1 and 30. We need to assign it to a variable to check if the loop is over later.
for i=1,t do
  io.write(i%2==0 and"Loves me"or"Loves me not") --If i%2 is 0 write without a newline Loves me, if not print Loves me not.
  print(i==t and (i%2==0 and"!\n<3" or ".\n</3") or "...") --If it is not the end of the loop, put ..., else if we ended on an even print ! a newline, and then a heart, but if we ended on an odd put ., a newline and a broken heart :(
end
```
Edit: Chopped off some whitespace.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~85~~ 88 bytes
*+3 bytes thanks Veskah: That's a good point.*
```
0..(1..19|Random)|%{($l='Loves me')+' not'*($n=$_%2)+'...'}
$l+('!
<3',' not.
</3')[!$n]
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/30BPT8NQT8/QsiYoMS8lP1ezRrVaQyXHVt0nvyy1WCE3VV1TW10hL79EXUtDJc9WJV7VCCigp6enXsulkqOtoa7IZWOsrgNWosdlo2@srhmtqJIX@/8/AA "PowerShell – Try It Online")
[Answer]
# [Hassium](https://github.com/HassiumTeam/Hassium), ~~161~~ 165 bytes
I golfed [Reagan's answer](https://codegolf.stackexchange.com/a/58083/25314).
```
func main()println(range(-1,t=new Random().next(3,21)).select(x=>"Loves me"+(x%2==0?" not":"")+(x==t-2?(x%2==0?".":"!"):"...")).join("\n"),"\n",t%2==0?"</3":"<3");
```
Unleashing the power of Hassium.
### Ungolfed version
```
func main()
{
    t = new Random().next(3,21); # initialize the love number
    loveNumber = range(-1, t); # creates an array like this Array { -1 0 1 2 ... ... up to n } where n is a random number between 3 and 21 }
    loves = loveNumber.select(x => # iterates through the array
                                {
                                    ret = "Loves me";
                                    if (x % 2 == 0) # check if x is even
                                    {
                                        ret += " not"; # add ' not' to the result
                                    }
                                    ret += (x == t ? (x % 2 == 0 ? "." : "!") : "...");
                                    return ret;
                                }).join("\n"); # join the result with Unix newlines (\n)
    println(loves); # print it
    println(t%2==0?"</3":"<3");
}
```
]