# Print the Oscars Best Picture Winner

This challenge is in tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight!

Your challenge is to print the text

La La Land
pause one second, then change the text to show

La La Land Moonlight
The original text (La La Land) must have a strikethrough. This can be achieved either by clearing the screen, drawing on top of the original text, or by any other clever solutions.

This is a so lowest bytes wins. Standard code-golf rules apply.

• Oh wow! My challenge was so well received it was posted on Twitter Feb 28, 2017 at 2:48
• I wonder if any languages can use the fact the La La La(nd) pattern Feb 28, 2017 at 13:52

# Vim, 37 bytes

3iLa <esc>snd<esc>gs:s/./&<C-v>u336/g
A Moonlight


A fairly straightforward solution.

Here is an animation of it running:

• But there's no sleep :( Feb 27, 2017 at 20:15
• @Cruncher Yes there is! gs sleeps for one second. Feb 27, 2017 at 20:16
• Interesting, how do you typically run this? Because I typed this into vim and it works, but it loses the luster of the second delay (in my slow typing I didn't even notice the delay as I was copying from here) Feb 27, 2017 at 20:17
• Nevermind, I figured it out with macros. Very cool! Feb 27, 2017 at 20:35

# HTML, 153 148 bytes

Using CSS animation. Tested on Firefox and Chrome only.

<s>La La Land</s> <b>Moonlight<style>@keyframes l{0%{text-decoration:none}}@keyframes m{0%{opacity:0}}b,s{animation:m 0s 1s both}s{animation-name:l}

• You can put one of the @keyframes declarations last and remove the two closing curly braces. Mar 2, 2017 at 1:14
• @darrylyeo: Firefox refuses to apply a rule if any of the } is missing, so unfortunately this cannot be done. Mar 2, 2017 at 4:27

# HTML + JavaScript, 18 + 59 = 77 bytes

setTimeout('O.innerHTML="<s>La La Land</s> Moonlight"',1e3)
<p id=O>La La Land

Sadly, there doesn't seem to be an efficient way to reuse O.innerHTML...

• Would setTimeout('a=O.innerHTML;a=a.strike()+" Moonlight"',1e3) work? Feb 27, 2017 at 18:54
• @KritixiLithos I don't think so; modifying a there wouldn't modify O.innerHTML. Feb 27, 2017 at 19:06

# Octave, 81 66 bytes

15 bytes saved thanks to @Stewie

text(0,.5,'La La Land');pause(1);text(0,.5,'---------- Moonlight')


While the demo shows two separate plots, when run in the desktop version of MATLAB, it shows the first plot, waits 1 second, and then adds the second string to the same plot.

Since Octave doesn't have support for strike through text, I have instead opted to display the text within an axes object in a figure and display a "strikethrough" by displaying '--------' on top of the initial text (initial idea by @Stewie). Previously, I had actually plotted a line object to strike through 'La La Land'

• Nice approach... :) You can save 15 bytes like this: text(0,.5,'La La Land');pause(1);text(0,.5,'---------- Moonlight'). Feb 27, 2017 at 21:26
• @StewieGriffin Thanks! Updated Feb 27, 2017 at 21:48
• Does Octave not let you do '-'*8+ in place of the dashes?
– Nic
Feb 28, 2017 at 3:27
• @QPaysTaxes Unfortunately it doesn't. Feb 28, 2017 at 3:29
• Darn. One more question: Why not draw it at (0, 0) or (1, 0)? Seems like either of those would save you a byte (no .)
– Nic
Feb 28, 2017 at 3:31

# Jelly, 31 bytes

“XSøjĠḌ⁻Ça»Œts⁵µṀȮ⁸œS“Æɓ9m“ɓm”ż


Tested with xterm and LANG=en_US. Doesn't work on TIO for several reasons.

### Hexdump

00000000: 58 53 1d 6a c4 ad 8b 0e 61 fb 13 74 73 85 09 c8  XS.j....a..ts...
00000010: ca 88 1e 53 fe 0d 9b 39 6d fe 9b 6d ff f9        ...S...9m..m..


### Background

This answer makes use of control characters and ANSI escape sequences.

