Viết một câu chuyện ngắn chỉ sử dụng mã hợp lệ


20

Những gì tôi muốn thấy là những nỗ lực của bạn trong việc viết một loại "câu chuyện" có ý nghĩa khá dễ đọc, nhưng cũng tạo ra một đoạn mã hợp lệ. Ví dụ: mã BASIC (BBC) này:

LET customer = "sober"
REPEAT
  INPUT "more beer"
UNTIL customer = "drunk"

(dựa trên http://img.rakuten.com/PIC/12184048/0/1/300/12184048.jpg cho ý tưởng)

Quy tắc / hướng dẫn:

  • Mã phải hợp lệ trong ngôn ngữ bạn đã chỉ định - Bất kỳ ai cũng phải có thể chạy mã mà không cần tạo bất kỳ ưa thích nào
  • Có thể sử dụng chuỗi, nhận xét hoặc bất cứ điều gì cho phép thêm văn bản miễn phí vào mã, nhưng tối đa 3 từ trên mỗi chuỗi (và bạn không thể đặt nhiều chuỗi hoặc nhận xét liên tiếp)
  • Mã của bạn không phải dẫn đến bất kỳ đầu ra hợp lý nào khi nó được thực thi. Nó thậm chí có thể là một vòng lặp vô hạn, miễn là mã hợp lệ và nó đại diện cho một cái gì đó hợp lý (*) khi đọc bằng tiếng Anh.
  • Bất kỳ sự xen kẽ nào trong mã của bạn sẽ bị bỏ qua trong câu chuyện.
  • Các biến không cần phải được xác định. Mã bạn thực hiện ở đây chỉ là một mã số mảnh . Bạn sẽ mất 5 điểm khi gọi một biến / từ khóa / nhãn / vv không xác định. Tuy nhiên.
  • cho mỗi từ khóa / tuyên bố / chức năng / vv tích hợp riêng lẻ mà bạn sử dụng, bạn nhận được 15 điểm . Chúng bao gồm forif, nhưng cũng có các chức năng tích hợp như replace(). Các thư viện không được tính là các hàm tích hợp, nhưng bạn có thể sử dụng chúng miễn phí.
  • đối với mỗi chữ cái, số hoặc dấu gạch dưới trong mã của bạn, bạn nhận được 1 điểm .
  • đối với mỗi dòng / khối mã không liên quan ( ) với câu chuyện hoặc sử dụng từ khóa / câu / v.v. không có nghĩa ( ) trong tiếng Anh, bạn mất 20 điểm và các ký tự liên quan sẽ không được tính vào 1 điểm cho mỗi chữ cái / con số. Để giữ công bằng cho các ngôn ngữ cần loại dữ liệu như intkhi xác định biến, loại dữ liệu bị bỏ qua hoàn toàn. Điều này có nghĩa là họ không nhận được 10 điểm vì là một từ khóa, họ sẽ không nhận được điểm cho các nhân vật liên quan, nhưng họ cũng không gây mất điểm.
  • Không được phép tạo ra một thứ tiếng Anh hợp lệ bằng cách chèn một bình luận để "điền vào chỗ trống".
  • Vì đây là một , cứ mỗi câu trả lời cho câu trả lời của bạn, bạn sẽ nhận được 25 điểm .
  • Đảm bảo chỉ định ngôn ngữ mà mã của bạn đang sử dụng và công thức bạn đã sử dụng để đếm số điểm mà câu trả lời của bạn đạt được.
  • Câu trả lời có nhiều điểm nhất, sử dụng hệ thống này ở trên, sẽ thắng.
  • Sử dụng hệ thống này, mã ví dụ trên sẽ nhận được 4*15 + 53*1 = 113điểm ban đầu.

(*) phần phân tích quá mức / đối tượng hóa: để giữ điều này càng khách quan càng tốt, "hợp lý" hoặc "không liên quan" có nghĩa như sau: Nếu đoạn mã sử dụng các từ không phải tiếng Anh, thì nó không hợp lệ (ví dụ, consthoặc intlà không từ tiếng Anh, nhưng foreachhoặc typeoflà 2 từ tiếng Anh sáp nhập, do đó không quan trọng). Ngoài ra, ngay cả khi bạn sử dụng các từ tiếng Anh hợp lệ như printhoặc echo, những từ này sẽ phải phù hợp với câu chuyện với nghĩa gốc của chúng (vì vậy, 'đặt mực lên giấy' và 'âm thanh phản chiếu', chứ không phải 'hiển thị trên màn hình'). Và với 'phù hợp', ý tôi là chủ đề của câu chuyện phải liên quan đến nó.

Tôi hy vọng "từ chối trách nhiệm" cuối cùng này đáp ứng yêu cầu xác định các tiêu chí khách quan.


Có được phép chương trình của tôi tạo ra lỗi thời gian chạy không?
H2CO3

3
@ H2CO3 Cảm giác của tôi là không.
Jwosty

Có một người chiến thắng IOCCC cổ điển và tuyệt vời đã làm điều này: ioccc.org/1990/westley.c
Computronium

Câu trả lời:


36

css (114)

Tôi mới đến sân golf. Không chắc chắn nếu CSS được tính là 'mã'. Nhưng đây là một cú đâm vào nó.

Năm vẫn còn trẻ ...

body {width: 110%}
.pants {overflow: visible}
.newYear {transform: scale(.8)}

Nếu tôi hiểu việc ghi bàn:

  • mỗi từ khóa tích hợp = 4 * 15
  • mỗi chữ cái / số = 1 * 54
  • mỗi dòng không liên quan = 0

    = điểm ban đầu: 114


"Câu chuyện" khi đọc bằng tiếng Anh ở đây là gì?
joeytje50

10
@ joeytje50 Thừa cân => không phù hợp với quần => quyết tâm giảm cân của năm mới
Bob

@Bob Ah Tôi thấy nó bây giờ, chính xác những gì tôi đang tìm kiếm trong câu hỏi này. Nâng cao.
joeytje50

12

Shakespeare!

    The Infamous Hello World Program.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.


                    Act I: Hamlet's insults and flattery.

                    Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:
 You lying stupid fatherless big smelly half-witted coward!
 You are as stupid as the difference between a handsome rich brave
 hero and thyself! Speak your mind!

 You are as brave as the sum of your fat little stuffed misused dusty
 old rotten codpiece and a beautiful fair warm peaceful sunny summer's
 day. You are as healthy as the difference between the sum of the
 sweetest reddest rose and my father and yourself! Speak your mind!

 You are as cowardly as the sum of yourself and the difference
 between a big mighty proud kingdom and a horse. Speak your mind.

 Speak your mind!

[Exit Romeo]

                    Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:
 Thou art as sweet as the sum of the sum of Romeo and his horse and his
 black cat! Speak thy mind!

[Exit Juliet]

                    Scene III: The praising of Ophelia.

[Enter Ophelia]

Hamlet:
 Thou art as lovely as the product of a large rural town and my amazing
 bottomless embroidered purse. Speak thy mind!

 Thou art as loving as the product of the bluest clearest sweetest sky
 and the sum of a squirrel and a white horse. Thou art as beautiful as
 the difference between Juliet and thyself. Speak thy mind!

[Exeunt Ophelia and Hamlet]


                    Act II: Behind Hamlet's back.

                    Scene I: Romeo and Juliet's conversation.

[Enter Romeo and Juliet]

Romeo:
 Speak your mind. You are as worried as the sum of yourself and the
 difference between my small smooth hamster and my nose. Speak your
 mind!

Juliet:
 Speak YOUR mind! You are as bad as Hamlet! You are as small as the
 difference between the square of the difference between my little pony
 and your big hairy hound and the cube of your sorry little
 codpiece. Speak your mind!

[Exit Romeo]

                    Scene II: Juliet and Ophelia's conversation.

[Enter Ophelia]

Juliet:
 Thou art as good as the quotient between Romeo and the sum of a small
 furry animal and a leech. Speak your mind!

Ophelia:
 Thou art as disgusting as the quotient between Romeo and twice the
 difference between a mistletoe and an oozing infected blister! Speak
 your mind!

[Exeunt]

Nguồn (Tôi không biết làm thế nào để viết Shakespeare. Hoặc đọc nó cho vấn đề đó) . Tôi cũng rất bối rối về cách ghi điểm. Ngoài ra, tôi ngạc nhiên không ai đăng tải Char Lotte và Char Lie cổ điển


Trong ngôn ngữ lập trình này sẽ là gì? Xem các ví dụ trong OP và các câu trả lời khác, để xem cách ghi điểm. Đây không phải là một cuộc thi "dán một câu chuyện bạn thích", mà là một cuộc thi mà bạn tích hợp một "câu chuyện" vào các ngôn ngữ lập trình. Một ví dụ hay là ví dụ CSS của DA. @ codegolf.stackexchange.com/a/19289/14903
joeytje50

15
Đây là ngôn ngữ lập trình Shakespeare , một ngôn ngữ được xây dựng dành riêng cho mục đích viết các chương trình là những câu chuyện
Scrblnrd3

Đẹp tìm thấy. Tôi đặc biệt thực sự thích câu chuyện charlotte & charlie đó. Chúng không thực sự nguyên bản, vì tất cả đều là bản sao dán từ một nơi khác. Dù sao bạn cũng ủng hộ, vì họ vẫn tốt.
joeytje50

8
Tôi thực sự mong mọi người sẽ ngừng đăng Shakespeare Hello World như một câu trả lời và có lẽ tự viết một cái gì đó trong Shakespeare. 7 phiếu bầu cho đạo văn ... đáng thương.
Jonathan Van Matre

5
Đăng câu trả lời mà bạn không tự viết, nhưng chỉ được sao chép từ nơi khác, thường không được coi là chấp nhận được trên trang web này .
Ilmari Karonen

12

Bài thơ tình SQL

SELECT * FROM Night_Sky
WHERE Beauty LIKE "yours"

Trả về 0 kết quả

Tôi không chắc chắn về các quy tắc ở đây, vì đầu ra của tôi rõ ràng rất quan trọng đối với câu chuyện, nhưng không phải là một phần của mã. Vì vậy, tôi bỏ qua nó khi có liên quan đến việc ghi bàn. Tôi cũng đang đếm "*" (ngôi sao) cho một điểm, mặc dù nó không phải là chữ và số, vì nó rất quan trọng đối với câu chuyện.

Vì vậy, điểm của tôi là (4 * 15) + (40 * 1) = 100 Có khả năng trừ 10 cho hai biến không xác định, nhưng điều đó phụ thuộc vào cơ sở dữ liệu hiện tại của bạn.


2
Tài giỏi. Tôi thích nó. Nó giống như một dòng bán tải SQL. :)
mbomb007

