Page 1 of 2

Who can tell me what this program does?

Posted: Wed Feb 07, 2007 7:31 pm
by bruce
First: what language is this?

Second: what does it do?

Code: Select all

+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++>+++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++++++++++++++++>++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++>+++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++>++++++++++++++++++++++++++++++++>+
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++>++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++++++++>++++++++++++++++++++++++++++
++++>++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++>+++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++++++++++++++++>++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++++++++++++++>++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
++++++++++++>++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
+++++++++++++++++>+++++++++++++++++++
+++++++++++++++++++++++++++>+++++++++
<<<<<<<<<<<<<<<&#91;.>&#93;
And now this one:

Code: Select all

PLEASE DO ,1 <- #15
       DO ,1 SUB #1  <-  #54
       DO ,1 SUB #2  <-  #28
       DO ,1 SUB #3  <- #232
       DO ,1 SUB #4  <- #240
       DO ,1 SUB #5  <- #210
       DO ,1 SUB #6  <-  #78
       DO ,1 SUB #7  <-  #24
       DO ,1 SUB #8  <- #154
       DO ,1 SUB #9  <- #190
       DO ,1 SUB #10 <- #192
       DO ,1 SUB #11 <-  #80
       DO ,1 SUB #12 <-   #0
       DO ,1 SUB #13 <- #104
       DO ,1 SUB #14 <-  #90
PLEASE DO ,1 SUB #15 <-  #36

PLEASE READ OUT ,1
PLEASE GIVE UP
Bruce

Posted: Wed Feb 07, 2007 8:47 pm
by Vitriola
There's a joke here, but is it about Pac-Man? Math? Pot? (I'm not good at these things; sometimes, there are too many choices.

Posted: Wed Feb 07, 2007 9:57 pm
by Guest
mov ax,cs
mov ds,ax
mov ah,9
mov dx, offset Hello
int 21h
xor ax,ax
int 21h

Hello:
db "Hello World!",13,10,"$"

Posted: Wed Feb 07, 2007 11:59 pm
by bruce
Anonymous wrote:mov ax,cs
mov ds,ax
mov ah,9
mov dx, offset Hello
int 21h
xor ax,ax
int 21h

Hello:
db "Hello World!",13,10,"$"
That does something different than my programs.

Bruce

Posted: Fri Feb 09, 2007 10:07 pm
by Johnny
The first example is Brainfuck. The second example is INTERCAL. And I don't know what either one does.

Posted: Sat Feb 10, 2007 12:03 am
by Ice Cream Jonsey
bruce wrote:
Anonymous wrote:mov ax,cs
mov ds,ax
mov ah,9
mov dx, offset Hello
int 21h
xor ax,ax
int 21h

Hello:
db "Hello World!",13,10,"$"
That does something different than my programs.

Bruce
And seeing how I have now seemingly lost the ability to read this in MY MIND, it's clear I need to revisit Assembly, because I was quite good at it at one time. DAYUM, another thing to add to the endless list of things to do. I'll place this one towards the end.

Posted: Sat Feb 10, 2007 2:14 am
by Lysander
I would assume that it prints "Hello world!" to the screen? What am I missing?

Posted: Sat Feb 10, 2007 6:50 am
by Draal
Jonsey; graphics, database, driver, programming?

Posted: Sat Feb 10, 2007 11:31 am
by ICJ
Draal wrote:Jonsey; graphics, database, driver, programming?
In terms of what I used to do in Assembly, or what I think the program does?

Posted: Sat Feb 10, 2007 5:36 pm
by draaal
From nine to five, what do you work on? And ya, usually languages are what is constantly reinforced; does the effort with a commercial project allow/encourage optimization, especially with taking the time to fine tune asm code?

Posted: Sun Feb 11, 2007 1:12 pm
by bruce
Johnny wrote:The first example is Brainfuck. The second example is INTERCAL. And I don't know what either one does.
Well, they're both pretty much like "Hello, world!" except they print something else. Go grab an interpreter or compiler, as appropriate, and find out!

Bruce

Posted: Sun Feb 11, 2007 1:16 pm
by ICJ
draaal wrote:From nine to five, what do you work on?
I work on Oracle Portal these days. At the old job (the Assembly job) we'd get word that a particular CPU failed by doing such and such. We then had to write assembly, in as few lines as possible, that showed the error. They then sent the code and the chip off elsewhere for further investigation. It was really cool work, I wish I had a chance to do it longer.
And ya, usually languages are what is constantly reinforced; does the effort with a commercial project allow/encourage optimization, especially with taking the time to fine tune asm code?
You know what, in most places I've seen the VP of the project just wants stuff to "work" as quickly as possible, like for a demo or something, and then you optimize stuff later.

There's a story a guy told me (not at a company I worked for) of a developer who wrote a shell script to handle database records. Worked pretty good. Worked too well. He puts a for loop (or equivalent) to pause the thing for several minutes throughout the program. He says to his boss, "Well, it works... but I think I can make it run faster!" And for the next four months he does nothing but the variable he himself put in for the pause. That's software "engineering" for you.

Posted: Sun Feb 11, 2007 1:52 pm
by MONKEY MONKEY
"BRUEC IS A FAG"?

Posted: Tue Feb 13, 2007 7:15 pm
by bruce
MONKEY MONKEY wrote:"BRUEC IS A FAG"?
Surprisingly close, actually.

Bruce

Posted: Tue Feb 13, 2007 7:35 pm
by pinback
Suck my balls.

Posted: Tue Feb 13, 2007 9:01 pm
by bruce
pinback wrote:Suck my balls.
Bravo.

Bruce

Posted: Tue Feb 13, 2007 10:22 pm
by Ice Cream Jonsey
Did we ever get confirmation on this? Was Johnny right? Johnny's right about a lot of things, so this does not surprise me.

Posted: Wed Feb 14, 2007 4:57 pm
by Guest
Brainfuck:
http://www.muppetlabs.com/~breadbox/bf/

++++++[>++++++++++++++++<-]>
++.--
>+++[<++++++>-]<.>[-]+++[<------>-]<
+.-
+++++++++.---------
++++++++++++++.--------------
++++++.------
>+++[<+++++++>-]<.>[-]+++[<------->-]<
+++.---
+++++++++++.-----------

C-Intercal:

PLEASE DO ,1 <- #13
DO ,1 SUB #1 <- #584
DO ,1 SUB #2 <- #837
DO ,1 SUB #3 <- #1100
DO ,1 SUB #4 <- #1356
DO ,1 SUB #5 <- #1615
DO ,1 SUB #6 <- #1824
DO ,1 SUB #7 <- #2135
DO ,1 SUB #8 <- #2383
DO ,1 SUB #9 <- #2642
DO ,1 SUB #10 <- #2892
DO ,1 SUB #11 <- #3140
DO ,1 SUB #12 <- #3361
DO ,1 SUB #13 <- #266

PLEASE DO ,2 <- #1
PLEASE DO .5 <- #0
PLEASE DO .4 <- #1

PLEASE COME FROM (1)
DO .6 <- ",1 SUB .4"~#255
DO .6 <- !6~#15'$!6~#240'
DO .6 <- !6~#15'$!6~#240'
DO .6 <- !6~#15'$!6~#240'

DO .1 <- .5
DO .2 <- .6
PLEASE DO (1010) NEXT
DO .3 <- .3~#255
DO .5 <- .6

DO ,2 SUB #1 <- .3
PLEASE READ OUT ,2

(1) PLEASE DO .4 <- ",1 SUB .4"~#3840
PLEASE GIVE UP

Posted: Wed Feb 14, 2007 4:59 pm
by Guest

Posted: Thu Feb 15, 2007 5:19 pm
by bruce
The Brainfuck example works (although you shoulda put a linefeed on there, I think), but the INTERCAL version gives me

Code: Select all

ICL778I UNEXPLAINED COMPILER BUG
        ON THE WAY TO 326
        CORRECT SOURCE AND RESUBNIT

Bruce