Print the Oscars Best Picture Winner

49

5

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.

vikarjramun

Posted 2017-02-27T18:15:24.613

Reputation: 794

Oh wow! My challenge was so well received it was posted on Twitter – vikarjramun – 2017-02-28T02:48:21.173

I wonder if any languages can use the fact the La La La(nd) pattern – 12Me21 – 2017-02-28T13:52:45.593

Answers

13

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..

Verification

screen capture

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.

Dennis

Posted 2017-02-27T18:15:24.613

Reputation: 196 637

26

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:

enter image description here

James

Posted 2017-02-27T18:15:24.613

Reputation: 54 537

But there's no sleep :( – Cruncher – 2017-02-27T20:15:30.917

1@Cruncher Yes there is! gs sleeps for one second. – James – 2017-02-27T20:16:05.840

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) – Cruncher – 2017-02-27T20:17:47.157

Nevermind, I figured it out with macros. Very cool! – Cruncher – 2017-02-27T20:35:32.820

25

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}

<s>La La Land</s> <b>Moonlight</b>

kennytm

Posted 2017-02-27T18:15:24.613

Reputation: 6 847

You can put one of the @keyframes declarations last and remove the two closing curly braces. – darrylyeo – 2017-03-02T01:14:20.777

@darrylyeo: Firefox refuses to apply a rule if any of the } is missing, so unfortunately this cannot be done. – kennytm – 2017-03-02T04:27:47.497

19

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...

ETHproductions

Posted 2017-02-27T18:15:24.613

Reputation: 47 880

Would setTimeout('a=O.innerHTML;a=a.strike()+" Moonlight"',1e3) work? – user41805 – 2017-02-27T18:54:40.607

1@KritixiLithos I don't think so; modifying a there wouldn't modify O.innerHTML. – ETHproductions – 2017-02-27T19:06:55.210

18

Octave, 81 66 bytes

15 bytes saved thanks to @Stewie

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

Online Demo Here.

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'

enter image description here

Suever

Posted 2017-02-27T18:15:24.613

Reputation: 10 257

1Nice approach... :) You can save 15 bytes like this: text(0,.5,'La La Land');pause(1);text(0,.5,'---------- Moonlight'). – Stewie Griffin – 2017-02-27T21:26:46.040

@StewieGriffin Thanks! Updated – Suever – 2017-02-27T21:48:47.327

Does Octave not let you do '-'*8+ in place of the dashes? – Fund Monica's Lawsuit – 2017-02-28T03:27:06.800

@QPaysTaxes Unfortunately it doesn't. – Suever – 2017-02-28T03:29:53.620

1Darn. One more question: Why not draw it at (0, 0) or (1, 0)? Seems like either of those would save you a byte (no .) – Fund Monica's Lawsuit – 2017-02-28T03:31:05.213

@QPaysTaxes This is because the default axes limits are [0, 1] for both x and y and adding text doesn't automatically change them so it's shorter to plot it in the middle of the y axis rather than modifying the axes limits – Suever – 2017-02-28T03:34:41.493

Ah, that makes sense. Thanks! – Fund Monica's Lawsuit – 2017-02-28T03:35:01.597

So close... text(0,.5,k='La La Land');pause(1);text(0,.5,[~k+45,' Moonlight']) is the same length. [~(1:9)+45,' Moonlight'] is longer :( – Stewie Griffin – 2017-03-24T13:29:56.440

10

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

vikarjramun

Posted 2017-02-27T18:15:24.613

Reputation: 794

1I 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. – Riley – 2017-02-27T18:33:00.540

This doesn't print the space after the striked out text. – Loovjo – 2017-02-27T18:40:56.860

Also, I think clear; should go first. And you have an unnecessary space in ; echo. – Erik the Outgolfer – 2017-02-27T18:42:09.720

2

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"

– seshoumara – 2017-02-27T21:02:28.803

1Or echo -n La La Land;sleep 1;echo -e "\r\e[9mLa La Land\e[0mMoonlight" – Digital Trauma – 2017-02-27T21:05:02.643

@DigitalTrauma not as short, but very nice as well. Similar to what Riley was saying. – seshoumara – 2017-02-27T21:09:03.933

@DigitalTrauma why the -n – vikarjramun – 2017-03-01T14:19:28.583

9

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:

Moonlight

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"

DLosc

Posted 2017-02-27T18:15:24.613

Reputation: 21 213

8

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.

enter image description here

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

Suever

Posted 2017-02-27T18:15:24.613

Reputation: 10 257

1Creative! I like it – vikarjramun – 2017-02-27T20:34:19.353

3+1 for creativity, but not sure if it meets the rules. – DBX12 – 2017-02-28T10:13:22.440

5

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

Verification

screen capture

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.

Dennis

Posted 2017-02-27T18:15:24.613

Reputation: 196 637

3Is it a coincidence that helped your golfing, or did you specifically want to use it with La La Land? I like it! – BruceWayne – 2017-02-28T06:47:38.203

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. – Dennis – 2017-03-01T13:32:01.533

The use of pv instead of sleep like everyone else is beautiful. – IQAndreas – 2017-03-02T11:42:33.623

1@IQAndreas The idea to use pv is what I took from the linked Bash answer, so I can't really take credit for that. – Dennis – 2017-03-02T12:38:42.110

3

Pyth - 47 bytes

Does the strikethrough thing now.

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

Maltysen

Posted 2017-02-27T18:15:24.613

Reputation: 25 023

It doesn't work; you need a " in front for +1. – Erik the Outgolfer – 2017-02-27T18:34:25.527

@EriktheOutgolfer >_< don't know how that happened. – Maltysen – 2017-02-27T18:35:56.860

What's an <exmpty line>? I would suggest <pre> tags. – CalculatorFeline – 2017-02-28T00:55:19.140

3

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");

}