8

Câu chuyện cuộc đời của Johnny

kid=spawnKidFromParents(mother, father)
kid.live()
recycle()

def spawnKidFromParents(mother, father):
    kid=father.censor(mother)
    kid.name=Names.babyNames.orderBy("popularity").pop()
    return kid

lớp người (chỉ chọn phương thức)

def live(self):
    try:
        while(self.health > 0):
            self.wakeUp()
            self.work()
            self.eat()
            self.sleep()
    except LossOfLifeException:
        self.closeEyes()

def wakeUp(self):
    while ( (self.laziness + self.calendar.today.importance * (1 - self.fatigue)) < random.randint(0,100)):
        pass

    self.openEyes()
    self.stand()
    self.dress()

def work(self):
    for money in range(self.wallet.EMPTY, self.wallet.MAX_CAPACITY):
        type()


def eat(self):
    while(self.hunger < self.FOOD_CAPACITY * 0.8 - self.diet):
        popcorn.pop()

def sleep(self):
    self.undress()
    self.layDown()
    self.closeEyes()
    pass

1
. . . "Tái chế ()"?
imallett

Không nên ngủ làm giảm mệt mỏi của bạn, và làm việc tăng nó?
tự hào ngày 02

Đâu là phân? (Ý tôi là, hàm poop ()) Bởi vì con người không thể chỉ ăn và không tạo ra một phân. Và trong mã này, tôi chỉ thấy pop ()
Sange Borsch

