Well, Brexit happened. And Sky News, being the geniuses they are, have decided to create a countdown on the side of a bus.

enter image description here

Your job is to do something similar. The UK leaves the the EU on 31st of March 2019 and you have to create a digital countdown for this that changes every second (with a 0.05 second deviation allowed).

Input

Your program should take absolutely no input. It is banned!

Output

It should output the time until Brexit in the format ddd:hh:mm:ss. Leading and trailing newlines are allowed but the display should stay in the same place each time. It should look as though it is actually decreasing in place. As pointed out by @AnthonyPham this doesn't mean printing enough newlines to "clear" the screen, this means that you must actually clear the screen.

An output like this isn't allowed:

100:20:10:05
100:20:10:04

Neither is this

100:20:10:05
*A thousand newlines*
100:20:10:04

as they're on more than one line.

You don't have to worry about after Brexit. Your program only has to work up to 31/3/2019

Rules

  • Standard loopholes are disallowed
  • This is so shortest code in bytes wins.
  • Error messages (although I can't think how) are disallowed
  • The code should be able to be run in 2 years time (when the UK leaves the EU) and should display the actual time and not start from 730 again (see below)

Countdown rule

The countdown should not be hard-coded and should be able to run at any time before Brexit finishes and still produce the correct result. When a new day is begun the hour should follow the below format

712:00:00:01
712:00:00:00
711:23:59:59

Let me say again, the date Brexit finishes is 31/3/2019 at midnight for convenience (31:3:19 00:00:00 or 31:3:2019 00:00:00 or any other format you want)

NB: I think I have everything but I didn't post this in the Sandbox, otherwise the timing could have been off. Feel free to post any suggestions for improvements because it isn't perfect.

share|improve this question
    
I don't think you should tell people if the should downvote or not :-) Apart from that, you need to clarify what you mean by "Your program should take absolutely no input unless required to run" (or maybe ban input altogether). Also, perhaps replace "we leave..." by "UK leaves...". That "we" may be confusing – Luis Mendo yesterday
    
@LuisMendo Thanks for the tips. I think you can guess why I used "we"... and I added that rule about input as I've come across languages that need input to run/compile the program. – This Guy yesterday
    
Can I run it every millisecond but still give the appearance of updating every second? This is just to make my code shorter. – David Archibald yesterday
    
@DavidArchibald it only says that the display has to change every second. It's just that most answers will find it easier to run every second. – This Guy yesterday
    
ahh. Well I have to put 1000 if I want it to change once a second. Thanks – David Archibald yesterday

17 Answers 17

JavaScript, 134 bytes

document.write`<pre id=o>`
setInterval("d=15539904e5-new Date;o.innerHTML=(d/864e5|0)+':'+new Date(d).toISOString().slice(11,19)",1e3)

share|improve this answer
    
Managed to beat you @Neil... by a few bytes. – David Archibald yesterday
    
Why not use <a id=0>? Or something like that? – Solomon Ucko 18 hours ago
3  
Or even document.body.innerHTML instead of o.innerHTML – cloudfeet 18 hours ago
    
I wanted it to be monospace to ensure that the display stays in the same place, but I guess I could save a byte and use <tt>. – Neil 15 hours ago
    
You could save 2 bytes by running the code every millisecond (or 2, or 3 ...). – Shaggy 1 hour ago

PowerShell, 70 63 55 Bytes

for(){cls;(date 31Mar19)-(date)|% T* "ddd\:hh\:mm\:ss"}

Running this with sleep adds 8 bytes, but the input is mostly invisible if it is run without them, version (63 bytes) with sleep:

for(){cls;(date 31/3/19)-(date)|% T* "ddd\:hh\:mm\:ss";sleep 1}

previous 70 bytes

for(){cls;((date 31/3/19)-(date)).ToString("ddd\:hh\:mm\:ss");sleep 1}

for() is an infinite loop, and within that loop..

cls to clear the screen,

get 31/3/19 as a DateTime object, and - the current date from it, to give the time remaining, then .ToString() (|% T*) that with the correct format.

this will display negative time after brexit.

share|improve this answer
    
This is also sensitive to local date format. Though the UK dd/m/yy format is appropriate, imo, it won't run as-is on US machines. I'm curious how the T* works. I'm not familiar with that. – Joel Coehoorn 12 hours ago
    
@JoelCoehoorn It's a nice trick, the % foreach actually picks up the ToString object, and will accept the next string as its argument. regarding the datetime format why won't it run on US machines? I thought the dd etc were culture-insensitive. – ConnorLSW 12 hours ago
    
It's trying to find month #31 on my machine. Works fine if I change it to 3/31/19. Would also work 2019-03-31 anywhere, but that costs you a few bytes. – Joel Coehoorn 12 hours ago
    
@JoelCoehoorn ah right - sorry I was thinking of the output, Updated to 31Mar19 instead of 31/3/19 which should hopefully fix it? – ConnorLSW 12 hours ago
    
I think I get it for T*. * is a wild card that would match the first function or property starting with T, which happens to be ToString() ? – Joel Coehoorn 12 hours ago

Python 3.6, 146 bytes

from datetime import*
x=datetime
while 1:d=x(2019,3,31)-x.now();s=d.seconds;a=s%3600;print(end=f"\r{d.days:03}:{s//3600:02}:{a//60:02}:{s%60:02}")
share|improve this answer

Excel VBA, 91 84 82 bytes

Saved 7 bytes thanks to JoeMalpass pointing out that Excel sees dates as numbers.
Saved 2 bytes thanks to JoeMalpass

Sub b()
Do
t=CDec(43555-Now)
Cells(1,1)=Int(t) &Format(t,":hh:mm:ss")
Loop
End Sub

Output is to cell A1 in the active Excel sheet.

share|improve this answer
    
-6 bytes by swapping ("2019-3-31") with (43555). When I try running this in Excel however, it freezes after about 5-6 seconds... – JoeMalpass 19 hours ago
1  
@JoeMalpass Thanks, that's a good point. It looks up after a few seconds for me, too, because it's calculating way faster than 1/second. Adding delays, though, adds bytes and the OP doesn't say it has to be able to continuously count down from now until Brexit without setting anything on fire. – Engineer Toast 17 hours ago
    
Apparently Now works without the () too... – JoeMalpass 14 hours ago
    
I'm fine with you setting your computer on fire because of this. Just down sue me if it happens :) – This Guy 12 hours ago

JavaScript ES5, 320 319 316 305 295 284 bytes

setInterval(function(){a=Math,b=a.floor,c=console,d=Date,e="00",f=new d(2019,2,31),g=a.abs(f-new d)/1e3,h=b(g/86400);g-=86400*h;var i=b(g/3600)%24;g-=3600*i;var j=b(g/60)%60;g-=60*j,c.clear(),c.log((e+h).slice(-3)+":"+(e+i).slice(-2)+":"+(e+j).slice(-2)+":"+(e+a.ceil(g)).slice(-2))})

Thanks to @Fels for referencing Math, @dgrcode for referencing console

Un-golfed

setInterval(function() {

  var math = Math, floor = math.floor, c = console, d = Date;

  var leadings = "00";

  // set our brexit date
  var brexit = new d(2019, 2, 31);

  // get total seconds between brexit and now
  var diff = math.abs(brexit - new d()) / 1000;

  // calculate (and subtract) whole days
  var days = floor(diff / 86400);
  diff -= days * 86400;

  // calculate (and subtract) whole hours
  var hours = floor(diff / 3600) % 24;
  diff -= hours * 3600;

  // calculate (and subtract) whole minutes
  var minutes = floor(diff / 60) % 60;
  diff -= minutes * 60;

  // what's left is seconds

  // clear the console (because OP said it must print in the same place)
  c.clear();

  // log the countdown, add the leadings and slice to get the correct leadings 0's
  c.log((leadings + days).slice(-3) + ":" + (leadings + hours).slice(-2) + ":" + (leadings + minutes).slice(-2) + ":" + (leadings + math.ceil(diff)).slice(-2));

});

share|improve this answer
2  
You can save a bit my renaming Math like g=Math; – Fels 21 hours ago
    
It looks like aliasing Math can still save 2 bytes, right? – Marie 17 hours ago
    
You can save a bit more by using arrow functions and getting rid of var. Also, pick shorter names for variables, like h instead of hours, or m instead of minutes. Probably doing c=console will save a couple more bytes. Also 1e3 instead of 1000 – dgrcode 17 hours ago

CJam, 69 62 59 bytes

Saved 3 bytes thanks to Martin Ender

{15539904e5esm1e3/{60md\}2*24md\]W%{sYTe[}%':*CTe[o8cC*o1}g

Can't be run on TIO for obvious reasons.

It rewrites the display constantly in an infinite loop so the text kind of flashes in and out (at least in my console), although it only actually updates the time once per second.

This 72-byte version only prints once per second:

{15539904e5es:Xm1e3/{60md\}2*24md\]W%{sYTe[}%':*CTe[o8cC*o{esXm1e3<}g1}g

Explanation

{                           e# Begin a while loop
  15539904e5                e#  The timestamp on which Brexit will occur
  es                        e#  The current timestamp
  m                         e#  Subtract
  1e3/                      e#  Integer divide by 1000, converting to seconds from ms
  {                         e#  Run this block twice
   60md                     e#   Divmod by 60
   \                        e#   Swap top elements
  }2*                       e#  (end of block) 
                            e#    This block divmods the timestamp by 60, resulting in 
                            e#    the remaining minutes and seconds. Then the minutes get 
                            e#    divmod-ed by 60, to get hours and minutes remaining
  24md\                     e#  Divmod hours remaining by 24 and swap top elements, to get
                            e#    the hours left and days left.
  ]                         e#  Wrap the entire stack in an array
  W%                        e#  Reverse it since it's currently in the wrong order
  {                         e#  Apply this block to each element of the array
   s                        e#   Cast to string (array of digit characters)
   YTe[                     e#   Pad to length 2 by adding 0s to the left
  }%                        e#  (end of map block)
  ':*                       e#  Join with colons
  CTe[                      e#  Pad to length 12 by adding 0s to the left, dealing with the
                            e#    special case of the day being 3 digits. 
  o                         e#  Pop and print the resulting string, which is the time
  8cC*o                     e#  Print 12 backspace characters (ASCII 8)
  1                         e#  Push 1
}g                          e# Pop 1, if it's true, repeat (infinite loop)
share|improve this answer
    
Can't test right now, but you can probably replace Ab with s, and save a byte by doing 1e3/ first and then divide in the opposite order 60md\60md\24md\]W%. – Martin Ender 13 hours ago
    
@MartinEnder Yep, they both work. Thanks – Basic Sunset 12 hours ago
    
Oh and {60md\}2* saves another. – Martin Ender 12 hours ago

C#, 173 172 156 150 127 bytes

using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:d\\:hh\\:mm\\:ss}  ");}}

Saved 16 bytes thanks to @Bob Saved 6 bytes thanks to @Søren D. Ptæus

Formatted version:

using System;

class P
{
    static void Main()
    {
        for (;;)
            Console.Write($"\r{new DateTime(2019, 3, 31) - DateTime.Now:d\\:hh\\:mm\\:ss}  ");
    }
}
share|improve this answer
    
Can you do (TimeSpan)0? On phone, can't test right now. You can still drop the clear as the carriage return takes care of it: it puts the cursor back at the start of the line. – Bob yesterday
2  
Thought: relying on the CR might fail if the length changes (less than 100 days). Fix: add two extra spaces on end. – Bob yesterday
    
@Bob I forgot to remove the Clear! Silly me. And no can't convert int to TimeSpan I'd already tried that one. – TheLethalCoder yesterday
    
You can save 6 bytes writing (t = new DateTime(2019, 3, 31) - DateTime.Now).Ticks > 0. – Søren D. Ptæus 21 hours ago
    
@SørenD.Ptæus Good idea didn't even think of that one – TheLethalCoder 21 hours ago

C#6, 149 bytes

Thanks to Bob for saving 57 bytes!

using System;class P{static void Main(){DateTime a,x=new DateTime(2019,3,31);while((a=DateTime.Now)<x)Console.Write($"\r{x-a:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed program:

using System;

class P
{
    static void Main()
    {
        DateTime a,
                x = new DateTime(2019, 3, 31);
        while ( (a = DateTime.Now) < x)
            Console.Write($"\r{x-a:ddd\\:hh\\:mm\\:ss}");
    }
}

C#, 210 206 159 bytes

Thanks to Bob for saving another 47 bytes!

Thanks to Martin Smith for saving 4 bytes!

using System;class P{static void Main(){DateTime a,x=new DateTime(2019,3,31);while((a=DateTime.Now)<x)Console.Write("\r"+(x-a).ToString(@"ddd\:hh\:mm\:ss"));}}

Ungolfed program:

using System;

class P
{
    static void Main()
    {
        DateTime a,
                x = new DateTime(2019, 3, 31);
        while ( (a = DateTime.Now) < x)
            Console.Write("\r" + (x - a).ToString(@"ddd\:hh\:mm\:ss"));
    }
}
share|improve this answer
1  
new DateTime(2019,3,31) is shorter. – Martin Smith yesterday
1  
You can also remove the Console.Clear and instead prepend "\r" to the string, e.g. "\r"+(x-a)... – Bob yesterday
1  
More improvements: (x-a).ToString(@"d\:hh\:mm\:ss") is equivalent to ` String.Format("\r{0:d\\:hh\\:mm\\:ss}",x-a)` is equivalent to $@"{x-a:d\:hh\:mm\:ss}" (shorter, interpolated string in C# 6.0). If you do that, you can then further shorten the full "\r"+$@"{x-a:d\:hh\:mm\:ss}" into $"\r{x-a:d\\:hh\\:mm\\:ss}". – Bob yesterday
1  
@TheLethalCoder I took that as simply not allowing a "fake" multi-newline approach. A carriage return still overwrites the only thing on the screen. At least one other answer also uses this approach. Also can remove the sleep as it's only important that the display changes once per second, with non-changing updates allowed (see question comments). edit: actually, question comments also explicitly allow the CR... – Bob yesterday
1  
@Bob Sorry I read your suggestion as a new line, my mistake. But yeah the sleep can be removed – TheLethalCoder yesterday

C#, 128 Bytes

using System;class P{static void Main(){for(;;)Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now);}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now));}}
share|improve this answer
    
Welcome to PPCG! – Martin Ender 13 hours ago
    
You can still save a single character by using an interpolated string ;) Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"); – Bob 9 hours ago
    
Well played, I tried to find a way to have a while (true) loop in the shortest possible code! I'll remember that trick. You may need to add a couple of spaces like I did though to your write otherwise when the days goes from 3 digits to 2 digits, it won't overwrite the last character of your time string and you'll get a weird output – SLC 1 hour ago
    
You can save a byte by using an interpolated string like in my answer. Your format of dddpads the zeroes, looks better than the two spaces method nice. – TheLethalCoder 1 hour ago

PHP, 84 bytes

for(;$c=DateTime;)echo(new$c('@1553990400'))->diff(new$c)->format("\r%a:%H:%I:%S ");

Fairly straightforward. 1553990400 is the timestamp for 31-3-2019 00:00:00 in UTC. It loops infinitely, using DateTime->diff()->format() to output how much time is left. After Brexit has happened, it will start counting up from 0.

Commented / more readable version:

// Infinite loop, assign DateTime (as a string) to $class
for (; $class = DateTime;) {
    echo (new $class('@1553990400')) // Create a new DateTime object for the brexit date/time.
            ->diff(new $class) // Caulculate the difference to the current date/time.
            ->format("\r%a:%H:%I:%S "); // Format it according to the specification, starting with a \r character to move to the start of the line and overwrite the previous output.
}
share|improve this answer
    
New here, and about to post my own answer. A few things: 1. Are we allowed to omit the <? tag here? 2. I think your parenthesis are wrong, right now you're calling ->diff on the echo rather than the DateTime object. 3. echo works without parenthesis anyway. 4. Even after fixing this, this doesn't work for me, but I'm new to golfing so that could just be me being an idiot. – Sworrub Wehttam 1 hour ago
1  
Just run it and see, it works fine, as per the requirements. There is no need to flush when running PHP from the command line. There's a \r at the beginning of the string to move the cursor to the start of the line, it keeps overwriting the previously outputted time. It's the same method that many other answers here are using. – chocochaos 38 mins ago
1  
Sorry, I missed your first comment. Yes, we are allowed to omit the opening tags, unless there is a requirement to supply a full program. The parenthesis are just fine the way they are. Yes, echo works without it, but calling diff on the DateTime object does not work without them. It runs fine here, what PHP version are you using and how are you running the program? :) – chocochaos 34 mins ago
1  
You might want to check out some posts here: codegolf.meta.stackexchange.com/questions/tagged/php – chocochaos 20 mins ago
1  
That just about covers it, thanks for the insight :) – Sworrub Wehttam 14 mins ago

