2017

From Esolang
Jump to navigation Jump to search

2017 is a programming language created by Zayne, loosely based off of 2014. It was announced in June 2017 and was made only to be used in the year 2017.

If the year isn't 2017, any 2017 program will error out with the error: To 2017 or Not to 2017? You decided Not to 2017. During 2017, any 2017 program it will output 2017 is da bomb. The language doesn't check system time, it eats up your bandwidth by going to a 2017 server to get the EXACT date and time.

Implementation

JavaScript Interpreter

"use strict";
const server="129.6.15.30"; // Currently a NIST server; change this to the address of the "2017 server" if it exists.
const net=require("net");
let d=Buffer.allocUnsafe(0);
net.connect(37,server).on("data",x=>{
  d=Buffer.concat([d,x]);
  if(d.length>=4) {
    if(new Date((d.readUInt32BE(0)-2208988800)*1000).getFullYear()==2017) {
      console.log("2017 is da bomb");
      process.exit(0);
    } else {
      console.error("To 2017 or Not to 2017? You decided Not to 2017.");
      process.exit(1);
    }
  }
}).on("error",()=>{
  console.error("Error communicating with 2017 server.");
  process.exit(2);
}).on("end",()=>{
  console.error("Failed to receive four bytes of data from server.");
  process.exit(2);
});

See Also