6

GW-BASIC: 1 * -5 + 7 * 15 + 76 * 1 = 176 điểm

LET criminal = "free"
FOR day = 1 to 100
    PRINT "evaluation"
NEXT day
IF criminal = "bad"
THEN
GOTO JAIL

Trừ 5 điểm cho nhãn không xác định JAIL.


1
Tôi nghĩ rằng đây là QBasic hoặc QuickBasic. Như tôi nhớ trong GW-BASIC, các dòng phải được đánh số.
Victor Stafusa

1
Thêm nhãn cho JAILtrên cùng một dòng với GOTO. Điều này có thể đại diện cho một bản án chung thân mà không có cơ hội tạm tha.
mbomb007

6

Perl 3

Không phải công việc của tôi , nhưng tôi rất buồn vì chưa có ai nhắc đến perl đen ở đây ...

BEFOREHAND: close door, each window & exit; wait until time.
    open spellbook, study, read (scan, select, tell us);
write it, print the hex while each watches,
    reverse its length, write again;
    kill spiders, pop them, chop, split, kill them.
        unlink arms, shift, wait & listen (listening, wait),
sort the flock (then, warn the "goats" & kill the "sheep");
    kill them, dump qualms, shift moralities,
    values aside, each one;
        die sheep! die to reverse the system
        you accept (reject, respect);
next step,
    kill the next sacrifice, each sacrifice,
    wait, redo ritual until "all the spirits are pleased";
    do it ("as they say").
do it(*everyone***must***participate***in***forbidden**s*e*x*).
return last victim; package body;
    exit crypt (time, times & "half a time") & close it,
    select (quickly) & warn your next victim;
AFTERWARDS: tell nobody.
    wait, wait until time;
    wait until next year, next decade;
        sleep, sleep, die yourself,
        die at last
# Larry Wall

Viên ngọc này từng là mã hợp lệ trên Perl 3. Wikipedia cho biết có một số cập nhật cho perl 5, nhưng đó thực sự không phải là vấn đề, phải không?


Điều này phải là cuối cùng, chắc chắn, và chắc chắn thuộc về đây. Nhưng tôi không nghĩ rằng bạn có thể giành chiến thắng với công việc của người khác, thậm chí là do?
GreenAsJade

1
Đồng ý-- trên cả hai tính. Có vẻ như không đúng khi rời khỏi bộ sưu tập này ... Không mong đợi bất kỳ giải thưởng nào (cũng không phải là bài đăng này có nguy cơ, rõ ràng. :-)
alexis

1
IMHO, điều này chỉ thổi bay tất cả những nỗ lực khác và trả lại câu hỏi: D
GreenAsJade 18/03/2016

4

Javascript:

2 * 'households, both alike' in (dignity={})
'In fair Verona', where = we = lay = our = scene ={}
Where = civil= 'blood',  makes= civil ||hands ||unclean
From= forth = the =fatal =loins =of = 'these two foes';
A = pair=2; of["star-cross'd lovers"]; take = 2 || their || life

Nếu bạn có thể làm điều này mà không có '||', tôi sẽ nâng cấp. Các câu lệnh logic Imho khó có thể bỏ qua khi diễn giải trực tiếp. Tôi hiểu rằng câu trả lời này rất phù hợp với tinh thần của câu hỏi, tôi
tình cờ

1
Ngoài ra, hãy tính điểm.
md_rasler

4

Con trăn - 15 * 28 + 1 * 905 == 1325

Once="upon a time"
there=was="a";print"ce";he=wanted=to_marry=a=princess="but"
he="tried almost";all_princesses=but=they=were=not"real"and"";the="";print"ce"+wanted+a+'real';print"cess"
for princesss in`all_princesses`:
    the=princesss is not(`the`+`1`)

now=the;print"ce" is "sad"
he=was+"worried"+he+"would"+`not""`;ever=find=a;print"cess"
1=="evening"+a+"terrible storm occurred"
suddenly=a+princess+"appeared"+`but`+was+"soaked to"+`the`+"bone"
but=she=said=she=was=a=real=princess
`the`+"old queen";thought=we=will=soon=find=out;
but=she+said+"nothing"+but+"went to"+`the`+"bedroom where"+`the`+princess+"would sleep"and"put"+a+"pea beneath"+`20`+"mattresses";
the="";print"cess";having=slept=on=it=all=night=","+was+"asked how"+she+"slept";
while she in{"response","answered."}:
    print"ce,"+"my eyes"+were+"open"+all+night and "I"+was+"lying on"+a+"gigantic bowling ball.";

I=am="black"and"blue"+all+"over";"it" is "horrible"
this="confirmed"+she+was+a+real+princess
None==but+a+princess is "so sensitive"
print"ce" and she+"married"
for now in "good fortune"+he+"found"+a+real+princess:
    print"ce"and the+princess+"lived happily"+ever+"after"

Biểu hiện của tôi về The printcess [sic] and the pea

Đáng buồn thay, có một lỗi cú pháp trên dòng này: I=am="black"and"blue"+all+"over";"it" is "horrible"và tôi dường như không thể tìm ra nó.


2
alllà một từ khóa python và không có cách xác định để thêm hàm / phương thức vào chuỗi. Bạn có thể làm cho nó hoạt động bằng cách thay đổi allthành một chuỗi: I = am = "đen" và "xanh" + "tất cả" + "hơn"; "nó" là "khủng khiếp"
user1547129

