📜 ⬆️ ⬇️

Java Update Coffee Shop in GTA V

image

The developers of the Grand Theft Auto series have always been famous for two qualities: a kind of humor and attention to detail in their sandbox world. Against the background of news about the establishment of another sales record (this time, the world one), I want to tell you about a pair of amusing finds in the game.

In the city of Los Santos, players discovered a java.update () coffee shop, which combines two popular references - to a programming language and a variety of coffee. The sign of this institution has the following code:

public void sandwich () { bread = 2; bacon = 2; return bread + bacon; } 

A function of type void that returns a value? .. Correct the error:
')
 public int sandwich () { bread = 2; bacon = 2; return bread + bacon; } 

The best option that you can even compile:

 public Sandwich makeSandwich() { Bread bread = new Bread(2); Bacon bacon = new Bacon(2); return new Sandwich(bread, bacon); } 

But hackernews readers do not calm down on this and offer another option :

 class TwoBaconRashersInsideTwoSlicesOfBreadFactory { /* Make a sandwich * <p> * Construct a foodstuff consisting of two slices * of bread with two slices of bacon. * @return TwoBaconRashersInsideTwoSlicesOfBread a sandwich */ Public TwoBaconRashersInsideTwoSlicesOfBread getSandwich () { BaconRasherFactory pig = new BaconRasherFactory(); BaconRasherInstance bacon1 = pig.getBaconRasher(); BaconRasherInstance bacon2 = pig.getBaconRasher(); SliceOfBreadFactory loaf = new SliceOfBreadFactory(); SliceOfBread bread1 = loaf.getSliceOfBread(); SliceOfBread bread2 = loaf.getSliceOfBread(); return new TwoBaconRashersInsideTwoSlicesOfBread(bread1, bacon1, bacon2, bread2); } 

If such a cafe existed in reality, the sudo make me a sandwich would be quite appropriate in it.

This is not the end of the Easter eggs: one of the characters in the game saw a text editor with some source code on the monitor (presumably, the editor is Sublime Text or TextMate with the monokai theme).
screenshot
image

Sources: orcz.com , hackernews

Source: https://habr.com/ru/post/195484/


All Articles