Abel Tom

Posted 2017-02-27T18:15:24.613

Reputation: 1 150

2You don't need the space between char and *. – kennytm – 2017-02-28T08:23:08.840

You also need to call f() in the ungolfed version, no? – Rodrigo Hahn – 2017-03-01T21:25:10.777

@kennytm Thnaks for saving 1 byte.Updated. – Abel Tom – 2017-03-02T04:58:45.007

1

@RodrigoHahn By default a code-golf answer can be a function or program, so no we don't need to call f().

– kennytm – 2017-03-02T05:36:39.040

3

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.

gif image

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.

seshoumara

Posted 2017-02-27T18:15:24.613

Reputation: 2 878

1@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. – seshoumara – 2017-02-28T00:30:11.987

3

PHP (86 75 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

madshvero

Posted 2017-02-27T18:15:24.613

Reputation: 131

1sleep 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. – Titus – 2017-02-28T14:13:32.357

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 :) – madshvero – 2017-02-28T14:19:58.520

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".

– Titus – 2017-02-28T14:35:53.300

Oh and La La Land<?= instead of <?="La La Land", saves another 3 bytes. – Titus – 2017-02-28T14:37:23.400

3

Java 7, 207 206 171 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), 444 429 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
      s.addAttribute(
        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:

enter image description here

Kevin Cruijssen

Posted 2017-02-27T18:15:24.613

Reputation: 67 575

I think you can remove the space in String[] a and use 1e3 instead of 1000 – user41805 – 2017-02-28T16:46:06.567

@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. :) – Kevin Cruijssen – 2017-02-28T19:04:27.103

2You 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. – Olivier Grégoire – 2017-03-01T00:12:53.260

@OlivierGrégoire Ah, typo, I indeed meant Swing.. And thanks, AWT is shorter, no need for Swing (or Spring :P) at all. – Kevin Cruijssen – 2017-03-01T08:31:54.580

You can write a function rather than a complete program unless the question specifies otherwise. Imports still count, however. – None – 2017-03-01T19:39:42.173

@Snowman I know. I made the one with AWT first, and that is a program because the class extends Frame. Because of that I decided to also make the 'cheating unicode' Console one a full program as well. It's not like Java is winning anything anyway if I'd make it a function instead of full program. :) But I'm indeed aware of function vs program ruling, and in all my other answers I use functions (unless otherwise specified by the OPs). – Kevin Cruijssen – 2017-03-01T20:05:01.667

@KevinCruijssen I like golfing non-golf languages: the way I look at it, there are really two competitions. Java can certainly compete with C#, for example, and there is value for squeezing as many bytes out of the program as possible. – None – 2017-03-01T20:06:10.680

1I 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();} – Olivier Grégoire – 2017-03-02T15:37:08.497

And... I forgot the imports... import java.awt.*;import java.text.*; +37 bytes for them. Total = 343 bytes. – Olivier Grégoire – 2017-03-02T15:53:15.290

3

HTML + JavaScript, 10 + 63 = 73 bytes

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

nderscore

Posted 2017-02-27T18:15:24.613

Reputation: 4 912

In what browser does this work? – Titus – 2017-02-28T17:41:33.823

2@Titus I think all of them, but I've confirmed it working in Chrome + Firefox so far – nderscore – 2017-02-28T17:50:32.397

3

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

Sourav

Posted 2017-02-27T18:15:24.613

Reputation: 31