3

Ruby, A RẤT (44124 - 20 * 4 + 15 * 1 = 44504 ​​điểm ??)

"Truyện ngắn? Hà. Quá dài đến nỗi quá dài cho câu trả lời Stack Exchange! Tôi đã phải xóa khoảng một nửa số đó vì giới hạn ký tự tối đa :(

Mã đầy đủ có thể được tìm thấy ở đây . Nó không xuất ra bất cứ thứ gì. (Trước đây, vì một số lý do, tôi đã gặp sự cố với tràn ngăn xếp, vì vậy tôi phải bọc nó lại begin ... rescue SystemStackError.)

Cảm ơn, http://longestjokeintheworld.com !

def method_missing*a;end
class Module;def const_missing*a;end;end
(Kernel.methods+methods-[:eval,:object_id,:__send__]).each{|m|eval"def #{m}*a;end"}

begin talking using an interesting voice please to enhance the story
So theres a man crawling through the desert
Hed decided to try his SUV in_ a little bit of crosscountry travel had great fun zooming over the badlands and_ through the sand got lost hit a big rock and_ then_ he couldnt get it started again
There were no cell phone towers anywhere near so his cell phone was useless
He had no family his parents had died a few years before in_ an auto accident and_ his few friends had no idea he was out here
He stayed with the car for_ a day or_ so but his one bottle of water ran out
and_ he was getting thirsty
He thought maybe he knew the direction back now that hed paid attention to the sun and_ thought hed figured out which way was north so he decided to start walking
He figured he only had to go about some miles or_ so and_ hed be back to the small town hed gotten gas in_ last
He thinks about walking at night to avoid the heat and_ sun but based upon
how dark it actually was the night before and_ given that he has no flashlight hes afraid that hell break_ a leg or_ step on a rattlesnake
So
he puts on some sun block puts the rest in_ his pocket for_ reapplication
later brings an umbrella hed had in_ the back of the SUV with him to give
him a little shade pours the windshield wiper fluid into his water bottle
in_ case_ he gets that desperate brings his pocket knife in_ case_ he finds a cactus that looks like it might have water in_ it and_ heads out in_ the
direction he thinks is right
He walks for_ the entire day
By the end_ of the day hes really thirsty
Hes
been sweating all day and_ his lips are starting to crack
Hes reapplied the sunblock twice and_ tried to stay under the umbrella but he still feels sunburned
The windshield wiper fluid sloshing in_ the bottle in_ his pocket is really getting tempting now
He knows that its mainly water and_ some ethanol and_ coloring but he also knows that they add some kind of poison to it to keep people from drinking it
He wonders what the poison is and_
whether the poison would be worse than dying of thirst
He pushes on trying to get to that small town before dark
By the end_ of the day he starts getting worried
He figures hes been walking at least some miles an hour according to his watch for_ over some hours
That means that if_ his estimate was right that he should be close to the
town
But he doesnt recognize any of this
He had to cross a dry creek bed a mile or_ two back and_ he doesnt remember coming through it in_ the SUV
He figures that maybe he got his direction off just a little and_ that the dry creek bed was just off to one side of his path
He tells himself that hes close and_ that after dark hell start seeing the town lights over one of these hills and_ thatll be all he needs
As it gets dim enough that he starts stumbling over small rocks and_ things
he finds a spot and_ sits down to wait for_ full dark and_ the town lights
Full dark comes before he knows it
He must have dozed off
He stands back
up and_ turns all the way around
He sees nothing but stars
He wakes up the next_ morning feeling absolutely lousy
His eyes are gummy and_ his mouth and_ nose feel like theyre full of sand
He so thirsty that he cant even swallow
He barely got any sleep because it was so cold
Hed forgotten how cold it got at night in_ the desert and_ hadnt noticed it the night before because hed been in_ his car
He knows the Rule of Threes  three minutes without air three days without water three weeks without food  then_ you die
Some people can make it a little longer in_ the best situations
But the desert heat and_ having to walk and_ sweat isnt the best situation to be without water
He figures unless_ he finds water this is his last day
He rinses his mouth out with a little of the windshield wiper fluid
He waits a while_ after spitting that little bit out to see if_ his mouth goes numb or_ he feels dizzy or_ something
Has his mouth gone numb
Is it just in_
his mind
Hes not_ sure
Hell go a little farther and_ if_ he still doesnt
find water hell try drinking some of the fluid
Then he has to face his next_ harder question  which way does he go from here
Does he keep walking the same way he was yesterday assuming that he still knows which way that is or_ does he try a new direction
He has no idea what to do_
Looking at the hills and_ dunes around him he thinks he knows the direction he was heading before
Just going by a feeling he points himself somewhat to the left of that and_ starts walking
As he walks the day starts heating up
The desert too cold just a couple of hours before soon becomes an oven again
He sweats a little at first and_ then_ stops
He starts getting worried at that  when_ you stop sweating he knows that means youre in_ trouble  usually right before heat stroke
He decides that its time to try the windshield wiper fluid
He cant wait
any longer  if_ he passes out hes dead
He stops in_ the shade of a large
rock takes the bottle out opens it and_ takes a mouthful
He slowly
swallows it making it last as long as he can
It feels so good in_ his dry
and_ cracked throat that he doesnt even care about the nasty taste
He takes
another mouthful and_ makes it last too
Slowly he drinks half the bottle
He figures that since hes drinking it he might as well drink enough to
make some difference and_ keep himself from passing out
Hes quit worrying about the denaturing of the wiper fluid
If it kills him
it kills him  if_ he didnt drink it hed die anyway
Besides hes pretty
sure that whatever substance they denature the fluid with is just designed to make you sick  their way of keeping winos from buying cheap wiper fluid for_ the ethanol content
He can handle throwing up if_ it comes to that
He walks
He walks in_ the hot dry windless desert
Sand rocks hills
dunes the occasional scrawny cactus or_ dried bush
No sign of water
Sometimes hell see a little movement to one side or_ the other but whatever moved is usually gone before he can focus his eyes on it
Probably birds lizards or_ mice
Maybe snakes though they usually move more at night
Hes careful to stay away from the movements
After a while_ he begins to stagger
Hes not_ sure if_ its fatigue heat
stroke finally catching him or_ maybe he was wrong and_ the denaturing of the wiper fluid was worse than he thought
He tries to steady himself and_ keep going
After more walking he comes to a large stretch of sand
This is good
He
knows he passed over a stretch of sand in_ the SUV  he remembers doing
donuts in_ it
Or at least he thinks he remembers it  hes getting woozy
enough and_ tired enough that hes not_ sure what he remembers any more or_ if_
hes hallucinating
But he thinks he remembers it
So he heads off into it
trying to get to the other side hoping that it gets him closer to the town
He was heading for_ a town wasnt he
He thinks he was
He isnt sure any more
Hes not_ even sure how long hes been walking any more
Is it still morning
Or has it moved into afternoon and_ the sun is going down again
It must be afternoon  it seems like its been too long since he started out
He walks through the sand
After a while_ he comes to a big dune in_ the sand
This is bad
He doesnt
remember any dunes when_ driving over the sand in_ his SUV
Or at least he
doesnt think he remembers any
This is bad
But he has no other direction to go
Too late to turn back now
He figures
that hell get to the top of the dune and_ see if_ he can see anything from
there that helps him find the town
He keeps going up the dune
Halfway up he slips in_ the bad footing of the sand for_ the second or_ third
time and_ falls to his knees
He doesnt feel like getting back up  hell
just fall down again
So he keeps going up the dune on his hand and_ knees
While crawling if_ his throat werent so dry hed laugh
Hes finally
gotten to the hackneyed image of a man lost in_ the desert  crawling through
the sand on his hands and_ knees
If would be the perfect image he imagines if_ only his clothes were more ragged
The people crawling through the desert
in_ the cartoons always had ragged clothes
But his have lasted without any
rips so far
Somebody will probably find his dessicated corpse half buried in_ the sand years from now and_ his clothes will still be in_ fine shape
shake the sand out and_ a good wash and_ theyd be wearable again
He wishes his throat were wet enough to laugh
He coughs a little instead and_ it hurts
He finally makes it to the top of the sand dune
Now that hes at the top
he struggles a little but manages to stand up and_ look around
All he sees
is sand
Sand and_ more sand
Behind him about a mile away he thinks he
sees the rocky ground he left to head into this sand
Ahead of him more
dunes more sand
This isnt where he drove his SUV
This is Hell
Or close enough
Again he doesnt know what to do_
He decides to drink the rest of the wiper
fluid while_ figuring it out
He takes out the bottle and_ is removing the
cap when_ he glances to the side and_ sees something
Something in_ the sand
At the bottom of the dune off to the side he sees something strange
Its a flat area in_ the sand
He stops taking the cap of the bottle off and_ tries to look closer
The area seems to be circular
And its dark  darker than the sand
And there seems to be something in_ the middle of it but he cant tell what it is
He looks as hard as he can and_ still can tell from
here
Hes going to have to go down there and_ look
He puts the bottle back in_ his pocket and_ starts to stumble down the dune
After a few steps he realizes that hes in_ trouble  hes not_ going to be able to keep his balance
After a couple of more sliding tottering steps he falls and_ starts to roll down the dune
The sand it so hot when_ his body hits it that for_ a minute he thinks hes caught fire on the way down  like a movie car wreck flashing into flames as it goes over the cliff before it ever even hits the ground
He closes his eyes and_ mouth covers his face with his hands and_ waits to stop rolling
He stops at the bottom of the dune
After a minute or_ two he finds enough
energy to try to sit up and_ get the sand out of his face and_ clothes
When
he clears his eyes enough he looks around to make sure that the dark spot
in_ the sand it still there and_ he hadnt just imagined it
So seeing the large flat dark spot on the sand is still there he begins
to crawl towards it
Hed get up and_ walk towards it but he doesnt seem to
have the energy to get up and_ walk right now
He must be in_ the final stages
of dehydration he figures as he crawls
If this place in_ the sand doesnt
have water hell likely never make it anywhere else_
This is his last
chance
He gets closer and_ closer but still cant see whats in_ the middle of the
dark area
His eyes wont quite focus any more for_ some reason
And lifting
his head up to look takes so much effort that he gives up trying
He just
keeps crawling
Finally he reaches the area hed seen from the dune
It takes him a minute of crawling on it before he realizes that hes no longer on sand  hes now crawling on some kind of dark stone
Stone with some kind of marking on it  a pattern cut into the stone
Hes too tired to stand up and_ try to see what the pattern is  so he just keeps crawling
He crawls towards the center
where his blurry eyes still see something in_ the middle of the dark stone
area
His mind detached in_ a strange way notes that either his hands and_ knees are so burnt by the sand that they no longer feel pain or_ that this dark
stone in_ the middle of a burning desert with a pounding punishing sun
overhead doesnt seem to be hot
It almost feels cool
He considers lying
down on the nice cool surface
Cool dark stone
Not a good sign
He must be hallucinating this
Hes
probably in_ the middle of a patch of sand already lying face down and_
dying and_ just imagining this whole thing
A desert mirage
Soon the
beautiful women carrying pitchers of water will come up and_ start giving him
a drink
Then hell know hes gone
He decides against laying down on the cool stone
If hes going to die here
in_ the middle of this hallucination he at least wants to see whats in_ the
center before he goes
He keeps crawling
Its the third time that he hears the voice before he realizes what hes
hearing
He would swear that someone just said Greetings traveler
You do_
not_ look well
Do you hear me