• 0d (<CR>) is used to return to the beginning of the liner after printing La La Land.

• 9b 39 6d (<CSI> 9 m) is used to activate strike-through text before printing La La Land for the second time.

• 9b 6d (<CSI> m) is used to reset foreground and background to default mode, thus deactivating strike-through, before printing Moonlight.

### How it works

“XSøjĠḌ⁻Ça»Œts⁵µṀȮ⁸œS“Æɓ9m“ɓm”ż Main link. No arguments.

“XSøjĠḌ⁻Ça»                     Index into Jelly's inbuilt dictionary to yield
"LA LA Land moonlight".
Œt                   Convert to title case, yielding the string
"La La Land Moonlight".
s⁵                 Split into chunks of length 10, yielding
A =: ["La La Land", " Moonlight"].
µ                Begin a new chain with argument A.
Ṁ               Take the maximum, yielding "La La Land".
Ȯ              Output; print "La La Land".
⁸œS           Sleep for bool("La La Land") seconds and yield A.
“Æɓ9m“ɓm”ż Zip ["\r\x9b9m", "\x9bm"] with A, yielding
[["\r\x9b9m","La La Land"],["\x9bm"," Moonlight"]].
(implicit) Flatten and print.


## Bash, 70, 69 66 bytes

-4 pts thanks to Riley

echo La La Land;sleep 1;echo -e "\r\e[9mLa La Land\e[0m Moonlight"

Credits to Sylvain Pineau's answer on AskUbuntu for the strikethrough