JavaScript+HTML, 136+7=143 bytes

setInterval("d=1553990400-new Date/1e3|0;w.innerText=[60,60,24,999].map(z=>(q='00'+d%z,d=d/z|0,q.slice(z<61?-2:-3))).reverse().join`:`")
<a id=w
share|improve this answer
    
Does the score make it a... love byte? – Engineer Toast 15 hours ago

Python 3.5 (118 Bytes)

import datetime as d,os
d=d.datetime
while 1:os.system("cls");e=str(d(2019,3,31)-d.today());print(e[:3]+':'+e[-15:-7])
share|improve this answer

C#, 142 bytes

using System;class P{static void Main(){a:Console.Write($"\r{(new DateTime(2019,3,31)-DateTime.Now).ToString("d\\:h\\:mm\\:ss  ")}");goto a;}}

Ungolfed program:

using System;
class P
{
    static void Main()
    {
        a: Console.Write($"\r{(new DateTime(2019, 3, 31) - DateTime.Now).ToString(@"d\:h\:mm\:ss  ")}"); goto a;
    }
}
share|improve this answer
    
This won't stop printing when it hits brexit, not sure if that's a problem – TheLethalCoder 18 hours ago
    
@TheLethalCoder That's legal. The instructions specifically state the code only has to work until 31/3/2019, and what happens after that doesn't matter. If you can save bytes by having weird output or even exceptions after that date, then more power to you. – Joel Coehoorn 17 hours ago
    