He stops crawling
He tries to look up from where he is on his hands and_
knees but its too much effort to lift his head
So he tries something
different  he leans back and_ tries to sit up on the stone
After a few
seconds he catches his balance avoids falling on his face sits up and_
tries to focus his eyes
Blurry
He rubs his eyes with the back of his hands
and_ tries again
Better this time
Yep
He can see
Hes sitting in_ the middle of a large flat dark expanse
of stone
Directly next_ to him about three feet away is a white post or_
pole about two inches in_ diameter and_ sticking up about four or_ five feet
out of the stone at an angle
And wrapped around this white rod tail with rattle on it hovering and_
seeming to be ready to start rattling is what must be a fifteen foot long
desert diamondback rattlesnake looking directly at him
He stares at the snake in_ shock
He doesnt have the energy to get up and_
run away
He doesnt even have the energy to crawl away
This is it his
final resting place
No matter what happens hes not_ going to be able to
move from this spot
Well at least dying of a bite from this monster should be quicker than
dying of thirst
Hell face his end_ like a man
He struggles to sit up a
little straighter
The snake keeps watching him
He lifts one hand and_ waves
it in_ the snakes direction feebly
The snake watches the hand for_ a
moment then_ goes back to watching the man looking into his eyes
Hmmm
Maybe the snake had no interest in_ biting him
It hadnt rattled yet
that was a good sign
Maybe he wasnt going to die of snake bite after all
He then_ remembers that hed looked up when_ hed reached the center here
because he thought hed heard a voice
He was still very woozy  he was
likely to pass out soon the sun still beat down on him even though he was
now on cool stone
He still didnt have anything to drink
But maybe he had
actually heard a voice
This stone didnt look natural
Nor did that white
post sticking up out of the stone
Someone had to have built this
Maybe
they were still nearby
Maybe that was who talked to him
Maybe this snake
was even their pet and_ thats why it wasnt biting
He tries to clear his throat to say Hello but his throat is too dry
All
that comes out is a coughing or_ wheezing sound
There is no way hes going
to be able to talk without something to drink
He feels his pocket and_ the
bottle with the wiper fluid is still there
He shakily pulls the bottle out
almost losing his balance and_ falling on his back in_ the process
This isnt
good
He doesnt have much time left by his reckoning before he passes
out
He gets the lid off of the bottle manages to get the bottle to his lips
and_ pours some of the fluid into his mouth
He sloshes it around and_ then_
swallows it
He coughs a little
His throat feels better
Maybe he can talk
now
He tries again
Ignoring the snake he turns to look around him hoping to
spot the owner of this place and_ croaks out Hello
Is there anyone here

