We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

NEWS

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

News is an esoteric programing language meant to look like a news cast.

Creating a program

Start

You start of a NEWS program by typing the name of the news company followed by a period and two newlines, then the words "Desk Anchor: " (That space at the end in necessary). and the name of the desk anchor in your program, a period newline, the words "Weatherman: ", the name of the weatherman, period, newline, "Live Reporter: ", the name of the reporter who is reporting live at the scene, and a period, and then two newlines. Ex:

Fox News.

Desk Anchor: Jeff.
Weatherman: Bob.
Live Reporter: Billy Bob Joe.


The rest of this article will be assuming that these are the names of the news anchors and channel.

Sections

There are 3 different sections: Desk, Weather, and Scene. All NEWS programs must start and end in a desk section. The starting desk section is introduced like this: (Using the names in the previous example)

Jeff: Hello, and welcome to Fox News! I am your host, Jeff.

The end of the last desk segment is as follows:

Jeff: Anyway, that's it for tonight, my name is Jeff, and see you next time on Fox News.

Desk Section

The desk section is used for flow control and to go to the other sections. To go to the weather segment, you type:

Jeff: And now, to Bob, with the weather.

And for the scene segment:

Jeff: And now, to Billy Bob Joe at the scene.

If this is the second line, then instead you type:

Jeff: But first, to Bob with the weather.

Or:

Jeff: Let's cut to Billy Bob Joe at the scene, who will tell you about the story itself.

For an if block you type this:

Jeff: Our first/second/third/etc. story tonight is about (variable name). There seem(s) (not) to be (value/no) different side(s) to this conflict.
Jeff: Billy Bob Joe?

Billy Bob Joe: Yeah, you pretty much summed it up perfectly, Jeff.

Jeff: Thanks for the confirmation, Billy Bob Joe.
[code block 1]
Jeff: It does seem that there may be more to this conflict, though. Any thoughts, Billy Bob Joe?

Billy Bob Joe: That certainly is and interesting thought, Jeff, but as of right now, that doesn't seem to be the case.

Jeff: Thanks for that wonderful insight, Billy Bob Joe.
[code block 2]
Jeff: Well that was certainly very, very interesting!
Jeff: What do you guys think?

This is the equivalent to (in Python):

in (variable name)=(=/!)(value):
    [code block 1]
else:
    [code block 2]

The ordinal number in the beginning is how many if blocks have been used so far in the program. The part from

Jeff: It does seem that there may be more to this conflict...

to the end of code block 2 may be removed if you don't want there to be an else block.

To create a goto label, you type:

Jeff: There is currently a story unfolding in (label name). It's still in the beginning stages, though, so more on that later.

To jump to said label, you type:

Jeff: Breaking news! We just had a recent development with the story in (label name)! Billy Bob Joe?

Billy Bob Joe: Yeah, some crazy things are certainly happening here!

Jeff: Thanks for the update, Billy Bob Joe.

If you plan to jump to a goto label from before said label, you type for the label initiation:

Jeff: The story that we mentioned earlier in (label name) is simmering down.

And to jump there:

Jeff: Breaking news! We just had a recent development about a story in (label name)! Billy Bob Joe?

Billy Bob Joe: Yeah, some crazy things are certainly happening here!

Jeff: Thanks for the update, Billy Bob Joe.

And if you plan to jump to a goto label from both sides, initiation is:

Jeff: There seems to be a break in the story that's currently happening in (label name), but it doesn't seem like it's the end just yet!

And the goto jump:

Jeff: Breaking news! We just had a recent development with the story in (label name)! Billy Bob Joe?

Billy Bob Joe: Yeah, some crazy things are certainly happening here!

Jeff: Thanks for the update, Billy Bob Joe.

Weather Section

The weather station is where variables are created. To initiate or change the value of a variable, the weather anchor says one of the following:

Bob: We're expecting/Get ready for some hot/mild/cold weather in (variable name) at (value) degrees.
Bob: The forecast for (variable name) is showing an average temperature of (value) degrees.

An exclamation mark can also be used instead of a period. If you want the value of a variable to be an ASCII string, then you type:

Bob: In (variable name) there is an unprecedented new weather phenomenon that was just recently discovered, and shall henceforth be known as a[n] "(value)"!

To add together two variables and set it to a third, you type:

Bob: The forecast for (variable name) is that it's going to be as hot as (variable name) and (variable name) combined!

To multiply a number by negative one, you type:

Bob: Oh, I just got a correction, I was actually completely wrong about the temperature in (variable name). Sorry for that, folks!

To multiply two numbers together, you type:

Bob: The forecast for (variable name) is that it's going to be a lot hot that both (variable name) and (variable name) combined!

To take the reciprocal of a number, you type:

Bob: It seems that the weather trends in (variable name) have taken a weird route...

To take a modulo of two numbers (in the form of v1=v2%v3), you type:

Bob: It seems that the temperature in (variable name) is related to the temperatures in (variable name) and (variable name), but at the moment, we don't know how.

To set a variable to a random integer between two other integers, you type:

Bob: The temperature in (variable name) is gonna be crazy! It could be anywhere from (lower bound) to (upper bound) degrees!

To end the weather section, you type:

Bob: Back to you, Jeff!

Scene Section

The scene section is where I/O is handled. To output a number variable or a string variable as a string you type:

Billy Bob Joe: I am currently in (variable name) watching the story unfold!

To store an input into a variable, you type this for an integer:

Billy Bob Joe: It seems that, in (variable name), this story has affected so many people!

And you type this for a string:

Billy Bob Joe: It seems that, in (variable name), there is a major conflict!

To end the scene section, you type:

Billy Bob Joe: Back to you, Jeff!

Example Programs

Empty Program

Fox News.

Desk Anchor: Jeff.
Weatherman: Bob.
Live Reporter: Billy Bob Joe.


Jeff: Hello, and welcome to Fox News! I am your host, Jeff.
Jeff: Anyway, that's it for tonight, my name is Jeff, and see you next time on Fox News.

The shortest valid program:

F.

Desk Anchor: J.
Weatherman: B.
Live Reporter: i.


J: Hello, and welcome to F! I am your host, J.
J: Anyway, that's it for tonight, my name is J, and see you next time on F.


Hello World

Fox News.

Desk Anchor: Jeff.
Weatherman: Bob.
Live Reporter: Billy Bob Joe.


Jeff: Hello, and welcome to Fox News! I am your host, Jeff.
Jeff: But first, to Bob, with the weather.

Bob: In Cleveland there is an unprecedented new weather phenomenon that was just recently discovered, that shall henceforth be known as a "Hello, World!"!
Bob: Back to you, Jeff!

Jeff: And now, to Billy Bob Joe at the scene.

Billy Bob Joe: I am currently in Cleveland watching the story unfold!
Billy Bob Joe: Back to you, Jeff!

Jeff: Anyway, that's it for tonight, my name is Jeff, and see you next time on Fox News.

Cat

Fox News.

Desk Anchor: Jeff.
Weatherman: Bob.
Live Reporter: Billy Bob Joe.


Jeff: Hello, and welcome to Fox News! I am you host, Jeff.
Jeff: But first, to Bob, with the weather.

Bob: In Cleveland there is an unprecedented new weather phenomenon that was just recently discovered, that shall henceforth be known as a "rain cloud"!
Bob: Back to you, Jeff!

Jeff: And now, to Billy Bob Joe at the scene.

Billy Bob Joe: It seems that, in Cleveland, there is a major conflict!
Billy Bob Joe: I am currently in Cleveland watching the story unfold!
Billy Bob Joe: Back to you, Jeff!

Jeff: Anyway, that's it for tonight, my name is Jeff, and see you next time on Fox News.

Truth Machine

Flibergrinbleshmindninkt Newks fartpoopyfaceððððððð.

Desk Anchor: L'Egfundð.
Weatherman: Meatherwan.
Live Reporter: Peter Griffin.


L'Egfundð: Hello, and welcome to Flibergrinbleshmindninkt Newks fartpoopyfaceððððððð! I am your host, L'Egfundð.
L'Egfundð: But first, to Meatherwan, with the weather.

Meatherwan: We're expecting some mild weather in your mom at 2763 degrees.
Meatherwan: Back to you, L'Egfundð!

L'Egfundð: And now, to Peter Griffin at the scene.

Peter Griffin: It seems that, in your mom, this story has affected so many people!
Peter Griffin: Back to you, L'Egfundð!

L'Egfundð: And now, to Peter Griffin at the scene.

Peter Griffin: I am currently in your mom, watching the story unfold!
Peter Griffin: Back to you, L'Egfundð!

L'Egfundð: Our first story tonight is about your mom. There seems to be no different sides to this conflict.
L'Egfundð: Peter Griffin?

Peter Griffin: Yeah, you pretty much summed it up perfectly, L'Egfundð.

L'Egfundð: Thanks for the confirmation, Peter Griffin.
L'Egfundð: Breaking news! We just had a recent development about a story in v! Peter Griffin?

Peter Griffin: Yeah, some crazy things are certainly happening here!

L'Egfundð: Thanks for the update, Peter Griffin.
L'Egfundð: It does seem that there may be more to this conflict, though. Any thoughts, Peter Griffin?

Peter Griffin: That certainly is and interesting thought, L'Egfundð, but as of right now, that doesn't seem to be the case.

L'Egfundð: Thanks for that wonderful insight, Peter Griffin.
L'Egfundð: There is currently a story unfolding in tu madre. It's still in the beginning stages, though, so more on that later.
L'Egfundð: And now, to Peter Griffin at the scene.

Peter Griffin: I am currently in your mom, watching the story unfold.
Peter Griffin: Back to you, L'Egfundð!

L'Egfundð: Breaking news! We just had a recent development with the story in tu madre! Peter Griffin?

Peter Griffin: Yeah, some crazy things are certainly happening here!

L'Egfundð: Thanks for the update, Peter Griffin.
L'Egfundð: Well that was certainly very, very interesting!
L'Egfundð: What do you guys think?
L'Egfundð: The story that we mentioned earlier in v is simmering down.
L'Egfundð: Anyway, that's if for tonight, my name is L'Egfundð, and see you next time on Flibergrinbleshmindninkt Newks fartpoopyfaceððððððð.