Page 1 of 1

the bes programnin language

Posted: Tue Jan 08, 2008 6:54 am
by darksmaster923

Posted: Tue Jan 08, 2008 11:57 am
by vrageprogrammer
OH MY GOD!
WHAT THE??

Here is a program to input a name and say hello in that program:

"Ask the user for their
name. Then say hello."


LOL!

Posted: Tue Jan 08, 2008 2:01 pm
by LtForce
This just looks stupid

Posted: Tue Jan 08, 2008 2:23 pm
by vrageprogrammer
The people who created that software must be joking....

Posted: Tue Jan 08, 2008 4:59 pm
by MakerOfGames
Yeah, its just that simple.

Code: Select all

[Space] [Space] [Tab] [Space] [Tab] [Tab] [LF]...
I prefer

Code: Select all

//A complete working Java class!
public class HelloWorld
{
  public static void main(String[]args)
  {
  int number;
  number = 5;
  for(int x = 0; x < number; x++)
     System.out.println("Hello, world!");
  }
}
I only know Java, but when this next semester starts up for me I will be learning C++.

Posted: Tue Jan 08, 2008 5:27 pm
by LtForce
Nothing beats this:

Code: Select all

#include <iostream> // provides std::cout
 
int main()
{
    std::cout << "Hello, world!\n";
}
This is shortest hello world program available for c++. Not some stupid "Say hello"

Posted: Tue Jan 08, 2008 6:21 pm
by MakerOfGames
Mine could be shorter, but I have it print Hello world 5 times... lol I can't wait to learn C++.

[edit]

Code: Select all

//A complete working Java class!
public class HelloWorld
{
  public static void main()
  {
     System.out.println("Hello, world!");
  }
}
Thats the shortest Hello World Program in Java.
[/edit]

Posted: Tue Jan 08, 2008 10:53 pm
by Jay
Try to do that on the GBA and you're doomed :wink: (because there is no built-in text font)

I will scare you a bit with GameboyAdvance c++ programming now:

Code: Select all

int main(void)
{
 *(unsigned long*)0x4000000=0x3 | 0x400;
 *(unsigned short*)0x6000000[28880]=32767;
 while(1);
 return 0;
}
MUHUHAHAHAH....

Ok i wouldn't understand it too if it was written in this cryptic binary... But that's how far you can go!

Here is the easy version:

Code: Select all

#define REG_DISPCNT *(unsigned long*)0x4000000  //video settings register
#define MODE_3 0x3
#define BG2_ENABLE 0x400
#define RGB(r,g,b) (unsigned short)(r + (g << 5) + (b << 10))

unsigned short* videoBuffer = (unsigned short*)0x6000000;

void DrawPixel3(int x, int y, unsigned short c)
{
    videoBuffer[y * 240 + x] = c;
}

int main(void)
{
   REG_DISPCNT=(MODE_3 | BG2_ENABLE);
   DrawPixel3(120,80,RGB(32,32,32));
   while(1)
   {
         ;
   }
   return 0;
}
This program just displays a pixel on the screen... Basically i set the video settings of the gba to mode 3 with background 2 enabled and then write a pixel into the video buffer. Since the gba has no running system the pixel will just stay there until the progrm ends / until the gba is shut off.

EDIT: just went to the whitespace site and thought LOL
Te pros of whitespace musthave multiple space-bars on their keyboards to hack their code faster. A hacker duel would go like this:

[ TAB TAB TAB ]
[ TAB ]
[ TAB ]
[TAB TAB TABTABTAB TAB TAB]

Just kidding

Posted: Wed Jan 09, 2008 3:38 am
by darksmaster923
vrageprogrammer wrote:OH MY GOD!
WHAT THE??

Here is a program to input a name and say hello in that program:

"Ask the user for their
name. Then say hello."


LOL!
well actually under it is the real code. but you cant see it cuz its just a bunch of tabs and spaces
as i said, its WINNAR
python is most winnar

Code: Select all

print "WASSUP HOME BOI"

Posted: Wed Jan 09, 2008 6:02 pm
by vrageprogrammer
Er...What is WINNAR?
You mean Winner?

Posted: Wed Jan 09, 2008 6:51 pm
by steven8
vb:

MsgBox("Hello World")

Creates a window with your projects title as the window text and Hello World as the message in the box, and an OK button as well. All with one line of code.

System.Diagnostics.Process.Start("C:\MyTextFile.txt", "notepad.exe")

One line opens a file in notepad.