He hears from his side Greetings
What is it that you want

He turns his head back towards the snake
Thats where the sound had seemed
to come from
The only thing he can think of is that there must be a
speaker hidden under the snake or_ maybe built into that post
He decides
to try asking for_ help
Please he croaks again suddenly feeling dizzy Id love to not_ be
thirsty any more
Ive been a long time without water
Can you help me

Looking in_ the direction of the snake hoping to see where the voice was
coming from this time he is shocked to see the snake rear back open its
mouth and_ speak
He hears it say as the dizziness overtakes him and_ he
falls forward face first on the stone Very well
Coming up

A piercing pain shoots through his shoulder
Suddenly he is awake
He sits
up and_ grabs his shoulder wincing at the throbbing pain
Hes momentarily
disoriented as he looks around and_ then_ he remembers  the crawl across the
sand the dark area of stone the snake
He sees the snake still wrapped
around the tilted white post still looking at him
He reaches up and_ feels his shoulder where it hurts
It feels slightly wet
He pulls his fingers away and_ looks at them  blood
He feels his shoulder
again  his shirt has what feels like two holes in_ it  two puncture holes
they match up with the two aching spots of pain on his shoulder
He had been
bitten
By the snake
Itll feel better in_ a minute He looks up  its the snake talking
He
hadnt dreamed it
Suddenly he notices  hes not_ dizzy any more
And more
importantly hes not_ thirsty any more  at all
Have I died
Is this the afterlife
Why are you biting me in_ the
afterlife

Sorry about that but I had to bite you says the snake
Thats the way I
work
It all comes through the bite
Think of it as natural medicine

You bit me to help me
Why arent I thirsty any more
Did you give me a
drink before you bit me
How did I drink enough while_ unconscious to not_ be
thirsty any more
I havent had a drink for_ over two days
Well except for_
the windshield wiper fluid
hold it how in_ the world does a snake talk
Are you real
Are you some sort of Disney animation

No says the snake Im real
As real as you or_ anyone is anyway
I
didnt give you a drink
I bit you
Thats how it works  its what I do_
I
bite
I dont have hands to give you a drink even if_ I had water just
sitting around here

The man sat stunned for_ a minute
Here he was sitting in_ the middle of the
desert on some strange stone that should be hot but wasnt talking to a
snake that could talk back and_ had just bitten him
And he felt better
Not
great  he was still starving and_ exhausted but much better  he was no
longer thirsty
He had started to sweat again but only slightly
He felt
hot in_ this sun but it was starting to get lower in_ the sky and_ the cool
stone beneath him was a relief he could notice now that he was no longer
dying of thirst
I might suggest that we take care of that methanol you now have in_ your
system with the next_ request continued the snake
I can guess why you
drank it but Im not_ sure how much you drank or_ how much methanol was left
in_ the wiper fluid
That stuff is nasty
Itll make you go blind in_ a day or_
two if_ you drank enough of it

