Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Programs that do nothing
Index -> General Programming
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Sat Oct 21, 2006 1:22 pm   Post subject: Programs that do nothing

So... what do programs that do nothing look like?

Well, if you're a Perl, Ruby, Python, O'Caml, SML, Lisp, etc. programmer, it looks like this:

code:


If you're a Java programmer, it looks like this:

code:
public class EmptyProgram {
   public static void main(String[] args) {

   }
}


If you're a C# programmer:

code:
public class EmptyProgram {
   public static void Main(string[] args) {

   }
}


If you're a C or C++ programmer:

code:
int main()
{
   
}


If you're a Pascal programmer:

code:
program X;
begin

end.
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Sat Oct 21, 2006 4:09 pm   Post subject: (No subject)

if your an HTML/PHP programmer it looks something like this:

code:

<html>
<head>
</head>
<body>
</body>
</html>


if your a Turing programmer it looks like this:

code:


if your an O'Caml programmer it looks something like this:

code:

#
wtd




PostPosted: Sat Oct 21, 2006 5:02 pm   Post subject: (No subject)

The # is not part of an O'Caml program. Rather it denotes the prompt when using the O'Caml toplevel interpreter.
blaster009




PostPosted: Sat Oct 21, 2006 6:40 pm   Post subject: (No subject)

wtd wrote:
The # is not part of an O'Caml program. Rather it denotes the prompt when using the O'Caml toplevel interpreter.


Pwned.
md




PostPosted: Sat Oct 21, 2006 7:19 pm   Post subject: (No subject)

Freakman wrote:
if your an HTML/PHP programmer it looks something like this:

code:

<html>
<head>
</head>
<body>
</body>
</html>



Technically you just need an empty file for nothing in html/xhtml. It renders fine Wink
wtd




PostPosted: Sat Oct 21, 2006 7:24 pm   Post subject: (No subject)

blaster009 wrote:
wtd wrote:
The # is not part of an O'Caml program. Rather it denotes the prompt when using the O'Caml toplevel interpreter.


Pwned.


It's an honest mistake, very much redeemed by his interest in learning a language for fun.
Cervantes




PostPosted: Sat Oct 21, 2006 9:41 pm   Post subject: (No subject)

blaster009 wrote:
wtd wrote:
The # is not part of an O'Caml program. Rather it denotes the prompt when using the O'Caml toplevel interpreter.


Pwned.


I don't know if you thought that was funny, but I didn't. In fact, I didn't even see the "word" "Pwned." All I saw was "SPAM SPAM SPAM SPAM SPAM!"

I hope you can see where I'm going with this: one word posts, especially when the only word is something stupid like "pwned", is pure spam, and will result in bad things.

minus some bits.
md




PostPosted: Sat Oct 21, 2006 9:49 pm   Post subject: (No subject)

Cervantes wrote:
<deletia>
... and will result in bad things.


You are starting to sound like me... using vague threats of "bad things" to acomplish things. It's shocking how well it works when you actually do implement a bad thing that truely is horrible.

Bash Script"
code:

#!/bin/bash


/me also notes that wtd didn't credit the pascal code Wink
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sat Oct 21, 2006 9:57 pm   Post subject: (No subject)

md wrote:
Bash Script"
code:

#!/bin/bash


Only necessary if you're unwilling to execute it as "bash nada.sh".
Craige




PostPosted: Tue Oct 24, 2006 9:44 pm   Post subject: (No subject)

md wrote:
Technically you just need an empty file for nothing in html/xhtml. It renders fine Wink


Correct. The html tags are only for the browser's use, and when you put them in there, your are also making the assumption one is using PHP for the web. Good prediction, but not necessarily accurate.
md




PostPosted: Tue Oct 24, 2006 9:47 pm   Post subject: (No subject)

Craige wrote:

Correct. The html tags are only for the browser's use, and when you put them in there, your are also making the assumption one is using PHP for the web. Good prediction, but not necessarily accurate.


I think you mean html/xhtml not PHP Wink
ZeroPaladn




PostPosted: Wed Oct 25, 2006 12:47 pm   Post subject: (No subject)

Turing that does nothing (except hog precious computing power, cause we all know Turing does that anyways)

Turing:
var zero : string := ""

procedure nothing ()
end nothing

function nothing2 (none : string) : int
    var nada : int := 0
    result nada
end nothing2

loop
    nothing
    if nothing2 (zero) = 0 then
        nothing
    end if
end loop

Silent Avenger




PostPosted: Wed Oct 25, 2006 2:18 pm   Post subject: (No subject)

Code for VB that does nothing but show an emty screen.

code:
Andy




PostPosted: Wed Oct 25, 2006 2:28 pm   Post subject: (No subject)

ZeroPaladn wrote:
Turing that does nothing (except hog precious computing power, cause we all know Turing does that anyways)

Turing:
var zero : string := ""

procedure nothing ()
end nothing

function nothing2 (none : string) : int
    var nada : int := 0
    result nada
end nothing2

loop
    nothing
    if nothing2 (zero) = 0 then
        nothing
    end if
end loop



just because you're not outputting anything, doesnt mean you're not doing anything. your program constantly allocates memory for your variables. it's doing plenty
Tony




PostPosted: Wed Oct 25, 2006 2:49 pm   Post subject: (No subject)

Freakman wrote:

if your a Turing programmer it looks like this:
code:


We are looking for the absolute minimum "Hello World", less the greeding.

And Turing's
code:
will still compile into a 600 Kb executable Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: