Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Left as an exercise to the reader

Name: Anonymous 2016-09-02 11:17

Write code that determines which programming language this is.

Name: Anonymous 2016-09-02 11:32

console.log('this is javascript');

Name: Anonymous 2016-09-03 2:47

One program that runs as various different languages?

Name: Anonymous 2016-09-03 3:15

>>3
Statements don't end in question marks, dipshit.

Name: Спасибо 2016-09-03 3:21

Name: Anonymous 2016-09-03 4:18

I' just use file

Name: Anonymous 2016-09-03 11:54

quadratic time
1. Run it through every compiler/interpreter
2. Choose the one generating the minimum amount of errors

linear time
1. Collect all tokens--words and symbols.
2. For a list of each language's tokens, find the set intersection with those found in (1).
3. Return the language corresponding to the largest result in (2).

Name: Anonymous 2016-09-03 14:09

>>4
I'm not a dipshit?

Name: Anonymous 2016-09-03 16:49

>>8
Incorrect

Name: Anonymous 2016-09-05 9:42

>>7
quadratic time solution is the correct one, with a slight modification: output each language wich compiles with no errors. this will detect polyglot programs and intentionally obfuscated (or VALID PERL) code that doesn't look like the language it's written in. it will also not be fooled by nonsense which uses tokens from a language but isn't valid code.

Name: Anonymous 2016-09-05 9:59

>>10
far out dude

O_🌁🌁🌁🌁🌁🌁🌁🌁
_|_\
/ |
/\


check em

Name: Anonymous 2016-09-05 12:33

⑵ (★★★★☆ exercise) Write a program α that:

ⅰ Determines the programming language of an input code β (previous exercise).
ⅱ After determining the programming language, α must translate itself to the programming language in which β is written.

⑶ (★★★★★ exercise) Only APL allowed for writing program α in the previous exercise.

Name: Anonymous 2016-09-05 12:52

[writing this post has been left as an exercise to the reader]

Don't change these.
Name: Email:
Entire Thread Thread List