Also: I suspect it will be possible to get this even shorting by skipping the ToString() bytes and instead build the formatting into the Write() method, or maybe an interpolated string – Joel Coehoorn 17 hours ago
    
Okay... it's definitely possible. I have it down to 127 bytes. I'm appending it below your original, so you still get credit for the basic goto idea. – Joel Coehoorn 16 hours ago
    
My edit go wiped :( Guess I'll have to post my own answer. – Joel Coehoorn 13 hours ago

C, 104 bytes

main(x){for(;x=1553990400-time(0);)printf("\n%03d:%02d:%02d:%02d\e[1A",x/86400,x/3600%24,x/60%60,x%60);}

Breakdown

main(x){
    for(;x=1553990400-time(0);)             // Seconds remaining
        printf("\n%03d:%02d:%02d:%02d\e[1A",// Move cursor and print:
            x/86400,                        // Days
            x/3600%24,                      // Hours
            x/60%60,                        // Minutes
            x%60);                          // Seconds
    puts("Now we can stop talking about it forever."); // Wishful thinking
}

Relies on time returning number of seconds since 01/01/1970, which is the case for me (using Clang/GCC on macOS) and should be the case for most UNIX stuff.

Uses bash terminal escape sequences to move the cursor around (<esc>[1A moves the cursor up 1 line). It would be nicer to be able to simply use \r, but printf won't flush until it sees a newline, and flushing it manually takes a lot more.

Probably the most CPU intensive countdown I've ever seen. Runs in a hot loop to make sure it's always as accurate as can be. If run after the deadline, it will produce some pretty weird stuff (negatives everywhere!)

share|improve this answer
    
@TobySpeight sure, corrected. I think of them as bash because I always use this reference page: tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html – Dave 18 hours ago

Ruby (87 bytes)

loop{s= 1553990400-Time.now.to_i;$><<('%02d:'*4+"\b \r")%[s/86400,s/3600%24,s/60%60,s%60]}

Ungolfed

loop do
  seconds = Time.new(2019,3,31).to_i - Time.now.to_i

  print "%02d:%02d:%02d:%02d:\b \r" % [
    seconds / 24 / 60 / 60     ,
    seconds      / 60 / 60 % 24,
    seconds           / 60 % 60,
    seconds                % 60,
  ]
end

Basically one of the Python submissions, with some improvements. We just emit an "\r" to go beginning of the string before re-rendering. And for the string format of "%03d:%02d:%02d:%02d", we really don't care about the width on the first specifier… so we can just do "%02d"*4, and emit a backspace and a space to clear the extra unnecessary colon.

Also, I found a two-character shorter print: $><<. $> is a shorthand global for $defout, which is the output stream for print and printf and defaults to STDOUT. IO#<< writes the right hand side of it to the stream. How is that two characters shorter? Well, I can now omit the space that led before the parenthesis wrapping the format string.

At this point I genuinely think there is no possible way to shorten this program further in Ruby.

Edit: I was wrong. Instead of the first Time.new(2019,3,31), we can just use the raw UNIX time: 1553990400.

Edit 2: I've tried playing around with factoring out minutes, and dividing the UNIX timestamp by that constant, but it doesn't actually wind up saving any bytes. :(

Edit 3: Turns out caching h=3600 actually hurt me by two bytes. Whoops.

share|improve this answer

Bash + GNU date, 128 bytes

2 bytes shaved off thanks to @muru, and 2 off earlier thanks to @This Guy.

C=:%02d;while sleep 1;do D=$[B=3600,A=24*B,1553990400-`date +%s`];printf "%03d$C$C$C\r" $[D/A] $[D%A/B] $[D%A%B/60] $[D%60];done

Ungolfed

DAY=86400
HOUR=3600
while sleep 1 ; do
 DIFF=$[1553990400-`date +%s`]
 printf "%03d:%02d:%02d:%02d\r" \
         $[DIFF/DAY] \
         $[DIFF%DAY/HOUR] \
         $[DIFF%DAY%HOUR/60] \
         $[DIFF%60]
done
share|improve this answer
1  
Never golfed in Bash before but can you remove the spaces at the while: while[1]? – This Guy yesterday
    
Fair point, have now given that a try but it yields line 1: [1]: command not found error. Spaces are mandatory it seems :-( – steve yesterday
2  
Assign 3600 to a variable to save 2 bytes? You might also be able to change B=3600;A=86400 to B=3600;A=24*B for another byte? – This Guy yesterday
    
3600 variable now done, thx. 24*B would need A=$[24*B] so not possible there though – steve yesterday
1  
C=:%02d;printf "%03d$C$C$C\r" to save a byte? And move the assignments to A and B in the arithmetic context: D=$[B=3600,A=24*B,1553990400-`date +%s`] to save another? – muru 23 hours ago

PHP, 102 95 90 bytes

Saved 7 bytes thanks to @TheLethalCoder & by not factoring

Saved another 5 bytes by concatenating

<? $b=1553990400-time();echo floor($b/$d=86400).date(':H:i:s', $b%$d);header('Refresh:1');

This is my first golf, so I'm probably missing quite a few tricks, but here you are regardless.

As for @chocochaos' PHP answer that would otherwise trump this, I believe it is flawed for reasons I have explained in my comments, but as I'm new here I might be wrong. Or I'm just a newbie :)

share|improve this answer
    
You may need a closing tag? (Not sure on that). You only use $a once so might as well use the number in place. I'm not too familiar with php but looks like there could be more improvements – TheLethalCoder 1 hour ago
    
What do you mean by flawed because of reasons stated in the comments? If you mean the comments on their answer, you're the only one who's commented. – This Guy 1 hour ago
    
@TheLethalCoder No closing tag needed. And nice one! – Sworrub Wehttam 1 hour ago
    
@ThisGuy Yes, I mean "as shown in my comments", I'll edit to satisfy your pedantry :) – Sworrub Wehttam 1 hour ago
1  
My answer runs just fine :) Also, you might want to read up on some posts here: codegolf.meta.stackexchange.com/questions/tagged/php There's no need for opening tags either. I would really recommend to write your solution in such a way that it would run from the command line, then you would not have to mess around with headers to refresh. That refresh will also cause your solution to "miss" a second once in a while, because it does not take into account the time lost on the request itself. – chocochaos 14 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.