Click to See Complete Forum and Search --> : nobody is programming today!


Danger Fan
12-04-2001, 04:54 PM
It's quiet, too quiet.

anyway, here I go:


#!/usr/bin/perl -w
use strict;
print "Hello World!\n";



yeah!

TheLinuxDuck
12-04-2001, 05:00 PM
(^=

I was getting ready to post a link to something I've been working on.. I'll just post it here... I've been working on it for the last few days, but just finally made some breakthroughs with it. It should be fully functional.

I've got a base conversion class, written in python. It allows you to set any type number, between base2 and base16, then convert it on the fly to any other base. Kinda qool... at least I thought.

Here is the link: http://www.codeexamples.org/tld/BaseConversion.py

Here is it's output, as-is:

~/python/base> ./BaseConversion.py
<STRONG>00101101 base2 is 101101
204 base7 is 204
fa base16 is FA
fa base16 in base 2 is 11111010
fa base16 in base 3 is 100021
fa base16 in base 4 is 3322
fa base16 in base 5 is 2000
fa base16 in base 6 is 1054
fa base16 in base 7 is 505
fa base16 in base 8 is 372
fa base16 in base 9 is 307
fa base16 in base 10 is 250
fa base16 in base 11 is 208
fa base16 in base 12 is 18A
fa base16 in base 13 is 163
fa base16 in base 14 is 13C
fa base16 in base 15 is 11A
fa base16 in base 16 is FA</STRONG>


I think it's working right, too.

inkedmn
12-04-2001, 05:03 PM
i'm in...


#!/usr/bin/env python
w00t = "Hello World!"
print w00t


:D

Hey Danger, turn on (G)AIM!!!

[ 04 December 2001: Message edited by: inkedmn ]

Danger Fan
12-04-2001, 05:12 PM
here's another stupid one!!!


#!/usr/bin/perl

use strict;

my $name;

print "Enter your name: ";
$name = &lt;&gt;;

if($name =~ /^t\w*k$/){
print "You are crazy!!\n";
}
else{
print "I'm crazy for writing this!!\n";
}


hehehe!!! :eek:

inkdemn: I'm at work right now, but I'll turn it on when I get home. I should be leaveing in about 15 minutes!

[ 04 December 2001: Message edited by: Danger Fan ]

inkedmn
12-04-2001, 05:19 PM
:D


#!/usr/bin/env python

name = 'inkedmn'

x = (raw_input("Please enter your LNO handle: "))
if x == name:
print "You Da KANG!!!"
else:
print "You wish you was da KANG!!!"


:eek:

inkedmn
12-04-2001, 06:26 PM
ok, i got this to work (jeremy, i believe this is what you mentioned last night...)


#!/usr/bin/env python

number = 5

while 1:
x = int(raw_input("Please enter a number between 1 and 10, or 11 to quit: "))
if x == 11:
print "Quitting..."
break
elif x &lt; 1 or x &gt; 11:
print "Invalid Selection, try again"
elif x == number:
print "w00t! you win!"
break
else:
print "Incorrect, please try again"


look right? :D

[edit] see TLD's post below :)

[ 04 December 2001: Message edited by: inkedmn ]

TheLinuxDuck
12-04-2001, 06:30 PM
inkedmn:

It looks good!!

One thing, though.

The code is setting a value to the variable 'number', but it never uses it anywhere. I assume that you're setting the number as the number to guess.. that would indicate to me that the line:

elif x == 5:

should actually be

elif x == number:

vee-eye
12-04-2001, 06:45 PM
public class Hello
{
public static void main(String[] args)
{
// Generate a random number b/w 1 and 10
int random = 0;
random = (int)Math.ceil(10*Math.random());

// Display the result
System.out.println("Hello World!\n" + "Your number is " + random);
}
}

Whipping Boy
12-04-2001, 06:55 PM
[+++++++++]&gt;&gt;&gt;[++&gt;&gt;&gt;++++&lt;--&lt;].

I have no idea what that will do...I just typed a bunch of characters.

vee-eye
12-04-2001, 07:25 PM
Originally posted by Whipping Boy:
<STRONG>[+++++++++]&gt;&gt;&gt;[++&gt;&gt;&gt;++++&lt;--&lt;].

I have no idea what that will do...I just typed a bunch of characters.</STRONG>

What language? ;)

Whipping Boy
12-04-2001, 07:45 PM
Brainf u ck

EDIT: Had to get around the censoring to get the language named

[ 04 December 2001: Message edited by: Whipping Boy ]

George Kilroy
12-04-2001, 08:37 PM
v 0 0 0
v 1 0 0
v 1 1 0
v 0 1 0
v 0 0 1
v 1 0 1
v 1 1 1
v 0 1 1
f 1 2 3 4
f 5 6 7 8
l 1 5
l 2 6
l 3 7
l 4 8
Can anyone guess what this is???

[ 04 December 2001: Message edited by: George Kilroy ]

Whipping Boy
12-04-2001, 09:23 PM
/me goes off to write a program to print Pascal's triangle

George Kilroy
12-04-2001, 10:31 PM
I thought about doing a pascal's triangle, but I don't know how it would fit on the screen. The 1st number is usually centered right? and what about word-wrap?

George Kilroy
12-04-2001, 10:39 PM
Originally posted by Whipping Boy:
<STRONG>[+++++++++]&gt;&gt;&gt;[++&gt;&gt;&gt;++++&lt;--&lt;].

I have no idea what that will do...I just typed a bunch of characters.</STRONG>
Well, Python didn't like it.
$&gt; [+++++++++]&gt;&gt;&gt;[++&gt;&gt;&gt;++++&lt;--&lt;]
File "&lt;stdin&gt;", line1
[+++++++++]&gt;&gt;&gt;[++&gt;&gt;&gt;++++&lt;--&lt;]
^
SyntaxError: invalid syntax.

Carnel
12-04-2001, 11:12 PM
The only thing I programmed today was a cisco router....

set nvram erase
write
reboot

heheh, try it out if you have a cisco router at home.

Bradmont5
12-05-2001, 05:13 AM
Originally posted by Danger Fan:
<STRONG>nobody is programming today!</STRONG>

Oh my don't I wish...

I spent 5 consecutive hours working on an MFC project, due tomorrow, worth 10% of my final mark, that was assigned a week ago. Not that I mind coding for 5 consecutive hours, it's just coding for 5 consecutive hours in MFC.... /me shudders

sans-hubris
12-05-2001, 09:43 AM
Originally posted by Bradmont5:
<STRONG>Oh my don't I wish...

I spent 5 consecutive hours working on an MFC project, due tomorrow, worth 10% of my final mark, that was assigned a week ago. Not that I mind coding for 5 consecutive hours, it's just coding for 5 consecutive hours in MFC.... /me shudders</STRONG>
After working with Qt a little bit, as well as MFC, I feel sorry for you.

kmj
12-05-2001, 10:06 AM
aesthetically speaking, I hate MFC, but well, when your company does everything on Windows that's what you do. When you use MFC you can take advantage of the vast world of support there is out there... I mean any wacky control you might want to use has probably already been written; and even something completely customized is generally just a matter of finding something similar and extending it in your own way.