Ummm nnext request said the man
He put his hand back on his hurting
shoulder and_ backed away from the snake a little
Thats the way it works
If you like that is explained the snake
You
get three requests
Call them wishes if_ you wish The snake grinned at his
own joke and_ the man drew back a little further from the show of fangs
But there are rules the snake continued
The first request is free
The
second requires an agreement of secrecy
The third requires the binding of
responsibility The snake looks at the man seriously
By the way the snake says suddenly my name is Nathan
Old Nathan
Samuel used to call me
He gave me the name
Before that most of the Bound
used to just call me Snake
But that got old and_ Samuel wouldnt stand
for_ it
He said that anything that could talk needed a name
He was big into
names
You can call me Nate if_ you wish Again the snake grinned
Sorry
if_ I dont offer to shake but I think you can understand  my shake sounds
somewhat threatening The snake give his rattle a little shake
Umm my name is Jack said the man trying to absorb all of this
Jack
Samson
Can I ask you a question Jack says suddenly
What happened to the
poisonumm in_ your bite
Why arent I dying now
How did you do_ that
What do_ you mean by thats how you work

Thats more than one question grins Nate
But Ill still try to answer
all of them
First yes you can ask me a question The snakes grin gets
wider
Second the poison is in_ you
It changed you
You now no longer need
to drink
Thats what you asked for_
Or well technically you asked to not_
be thirsty any more  but any more is such a vague term
I decided to make
it permanent  now as long as you live you shouldnt need to drink much at
all
Your body will conserve water very efficiently
You should be able to
get enough just from the food you eat  much like a creature of the desert
Youve been changed
For the third question Nate continues you are still dying
Besides the
effects of that methanol in_ your system youre a man  and_ men are mortal
In your current state I give you no more than about another some years
Assuming you get out of this desert alive that is Nate seemed vastly
amused at his own humor and_ continued his wide grin
As for_ the fourth question Nate said looking more serious as far as Jack
could tell as Jack was just now working on his ability to read
talkingsnake emotions from snake facial features first you have to agree
to make a second request and_ become bound by the secrecy or_ I cant tell
you

Wait joked Jack isnt this where you say you could tell me but youd
have to kill me

I thought that was implied Nate continued to look serious
Ummmyeah Jack leaned back a little as he remembered again that he was
talking to a fifteen foot poisonous reptile with a reputation for_ having a
nasty temper
So what is this Bound by Secrecy stuff and_ can you really
stop the effects of the methanol Jack thought for_ a second
And what do_
you mean methanol anyway
I thought these days they use ethanol in_ wiper
fluid and_ just denature it

They may I dont really know said Nate
I havent gotten out in_ a
while_
Maybe they do_
All I know is that I smell methanol on your breath and_
on that bottle in_ your pocket
And the blue color of the liquid when_ you
pulled it out to drink some let me guess that it was wiper fluid
I assume
that they still color wiper fluid blue

Yeah they do_ said Jack
I figured replied Nate
As for_ being bound by secrecy  with the
fulfillment of your next_ request you will be bound to say nothing about me
this place or_ any of the information I will tell you after that when_ you
decide to go back out to your kind
You wont be allowed to talk about me
write about me use sign language charades or_ even act in_ a way that will
lead someone to guess correctly about me
Youll be bound to secrecy
Of
course Ill also ask you to promise not_ to give me away and_ as Im
guessing that youre a man of your word youll never test the binding
anyway so you wont notice Nate said the last part with utter confidence
Jack who had always prided himself on being a man of his word felt a
little nervous at this
Ummm hey Nate who are you
How did you know
that
Are you umm omniscient or_ something

Well Jack said Nate sadly I cant tell you that unless_ you make the
second request Nate looked away for_ a minute then_ looked back
Umm well ok said Jack what is this about a second request
What can I
ask for_
Are you allowed to tell me that

Sure said Nate brightening
Youre allowed to ask for_ changes
Changes
to yourself
Theyre like wishes but they can only affect you
Oh and_
before you ask I cant give you immortality
Or omniscience
Or
omnipresence for_ that matter
Though I might be able to make you gaseous
and_ yet remain alive and_ then_ you could spread through the atmosphere and_
sort of be omnipresent
But what good would that be  you still wouldnt be
omniscient and_ thus still could only focus on one thing at a time
Not very
useful at least in_ my opinion Nate stopped when_ he realized that Jack was
staring at him
Well anyway continued Nate Id probably suggest giving you permanent
good health
It would negate the methanol now in_ your system youd be
immune to most poisons and_ diseases and_ youd tend to live a very long
time barring accident of course

... câu chuyện tiếp tục lâu hơn nữa ...

rescue SystemStackError;end

3
Tôi đang tự hỏi, "Chuỗi, nhận xét hoặc bất cứ điều gì cho phép thêm văn bản miễn phí vào mã, có thể được sử dụng, nhưng tối đa 3 từ trên mỗi chuỗi" - Đây có phải là một phần của tập lệnh Ruby hay chỉ là văn bản miễn phí như một chuỗi ba trích dẫn hoặc heredoc? Bởi vì nếu nó không phải là tất cả mã, quy tắc này sẽ không đủ tiêu chuẩn.
joeytje50

1
Vì vậy, về cơ bản những gì bạn đang nói điều này không cho phép "văn bản miễn phí được thêm vào mã"? Nói cách khác, về cơ bản bạn có thể thêm bất kỳ văn bản nào bạn muốn? Có vẻ như bạn có thể nhập bất cứ thứ gì bạn muốn vào đó, ngoại trừ một vài từ khóa dành riêng, mà bạn vừa thêm vào một dấu gạch dưới.
joeytje50

1
@ joeytje50 Không, ví dụ như không ai trong số các công việc sau đây: this doesn't work, !@#$%^&*(, hello there, I am Doorknob! how are you?, 123 456, this is one string for which it fails, in this string it fails too,, vv
tay nắm cửa

2
@ joeytje50 không bạn không thể. try { foo bar } catch (err) { }là một lỗi cú pháp.
FireFly

1
Tôi không nghĩ rằng việc viết mã không hoạt động / gặp sự cố sau đó gói nó trong một trình xử lý ngoại lệ là theo tinh thần của mọi thứ. thử: một lần vào một thời gian blah blah ngoại trừ: in "tada, tôi thắng!".
GreenAsJade