How come document.write overwrites the existing text? – vikarjramun – 2017-03-02T13:37:02.613

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 = https://www.w3schools.com/jsref/met_doc_write.asp

– Sourav – 2017-03-08T06:18:36.650

2

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')

L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶  Moonlight

kennytm

Posted 2017-02-27T18:15:24.613

Reputation: 6 847

2

Python3, 99 bytes

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

Miguel

Posted 2017-02-27T18:15:24.613

Reputation: 131

If you set l = 'La La Land couldn't you avoid the +s for -2 chars? . – walpen – 2017-03-02T06:47:08.243

@walpen I have to use it twice, that's why I stored it in s – Miguel – 2017-03-02T08:27:36.187

2

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

L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶  Moonlight

fluxa

Posted 2017-02-27T18:15:24.613

Reputation: 121

1Welcome 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 – Post Rock Garf Hunter – 2017-03-02T20:49:34.557

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? – CalculatorFeline – 2017-03-02T21:13:51.820

@WheatWizard that's correct. fixed it! – fluxa – 2017-03-03T07:10:12.637

1Good 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 – fluxa – 2017-03-03T08:58:30.420

... D8 ___It's all over___ D8 – CalculatorFeline – 2017-03-03T16:17:25.007

1

Bash + pv, 62

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

Digital Trauma

Posted 2017-02-27T18:15:24.613

Reputation: 64 644

1

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

snail_

Posted 2017-02-27T18:15:24.613

Reputation: 1 982

1

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.

The code in action


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.

Engineer Toast

Posted 2017-02-27T18:15:24.613

Reputation: 5 769

1

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
DispatchQueue.main.asyncAfter(deadline:.now()+1){
let a=NSMutableAttributedString(string:m+n)
a.addAttribute("NSStrikethrough",value:1,range:NSRange(location:0,length:10))
l.attributedText=a
}
PlaygroundPage.current.liveView=l

preview

Matt

Posted 2017-02-27T18:15:24.613

Reputation: 289

Is the l.textColor=UIColor.red necessary? – Albert Renshaw – 2017-04-15T08:12:58.570

seems to default to black text on black background otherwise – Matt – 2017-04-15T13:23:54.367

0

Jelly, 41 bytes

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

Doesn't work on online interpreter.

Erik the Outgolfer

Posted 2017-02-27T18:15:24.613

Reputation: 38 134

Why not? Can compatibility be added cheaply? – CalculatorFeline – 2017-02-28T00:54:16.567

@CalculatorFeline No, Dennis must implement control codes for it to work, and it's not his priority currently. – Erik the Outgolfer – 2017-02-28T11:45:05.033

Can you give a screenshot/animated gif of the output? – ʰᵈˑ – 2017-02-28T13:12:28.007

@ʰᵈˑ I might do, although there is no guarantee. In the meantime, you can download the interpreter and test it yourself :) – Erik the Outgolfer – 2017-02-28T13:25:12.460

0

Python (137 Bytes)

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

hubacub

Posted 2017-02-27T18:15:24.613

Reputation: 161

2You don't need the space after the import. I would also suggest saving "La La Land" as a variable. – Post Rock Garf Hunter – 2017-02-28T00:44:15.263

0

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.

Golden Ratio

Posted 2017-02-27T18:15:24.613

Reputation: 143

0

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).

enter image description here

Brian

Posted 2017-02-27T18:15:24.613

Reputation: 1 209

0

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.

L3viathan

Posted 2017-02-27T18:15:24.613

Reputation: 3 151

0

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.

Titus

Posted 2017-02-27T18:15:24.613

Reputation: 13 814

0

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}

L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight

beatcracker

Posted 2017-02-27T18:15:24.613

Reputation: 379

0

Haskell 170 158 153 149 bytes

import System.Posix.Unistd
import System.IO
l="La La Land"
p=putStr
main=p l>>hFlush stdout>>usleep(10^6)>>p(('\b'<$l)++(l>>=(:"\822"))++"moonlight")

Lots of imports required for the flush and the delay. There's probably other golfing techniques I could implement. Works by appending \822 (the strikethrough modifier) to each character in l, then printing this followed by "moonlight".

Wow my first use of <$.

Program man

Posted 2017-02-27T18:15:24.613

Reputation: 531

0

HTML + JS 6 + jQuery, 153 bytes

Longer than this answer due to the script tag but I anyway wanted to do it.

setTimeout('$("*").html`<s>La La Land</s> Moonlight`',1e3)
<script src=http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js></script>La La Land

WORNG ALL

Posted 2017-02-27T18:15:24.613

Reputation: 61