• I think you can save a few bytes by using \r in the second echo instead of clear. Also, you don't need the space before the second echo. Feb 27, 2017 at 18:33
• This doesn't print the space after the striked out text. Feb 27, 2017 at 18:40
• Also, I think clear; should go first. And you have an unnecessary space in ; echo. Feb 27, 2017 at 18:42
• Shorter solution that adds the space after the striked text and does in-line modification of the printed text using ANSI code \e[A, so no clear is needed. For more info on that see me. s="La La Land";echo $s;sleep 1;echo -e "\e[A\e[9m$s\e[0m Moonlight" Feb 27, 2017 at 21:02
• Or echo -n La La Land;sleep 1;echo -e "\r\e[9mLa La Land\e[0mMoonlight" Feb 27, 2017 at 21:05

## QBasic, 61 bytes

SCREEN 9
?"La La Land";
SLEEP 1
LINE(0,7)-(80,7)
?" Moonlight


Using graphics mode, draw an actual line through the text. Here's what it looks like in QB64:

The code should be pretty self-explanatory, but here's an ungolfed version:

SCREEN 9             ' One of several graphics modes
PRINT "La La Land";  ' The semicolon suppresses the trailing newline
SLEEP 1
LINE (0,7)-(80,7)
PRINT " Moonlight"


# MATL, 46 bytes

'La La Land'tDlY.ttv45HY(t@Y)' Moonlight'hXxDT


Since MATL doesn't have support for control codes or text formatting, this solution simply alternates between 'La La Land' and '-----------' as fast as possible to simulate strikethrough text.

Explanation

'La La Land'   % Push the string literal to the stack
tD             % Duplicate this string and display
tv             % Stack a version of this string on top of another
45HY(          % Replace the second one with '----------'
% Do...while loop
t            % Duplicate the 2D character array
@Y)          % Grab the row corresponding to the loop index (modular indexing)
' Moonlight' % Push the string literal to the stack
h            % Horizontally concatenate the two
Xx           % Clear the display
D            % Display the string
T            % Push a literal TRUE to the stack to make it an infinite loop

• Creative! I like it Feb 27, 2017 at 20:34
• +1 for creativity, but not sure if it meets the rules. Feb 28, 2017 at 10:13

# Bash + pv, 50 bytes

printf ♪La\ La\ Land›%b 9m\\0 m\ Moonlight|pv -0L1


This builds on @DigitalTrauma's Bash answer.

♪ represents a carriage return (0x0d), › a CSI byte (0x9b).

### Hexdump

0000000: 70 72 69 6e 74 66 20 0d 4c 61 5c 20 4c 61 5c 20  printf .La\ La\
0000010: 4c 61 6e 64 9b 25 62 20 39 6d 5c 5c 30 20 6d 5c  Land.%b 9m\\0 m\
0000020: 20 4d 6f 6f 6e 6c 69 67 68 74 7c 70 76 20 2d 30   Moonlight|pv -0
0000030: 4c 31                                            L1


### How it works

printf repeats its format string as many times as needed to exhaust its other arguments. Since there is one occurrence of %b and two arguments (9m\\0 and m\ Moonlight), it will produce the following byte stream.

\rLa La Land\x9b9m\0\rLa La Land\x9bm Moonlight


This does the following.

• \r brings the cursor to the start of the line.

• La La Land is printed verbatim.

• \x9b9m activates strike-through text.

• \0 sets an end-of-line marker for pv -0.

• \rLa La Land does the same as before.

• \x9bm reset foreground and background to default mode, deactivating strike-through.

• Moonlight is printed verbatim.

Finally, pv -0L1 prints one null-terminated line per second, introducing the desired delay.

• Is it a coincidence that ♪ helped your golfing, or did you specifically want to use it with La La Land? I like it! Feb 28, 2017 at 6:47
• A carriage return is the shortest way to go back to the start of the line. The fact that it is stylized as ♪ sometimes is just a happy coincidence. Mar 1, 2017 at 13:32
• The use of pv instead of sleep like everyone else is beautiful. Mar 2, 2017 at 11:42
• @IQAndreas The idea to use pv is what I took from the linked Bash answer, so I can't really take credit for that. Mar 2, 2017 at 12:38

# HTML + JavaScript, 10 + 63 = 73 bytes

setTimeout("document.write('<s>La La Land</s> Moonlight')",1e3)
La La Land

• In what browser does this work? Feb 28, 2017 at 17:41
• @Titus I think all of them, but I've confirmed it working in Chrome + Firefox so far Feb 28, 2017 at 17:50

# PHP (8675 69 Bytes)

La La Land<?=sleep(1)?:"\rL̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight";


Uses UTF-8 character U+0336 for the strikethrough.

Edit: Saved 17 bytes with the suggestions @Titus commented

• sleep always returns 0; so you can just do sleep(1)?:" ̶L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight" (-3 bytes). \r instead of \033[10D saves 6 bytes and including it in the final string saves another 4. Feb 28, 2017 at 14:13
• Oh, wow, each of those I should've been able to see, I guess it comes with practice. Thanks a lot! if you wanna make your own answer to get the rep, as its 11 bytes of improvement, I can delete my answer and upvote yours :) Feb 28, 2017 at 14:19
• No need to delete a valid answer. I don´t post my own when golfing others´ answers - unless the OP doesn´t react. Here are three more bytes: The leading blank is not required, neither is the strikethrough on the last blank. Using UTF-8 as charset is not cheating; but you could mention "uses UTF-8 character U+0336 for the strikethrough". Feb 28, 2017 at 14:35
• Oh and La La Land<?= instead of <?="La La Land", saves another 3 bytes. Feb 28, 2017 at 14:37

# Pyth - 47 bytes

Does the strikethrough thing now.


K"La La Land".d_1"\033c"+j"\u0336"K" Moonlight

• It doesn't work; you need a " in front for +1. Feb 27, 2017 at 18:34
• @EriktheOutgolfer >_< don't know how that happened. Feb 27, 2017 at 18:35
• What's an <exmpty line>? I would suggest <pre> tags. Feb 28, 2017 at 0:55

## C 87 86 bytes

f(){char*s="La La Land";puts(s);printf("\e[9m%s\e[0m",s);sleep(1);puts(" Moonlight");}


Ungolfed version:

void f()
{
char *s="La La Land";
puts(s);
printf("\e[9m%s\e[0m",s);
sleep(1);
puts(" Moonlight");

}

• You don't need the space between char and *. Feb 28, 2017 at 8:23
• You also need to call f() in the ungolfed version, no? Mar 1, 2017 at 21:25
• @kennytm Thnaks for saving 1 byte.Updated. Mar 2, 2017 at 4:58
• @RodrigoHahn By default a code-golf answer can be a function or program, so no we don't need to call f(). Mar 2, 2017 at 5:36

# HTML + JavaScript, 100 bytes

La La Land<script>setTimeout(function(){document.write("<s>La La Land</s> Moonlight")},1e3)</script>


setTimeout(function(){document.write("<s>La La Land</s> Moonlight")},1e3);
La La Land

• How come document.write overwrites the existing text? Mar 2, 2017 at 13:37
• if your document is fully loaded then you are using document.write(like attaching with a event or with timeout) will delete all existing HTML. refer = w3schools.com/jsref/met_doc_write.asp Mar 8, 2017 at 6:18

## GNU sed + sleep, 63 58 bytes

Edit: saved 5 bytes, based on Digital Trauma's comments

Waiting between two print statements can't be done using sed alone, and as such I call sleep 1. It is possible to do a system call from sed, using the e command, which is a GNU extension.

s:$:La La Land:p esleep 1 s:.:&̶:g s:.*:\c[[A& Moonlight:  To create strike-through text (line 3), a "combining long stroke overlay", U+0336, is appended to each character. After that, I move the cursor up 1 line, effectively replacing the old text when printing something new, using the so called ANSI Escape Sequences. These are interpreted by the terminal as special formatting commands. You can find more information about them here. Explanation: s:$:La La Land:p         # add "La La Land" to pattern space and print it
esleep 1                 # run system command 'sleep 1'
s:.:&̶:g                  # append U+0336 after each character (strike-through)
s:.*:\c[[A& Moonlight:   # '\c[[A' is '(escape)[A', ANSI code to move the cursor
#up 1 line. Then append ' Moonlight' and print on exit.

• @DigitalTrauma Completely forgot about the \c, nice find! As for that special unicode, it's first time I hear about it, but it works indeed. When it is printed by this page, it is combined with the command s separator :, so a bit strange to see that at first. Feb 28, 2017 at 0:30

# Java 7, 207206171 139 bytes

void c()throws Exception{System.out.print("La La Land");Thread.sleep(1000);System.out.print("\rL̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight");}


I'm kinda cheating with this first answer, because I use strike-through unicode.

Explanation:

void c() throws Exception{         // Method (throws is necessary due to Thread.sleep)
System.out.print("La La Land");  //  Show initial text
Thread.sleep(1000);              //  Wait 1 second
System.out.print("\r             //  Move 'cursor' to the start of the line so we can overwrite the current text
L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight");        //  and print new text
}                                  // End of method


# Java 7 (with AWT), 444429 341 bytes

Crossed out 444 is still regular 444 ;(

import java.awt.*;import java.text.*;void m(){new Frame(){public void paint(Graphics g){g.drawString("La La Land",9,50);try{Thread.sleep(1000);}catch(Exception e){}AttributedString s=new AttributedString("La La Land Moonlight");s.addAttribute(java.awt.font.TextAttribute.STRIKETHROUGH,1>0,0,10);g.drawString(s.getIterator(),9,50);}}.show();}


Since Java console doesn't have any markup like strike-through, you'll have to use Java AWT. And well, if you thought Java Console was already verbose, then this is even worse (I know, I know, most of you couldn't even imagined Java 7 being any worse..)

Explanation:

import java.awt.*;                                         // import used for Frame and Graphics
import java.text.*;                                        // Import used for all AttributedStrings
void m(){                                                  // method
new Frame(){                                             //  Frame
public void paint(Graphics g){                         //   Overridden paint method
g.drawString("La La Land", 9, 50);                   //    Show the initial text
try{
Thread.sleep(1000);                                //    Wait 1 second
}catch(Exception e){}                                //    Thread.sleep requires a try-catch..
AttributedString s
= new AttributedString("La La Land Moonlight");  //    Object to add markup to text
java.awt.font.TextAttribute.STRIKETHROUGH,         //    Strike-through attribute
1>0,//true                                         //    Mandatory parameter before we can specify the length
0, 10);                                            //    From length 0 to 10 (length of "La La Land")
g.drawString(s.getIterator(), 9, 50);                //    Show this new text with strike-through part
}                                                      //   End of paint method
}.show();                                                //  Show Frame
}                                                          // End of method


Output gif:

• I think you can remove the space in String[] a and use 1e3 instead of 1000 Feb 28, 2017 at 16:46
• @KritixiLithos That space should indeed have been gone.. probably slipped by during golfing. As for 1e3, that's a double, and Thread.sleep expects a long. 1000 is shorter than (long)1e3. :) Feb 28, 2017 at 19:04
• You mean Swing, not Spring, don't you? I nearly had a heart-attack! Spring in a codegolf... Also, to save bytes, you can use AWT instead of Swing. Mar 1, 2017 at 0:12
• @OlivierGrégoire Ah, typo, I indeed meant Swing.. And thanks, AWT is shorter, no need for Swing (or Spring :P) at all. Mar 1, 2017 at 8:31
• I made the AWT version a (Java 7) function with anonymous inner class. I removed the first AttributedString nonsense and golfed more for a total of 306 bytes. If you go Java 8, it's still 302 bytes. void m(){new Frame(){public void paint(Graphics g){g.drawString("La La Land",99,99);try{Thread.sleep(1000);}catch(Exception e){}AttributedString s=new AttributedString("La La Land Moonlight");s.addAttribute(java.awt.font.TextAttribute.STRIKETHROUGH,1>0,0,10);g.drawString(s.getIterator(),99,99);}}.show();} Mar 2, 2017 at 15:37

# Python 3, 90 bytes

Use Unicode (U+0336) to strike-through, because the macOS terminal doesn't support that \e[9m command.

import time
s='La La Land '
print(s,end='\r')
time.sleep(1)
print('̶'.join(s),'Moonlight')


# Arduino, 332 331 bytes

Not competing, just for the fun.

#include<LiquidCrystal.h>
LiquidCrystal lcd(7,8,9,10,11,12);String a="La La Land";String b="-- -- ----";void setup(){lcd.begin(16,2);}void loop(){lcd.home();lcd.print(a);delay(1000);lcd.clear();lcd.print(b);lcd.setCursor(0,2);lcd.print("Moonlight");while(1){delay(150);lcd.home();lcd.print(a);delay(150);lcd.home();lcd.print(b);}}


Bill of Materials:

• 1 x Arduino Uno
• 1 x LCD 16 x 2
• 1 x 10K Potentiometer
• 1 x 180 ohm Resistor

• Welcome to the site. I don't know how similar Arduino is to C but I am pretty sure you can remove the space in your #include Mar 2, 2017 at 20:49
• By my calculations, the hardware costs 30 bytes (2 for the resistor, 3 for the potentiometer, 1 for its setting, 10 (up for change) for the LCD, and 14 for the wires (1 byte per wire)). However, this is only a suggestion. Also, TIO says the code is only 331 bytes. Is there a trailing newline? Mar 2, 2017 at 21:13
• @WheatWizard that's correct. fixed it! Mar 3, 2017 at 7:10
• Good point @CalculatorFeline, but in that case, we should also count the hardware costs of all the other answers. Possibly my setup is the cheapest one. :D Mar 3, 2017 at 8:58
• ... D8 It's all over D8 Mar 3, 2017 at 16:17

# Python3, 99 bytes

import time
l='La La Land'
s='\u0336'
print(l,end="\r")
time.sleep(1)
print(s.join(l)+' Moonlight')

• If you set l = 'La La Land  couldn't you avoid the +s for -2 chars? . Mar 2, 2017 at 6:47
• @walpen I have to use it twice, that's why I stored it in s Mar 2, 2017 at 8:27

# Bash + pv, 62

l="La La Land"
printf "$l\0\r\e[9m$l\e[0m Moonlight"|pv -0qlL1


# SmileBASIC, 45 bytes

One less byte thanks to 12Me21's magic period trick.

As far as I'm aware SB doesn't have strikethrough characters, so I used GLINE instead. Obviously assumes a clear display, use ACLS if you need to.

?"La La Land
WAIT 60GLINE.,4,79,4?" Moonlight


# AHK, 102 bytes

s=La La Land
Send,%s%
Sleep,1000
Send,^a{Del}
Loop,Parse,s
Send,%A_LoopField%{U+0336}
Send, Moonlight


I cheated a bit to get strikethrough text by using the combining long stroke overlay unicode character. This may create an odd appearance depending on your setup. Notepad gives a good appearance.

AutoHotkey is clearly not the most efficient language for this but it was a fun challenge. Be careful where you run it because it doesn't create it's own display and wipes all the text of whatever window is active.

# Swift, 392 bytes

Swift+UIKit is really not ideal for golfing! Run this in a XCode playground and the result will be shown in the preview pane.

import UIKit
import PlaygroundSupport
let l=UILabel(frame:CGRect(x:0,y:0,width:200,height:20))
l.textColor=UIColor.red
let m="La La Land"
let n=" Moonlight"
l.text=m
let a=NSMutableAttributedString(string:m+n)
l.attributedText=a
}
PlaygroundPage.current.liveView=l


• Is the l.textColor=UIColor.red necessary? Apr 15, 2017 at 8:12
• seems to default to black text on black background otherwise
– Matt
Apr 15, 2017 at 13:23

# Python (137 Bytes)

from turtle import *;import time;write("La La Land");time.sleep(1);clearscreen();write("\u0336".join("La La Land ")+" Moonlight");done()

• You don't need the space after the import. I would also suggest saving "La La Land" as a variable. Feb 28, 2017 at 0:44

# Jelly, 41 bytes

“ñ[“m‘Ọj
“¡ṭḊßȥṡoẋ»¹13Ọ;9Ç¤;;0Ç¤;“"dE»œS1


Doesn't work on online interpreter.

• Why not? Can compatibility be added cheaply? Feb 28, 2017 at 0:54
• @CalculatorFeline No, Dennis must implement control codes for it to work, and it's not his priority currently. Feb 28, 2017 at 11:45
• Can you give a screenshot/animated gif of the output?
– ʰᵈˑ
Feb 28, 2017 at 13:12
• @ʰᵈˑ I might do, although there is no guarantee. In the meantime, you can download the interpreter and test it yourself :) Feb 28, 2017 at 13:25

# TI-BASIC, 57 53 bytes

:" LA
:Text(3,4,Ans+Ans+Ans+"ND
:Pause "",1
:Line(-9,8,-2,8
:Text(3,41,"MOONLIGHT


Note that this uses the TI-84+ CE ability with the newest OS to pause for 1 second. This will return a synthax error on the TI-84+. For testing, you can omit the 1 second pause by removing that line. Also remember to press Zoom, 6 first so that you are on default window settings, otherwise the line command won't work.

# SpecBAS - 58 bytes

1  ?"La La Land ";
2 WAIT 1e3
3 DRAW 0,4;80,0
4  ?"Moonlight"


Each character is 8x8 pixels, so draws a line from 0,4 to the relative position 80,4 (80 added to first coordinate and 0 to second so it stays on same line).

# OIL, 76 bytes

↩︎⎋[9m
La La Land
⎋[0m Moonlight
4
1
10
20
4
14
10
9
20
6
5
4
0
4
1
4
2
89999


Replace the ⎋ with an escape character and ↩︎ with a carriage return. OIL lacks any kind of sleep command, so I emulate it using a loop that counts down from 89999 to 1. It takes about one second on my computer, but it may not on yours.

The first 3 lines are ignored by the interpreter, it then prints (4) the second line (line 1; "La La Land"). The following structure is the loop that decrements the large number at the end until it's equal to 1. In the end, I just print the first 3 lines.

# PHP, not competing (64 bytes)

<?=$s="\rLa La Land",sleep(1)?:wordwrap($s,1,--,1)," Moonlight";


uses UTF-8: -- stands for U+0336 - but I am pretty certain that it does not work standing alone.

If it does not, try ~"1I" or ~I1 instead of -- (+3 or +1 bytes).

No time to store it to a file or figure out how to set my console to UTF-8; so I couldn´t test either of these; but whoever can: please let me know wether this is complete BS or not.

# Powershell, 63 bytes

Works only in PowerShell ISE. Non-competing, since strikethrough is shifted by one char and I can't fix it.

'La La Land',('̶'*10+' Moonlight')|%{sleep 1;Write-Host \$_ -N}
`