3

PHP

Chúc vui vẻ:)

<?php 

goto:bar;


bar:
$notdrunk = 0
while ($notdrunk <= rand(5, 60)) {

    drink(beer);
    $notdrunk++;
}

if ($notdrunk >= rand(10, 59)) {

goto home;

}

home:

$vomit = true;

if ($notdrunk > 50) {

die();

}

?>

2

JavaScript: 7 * 15 + 127 * 1 = 232 điểm

company = 'big'
for (employee in company) {
    if (/quality/.test(employee) == 'bad') {
        employee = function janitor() {
            return 'less money'
        }
    } else {
        employee = function boss() {
            return 'money'
        }
    }
}

2

Trung Quốc

Văn bản cổ này có thể có nguồn gốc vào khoảng năm 2014 sau Công nguyên:

了一人说你于一嘁力

Bản dịch sang tiếng Anh:

Một cách có ý thức, một người đàn ông đã thuyết phục bạn bằng một âm thanh thì thầm ...


Mã lập trình này thế nào?
joeytje50


8
Dù sao đi nữa, nếu tôi trích dẫn bài viết gốc của mình: "Nếu đoạn mã sử dụng các từ không phải tiếng Anh, thì nó không hợp lệ". Lần trước tôi đã kiểm tra, tiếng Trung không phải là tiếng Anh. (ngoại trừ từ "tiếng Trung Quốc", dĩ nhiên là một từ tiếng Anh ...)
joeytje50

@ joeytje50 Tôi đã cung cấp bản dịch tiếng Anh.
TimTech

3
vâng nhưng tôi cho rằng bản dịch tiếng Anh không phải là mã hợp lệ. Chỉ có mã tiếng Trung là mã hợp lệ và đó không phải là tiếng Anh.
joeytje50

2

Tôi hơi muộn với điều này, nhưng mỗi lần tôi sử dụng FirstChild trong

Javascript

Tôi nghĩ:

function Rumpelstiltskin(straw){
    straw = straw.replace(straw, "gold");
    if(!(knowName=="Rumpelstiltskin")){
         document.getElementById('millersDaughter').deleteChild(document.getElementById('millersDaughter').firstChild);//Stories are documents and characters are elements of the story.
    }else{
         return "angry";
    }
}

Điểm:

2 không xác định (knowName và millers nút html)

7 từ khóa được xây dựng (hàm, if, document.getEuityById ('millersD daughter'), removeChild (...), FirstChild, other, return)

Tôi không biết cách đếm chữ cái, từng chữ cái, chữ cái trong chuỗi? Nói với tôi.

điểm = 95 + chữ cái


1

Delphi

Tôi là người mới và tôi không thực sự hiểu việc ghi bàn. Vì vậy, nếu ai đó có thể giúp tôi với điều đó, nó sẽ rất tuyệt :)

procedure Life;
var alive, fullbladder, fullstomach: boolean;
  bladder, stomach, human: tobject;
  timer:TTimer;
  procedure sleepRecommended;begin sleep(((8*60)*60)*1000) {hours to ms} end;
  procedure checkNeeds(sender:tobject); begin if fullbladder then bladder.empty; if fullstomach then stomach.empty; end;
  procedure GoToWork;begin human.PretendToWorkAndGoOnCodeGolfInstead; end;
  procedure GoHome;begin human.celebrate; end;
begin
  timer:=ttimer.create;timer.interval := (60*60)*1000; timer.OnTimer := checkNeeds;

  while alive do
  begin
    sleepRecommended;
    timer.Enabled := true;
    human.eat;
    goToWork;
    GoHome;
    human.Eat;
  end;

1

6502 Ngôn ngữ hội

Một câu chuyện về một cô gái tên Tya.

    TYA
    AND #1
    TAX
MAN:
    JMP *+4
A:
    BIT #4
THEIR:
.byte "DONKEY"
    EOR .byte "."

1

Con trăn, 1 * 94 + 12 * 15 = 274

Tôi đếm một cho =, nhưng không đếm thêm ftrong def finitely(). Ngoài ra, chức năng này là đệ quy vô hạn, khiến ngăn xếp cuộc gọi chứa đầy "tình yêu" thực sự.

def finitely(one=True):
    if all([any([one])is"loving"or True]):return"love"in finitely()
    else:return"sadness"
"love"in finitely()

Anh:

Chắc chắn một (bằng) Đúng. Nếu tất cả bất cứ ai đang yêu hoặc Đúng, trở lại tình yêu vô tận, thì lại trở về nỗi buồn. Yêu vô hạn.


0

Tập lệnh lệnh Windows - 720

Tính với 210 + 34 * 15

Cảnh báo: điều này có thể có hoặc không có ý nghĩa gì :)

IF "%time%"=="15:00" GOTO :workplace
:workplace
START SHIFT
RECOVER TASKLIST | FIND "todo" | SORT %priority% > tasks
FOR /f %%t IN (tasks) DO (
    SET %%t=Done! | VERIFY
    IF "%TIME%"=="17:00" START BREAK
    IF "%TIME%"=="19:00" START BREAK
    IF "%TIME%"=="21:00" START BREAK
    IF "%RANDOM:~,1%"=="1" START BREAK
    IF "%TIME%"=="23:00" EXIT SHIFT
)

0

Pháo đài 95

Không thực sự là một câu chuyện, nhưng một bài thơ ngắn. Chỉ chia sẻ nó cho vui:

logical :: I, u = .TRUE.
do while (I); write(*,*) aPoem, 4, u; 
stop; I = .FALSE.; 
end do; end ! Adieu!

Coi dấu hiệu =là động từ to be, nó đọc là:

Logical eye, you are true
Do while I write a poem for you
Stop, I am false... 
End, do end! Adieu!
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookieChính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.