Qbasicnews.com

QbasicNews.Com => Challenges => Topic started by: stylin on January 26, 2006, 05:12:18 AM



Title: Your best "Hello, world!" program in FreeBasic
Post by: stylin on January 26, 2006, 05:12:18 AM
Simple. Post a neat "Hello, world!" program. It does not necessarily have to be obfuscated, but should be clever, inefficient, unsafe or otherwise something you shouldn't be doing. ;)

The output must only be "Hello, world!" (without quotes).

You may submit more than one entry - and are encouraged to do so - but you cannot post consecutive entries; you must wait until at least one entry has been posted before posting again.

There are no prizes; everyone is a winner. I'll start:

Code:
'' : HelloWorld.bas :
'' -----------------------------------------------------------------------------
dim _l(3) as double => { 1.0795350776197, 2.68322932786768, _
                         0.926115152769539, 0.717391304347826 }

dim as zstring * 14 _O => "Goodbye, sol."

    dim as longint _0 => &hfeedface
    dim as longint _1 => &hdeadbeef
   
    while(_1 <_0 )
        _0 = *cptr( integer ptr, @_O[O_*4] ) * _l(O_)
        O_ += 1 : print *cptr( zstring ptr, @_0 ) ;
        _0 += _1-O_*10
    wend

    sleep : end O_-4


Title: Your best "Hello, world!" program in FreeBasic
Post by: na_th_an on January 26, 2006, 06:10:56 AM
I can't get a bit of your code.

Are you sure that's BASIC? :lol: ;)

That's what I made in 5 minutes, I don't have more than that. It sucks, but looks kinda cool

Code:
#define World : Locate , 8 - 1 :? "World!" : Obfuscation = 0
#define Hello Print "Hello Hello!"

Hello, World!


Title: Your best "Hello, world!" program in FreeBasic
Post by: KiZ on January 26, 2006, 12:59:21 PM
[syntax="qbasic"]#define gcfp(num) (val(mid(str(pi), num, 1)))
#define gwfp(num1, num2, num3) (chr(val(str(gcfp(piref(num1))) + str(gcfp(piref(num2))) + str(gcfp(piref(num3))))))

dim piref(7) as integer => {7, 13, 15, 4, 1, 8, 3, 0}
dim shared pi as double

pi = 1
add = 1

for i = 1 to 27
   add = add + 2
   pow = pow + 1
   if sign then pi = pi + (add * 3 ^ pow) ^ -1 else pi = pi - (add * 3 ^ pow) ^ -1
   sign = sign xor 1
next
pi = 2 * sqr(3) * pi


print gwfp(7, 2, 5) + gwfp(6, 7, 6) + gwfp(6, 7, 1) + gwfp(6, 7, 1) + gwfp(6, 6, 6) + gwfp(7, 3, 3);
print gwfp(7, 4, 5) + gwfp(6, 6, 0) + gwfp(6, 6, 6) + gwfp(6, 6, 3) + gwfp(6, 7, 1) + gwfp(6, 7, 7) + gwfp(7, 4, 4)

sleep[/syntax]

I'll give you a cookie if you can work out how it works ^^

Hint: it uses Pi :>


Title: Your best "Hello, world!" program in FreeBasic
Post by: TheDarkJay on January 26, 2006, 01:15:21 PM
My personal favorite

Code:

#define FacK Print
#define You "Hello"
#define Mother +
#define Facker "World"

Fack You Mother Facker

SLEEP



You have to replace the A in Fack and Facker with a u


Title: Your best "Hello, world!" program in FreeBasic
Post by: thegrogen on January 26, 2006, 01:57:27 PM
Code:

s:                        
Sleep 500
If Inkey$ = "" Then Goto h
End
l3:
Print "l";
Goto d
o1:
Print "o";
Goto sp
l2:
Print "l";
Goto o1
o2:
Print "o";
Goto r
e:
Print "e";
Goto l1
d:
Print "d"
Goto s
h:
Print "H";
Goto e    
sp:
Print " ";
Goto w
l1:
Print "l";
Goto l2
w:
Print "w";
Goto o2
r:
Print "r";
Goto l3


Title: Your best "Hello, world!" program in FreeBasic
Post by: DefHo on January 26, 2006, 04:32:37 PM
Code:
DECLARE FUNCTION bin2string$ (a$)
DECLARE FUNCTION string2bin$ (a$)

SCREEN 13

'create data
COLOR 1
PALETTE 1, 0
PRINT "Hello world!"
buffer$ = ""
FOR x = 0 TO 95
  FOR y = 0 TO 7
    IF POINT(x, y) THEN buffer$ = buffer$ + CHR$(1) ELSE buffer$ = buffer$ + CHR$(0)
  NEXT
  realbuffer$ = realbuffer$ + bin2string$(buffer$)
  buffer$ = ""
NEXT

CLS

'display data
OUT 968, 1
OUT 969, 63
OUT 969, 63
OUT 969, 63

FOR x = 0 TO 95
  buffer$ = string2bin$(MID$(realbuffer$, x + 1, 1))
  FOR y = 0 TO 7
    IF ASC(MID$(buffer$, y + 1, 1)) THEN PSET (x, y), 1
  NEXT
NEXT

sleep

FUNCTION bin2string$ (a$)
  'decodes a series of 8 digits (0 or 1) into an ascii character
  ch = 0
  inc = 1
  FOR i = 1 TO 8
    IF ASC(MID$(a$, i, 1)) THEN ch = ch + inc
    inc = inc * 2
  NEXT
  bin2string$ = CHR$(ch)
END FUNCTION

FUNCTION string2bin$ (a$)
  'encodes an ascii character into its binary format
  binr = 0
  n = 128
  DO
    IF binr < ASC(a$) THEN
      IF binr + n <= ASC(a$) THEN
        binr = binr + n
        b$ = b$ + CHR$(1)
      ELSE
        b$ = b$ + CHR$(0)
      END IF
    ELSE
      b$ = b$ + CHR$(0)
    END IF
    n = n / 2
  LOOP UNTIL n < 1
  'reverse the string
  b2$ = ""
  FOR i = 8 TO 1 STEP -1
    b2$ = b2$ + MID$(b$, i, 1)
  NEXT
  string2bin$ = b2$
END FUNCTION


EDIT: oops, that's qbasic. It should work in freebasic though.


Title: Your best "Hello, world!" program in FreeBasic
Post by: SSC on January 28, 2006, 04:09:22 AM
Code:
dim array(0 to 319, 0 to 199)
screen 13
print "Hello World!"
for x = 0 to 319
    for y = 0 to 199
        array(0 to 319, 0 to 199) = point(x,y)
    next
next
cls
screen 12
for x = 0 to 319
    for y = 0 to 199
        pset(x,y),array(x,y)
    next
next
sleep

hehe screen 13 font in screen 12 resolution =)


Title: Your best "Hello, world!" program in FreeBasic
Post by: DefHo on January 28, 2006, 05:09:51 AM
Quote
I'll give you a cookie if you can work out how it works ^^


gfpw (7, 2, 5) returns "H" (ascii character 72).
gfpw (6, 7, 6) returns "e"
etc...

piref (7) = 0
piref (2) = 15
piref (5) = 8

The first character in pi or mid(str(pi), 0, 1) is " "   (It's not 3 because of the space at the beginning of the string. str(pi) = " 3.14159...")
The 16th character in pi or mid(str(pi), 15, 1) is "7"
The 9th character in pi or mid(str(pi), 8, 1) is "2"

Put them together and you get " 72"


Hand over my fucking cookie!!! :D


Title: Your best "Hello, world!" program in FreeBasic
Post by: thegrogen on January 28, 2006, 05:37:15 PM
Quote from: "SSC"
*removed code*
hehe screen 13 font in screen 12 resolution =)


Code:
dim array(319, 199)
screen 13
print "Hello World!"
for x = 0 to 319
    for y = 0 to 199
        array(x, y) = point(x,y)
    next
next
cls
screen 12
for x = 0 to 319
    for y = 0 to 199
        pset(x,y),array(x,y)
    next
next
sleep


Fixed.


Title: Your best "Hello, world!" program in FreeBasic
Post by: SSC on January 28, 2006, 07:31:05 PM
hmm? , if you make a print after screen 12 has opened then its a different text size then the one made in 13 displayed on 12


Title: Your best "Hello, world!" program in FreeBasic
Post by: KiZ on January 29, 2006, 12:38:49 AM
Quote from: "DefHo"
Hand over my @$ cookie!!! :D


hehe, ok so It wasnt too hard to work out with good code reading ^.^

Here you go!
(http://fileanchor.com/17934-r.jpg)


Title: Your best "Hello, world!" program in FreeBasic
Post by: DefHo on January 29, 2006, 04:07:41 PM
Mmm. That was tasty. Thanks.


Title: Your best "Hello, world!" program in FreeBasic
Post by: yetifoot on January 30, 2006, 02:32:29 AM
Code:
Dim As Integer dd(704) = { _
 41,  74,  41,  76,  41,  82,  41,  85,  41,  90,  41,  95,  41, 100,  41, 102, _
 41, 107,  41, 111,  41, 114,  41, 117,  41, 120,  41, 125,  41, 127,  41, 132, _
 41, 136,  41, 140,  41, 143,  41, 147,  41, 151,  41, 152,  41, 153,  41, 154, _
 42, 114,  44, 114,  48, 114,  50, 114,  54, 114,  60, 114,  65, 114,  68, 114, _
 70, 114,  71, 114,  75,  79,  75,  80,  75,  85,  75,  93,  75, 102,  76, 111, _
 76, 118,  76, 125,  76, 127,  76, 134,  76, 138,  76, 140,  76, 141,  96, 130, _
 98, 129, 100, 128, 100, 127, 103, 125, 105, 124, 106, 122, 108, 121, 108, 120, _
108, 119, 108, 118, 108, 117, 108, 116, 108, 115, 108, 114, 108, 113, 107, 112, _
107, 111, 106, 111, 105, 110, 103, 110, 102, 110, 100, 110,  97, 110,  92, 113, _
 88, 117,  83, 119,  81, 121,  81, 122,  80, 123,  80, 124,  80, 127,  80, 129, _
 82, 131,  82, 132,  84, 135,  86, 137,  88, 140,  91, 141,  95, 144,  99, 145, _
101, 145, 103, 145, 106, 145, 108, 145, 112, 144, 114, 143, 116, 142, 116, 141, _
132,  82, 132,  86, 132,  93, 132,  96, 132, 103, 132, 108, 132, 114, 132, 120, _
132, 126, 132, 132, 132, 134, 132, 140, 132, 143, 132, 144, 151,  89, 151,  93, _
151,  95, 151, 100, 151, 105, 151, 111, 151, 117, 151, 123, 151, 128, 151, 131, _
151, 136, 151, 142, 151, 146, 151, 148, 183, 118, 181, 118, 179, 119, 178, 120, _
174, 126, 172, 128, 171, 132, 170, 134, 170, 138, 170, 140, 171, 142, 174, 144, _
177, 146, 179, 146, 182, 146, 184, 146, 187, 145, 189, 144, 192, 141, 194, 139, _
195, 134, 195, 130, 195, 126, 195, 123, 193, 119, 190, 115, 188, 114, 185, 112, _
244,  84, 244,  85, 244,  87, 244,  91, 244,  97, 244, 102, 245, 107, 245, 113, _
246, 115, 248, 120, 250, 127, 252, 131, 254, 137, 254, 139, 254, 141, 254, 142, _
254, 143, 254, 144, 254, 145, 254, 146, 255, 144, 255, 143, 256, 141, 257, 139, _
258, 137, 260, 133, 262, 130, 262, 127, 262, 125, 263, 123, 263, 122, 263, 121, _
263, 120, 263, 119, 263, 120, 263, 122, 264, 124, 266, 129, 270, 136, 274, 142, _
276, 145, 278, 147, 279, 147, 280, 145, 281, 141, 281, 136, 281, 131, 281, 124, _
281, 122, 281, 115, 281, 108, 281, 102, 282,  98, 283,  94, 283,  92, 283,  91, _
283,  90, 283,  88, 283,  87, 283,  86, 311, 123, 309, 123, 307, 123, 305, 125, _
304, 125, 303, 128, 302, 131, 301, 133, 301, 136, 301, 140, 302, 142, 303, 144, _
305, 145, 307, 147, 309, 148, 311, 148, 313, 148, 316, 148, 317, 147, 320, 146, _
321, 145, 321, 143, 322, 142, 322, 139, 322, 137, 322, 134, 322, 131, 321, 128, _
319, 127, 318, 125, 316, 125, 339, 125, 339, 128, 339, 130, 339, 134, 339, 140, _
339, 142, 339, 144, 339, 141, 339, 135, 339, 131, 339, 126, 339, 122, 339, 119, _
339, 118, 339, 117, 340, 117, 341, 116, 345, 116, 349, 116, 352, 116, 355, 116, _
380, 100, 380, 104, 380, 110, 380, 116, 380, 122, 380, 126, 380, 133, 380, 137, _
380, 141, 380, 144, 380, 145, 380, 146, 404, 130, 403, 129, 401, 129, 400, 128, _
399, 128, 397, 128, 395, 130, 392, 133, 391, 137, 390, 141, 390, 143, 390, 145, _
390, 146, 391, 146, 392, 146, 394, 146, 397, 146, 400, 145, 402, 142, 404, 141, _
406, 138, 407, 138, 407, 135, 408, 131, 408, 127, 408, 121, 408, 117, 408, 113, _
408, 110, 408, 107, 408, 104, 408, 102, 408, 100, 408,  99, 408,  97, 408,  96, _
408,  95, 408,  94, 408,  93, 408,  92, 408,  91, 408,  90, 408,  93, 409, 101, _
412, 115, 417, 129, 421, 142, 426, 153, 427, 158, 427, 162, 428, 162, 452,  93, _
452,  96, 452,  98, 452, 101, 452, 106, 452, 113, 452, 118, 452, 124, 452, 130, _
452, 131, 452, 133, 451, 150, 450, 150, 449, 150, 448, 151, 446, 154, 446, 155, _
445, 157, 445, 159, 445, 160, 446, 161, 447, 161, 448, 159, 450, 156, 452, 151 }

ScreenRes 640, 480, 32

For i = 1 To 704 Step 2
  mx = dd(i-1)
  my = dd(i)
  pset (mx, my), &HFFFFFF
  pset (mx + 1, my + 1), &HFFFFFF
  pset (mx - 1, my - 1), &HFFFFFF
  pset (mx + 1, my - 1), &HFFFFFF
  pset (mx - 1, my + 1), &HFFFFFF
  Sleep 20
Next i

Sleep


Title: Your best "Hello, world!" program in FreeBasic
Post by: LooseCaboose on January 30, 2006, 03:54:53 AM
Compiles for FB, QB and ANSI C:
Code:

REM; /*
print "Hello World"
'*/ int main(void) {printf("Hello World\n"); return 0;}


Edit: Slightly more clever version:
Code:

REM = '\t'; char *PRINT = "\n"; /*
DIM s AS STRING * 13
'*/ int main() { char *s[3] = {
PRINT , "Hello world",
REM}; printf("%c%s%s", s[2], s[1], s[0]);}


Title: Your best "Hello, world!" program in FreeBasic
Post by: na_th_an on January 30, 2006, 05:34:07 AM
Cute cross-language stuff, I like it, very classy :D


Title: Your best "Hello, world!" program in FreeBasic
Post by: j2krei08 on January 31, 2006, 05:04:50 PM
Here's mine!

Code:

'Hello World example and Bitmap font loader
'A RADIUM-V Interactive Program By John Kreitlow
'Copyright (C) 2006 John Kreitlow and RADIUM-V Interactive
'Use With permission - Email jkreitlow@gmail.com
DECLARE FUNCTION Font (spritex,spritey,text AS STRING)
DIM SHARED Font_letter (12264) AS INTEGER

SCREEN 18,16,2
SCREENSET 1,0

BLOAD "Font.bmp",0
   l_num = -1
   FOR I = 0 TO 111 STEP 18
      FOR J = 0 TO 107 STEP 16
         l_num = l_num + 1
         GET(J,I)-(J + 15, I + 17),Font_letter(292 * l_num)
      NEXT J
   NEXT I
   CLS

Font (220,220,"Hello World!")
SCREENCOPY
SLEEP

FUNCTION Font (spritex,spritey,text AS STRING)
   l_next = 0
   text = UCASE$(text)
   FOR a = 1 TO LEN(text)
      IF MID$(text,a,1) = " " THEN l_num = -1
      IF MID$(text,a,1) = "A" THEN l_num = 0
      IF MID$(text,a,1) = "B" THEN l_num = 1
      IF MID$(text,a,1) = "C" THEN l_num = 2
      IF MID$(text,a,1) = "D" THEN l_num = 3
      IF MID$(text,a,1) = "E" THEN l_num = 4
      IF MID$(text,a,1) = "F" THEN l_num = 5
      IF MID$(text,a,1) = "G" THEN l_num = 6
      IF MID$(text,a,1) = "H" THEN l_num = 7
      IF MID$(text,a,1) = "I" THEN l_num = 8
      IF MID$(text,a,1) = "J" THEN l_num = 9
      IF MID$(text,a,1) = "K" THEN l_num = 10
      IF MID$(text,a,1) = "L" THEN l_num = 11
      IF MID$(text,a,1) = "M" THEN l_num = 12
      IF MID$(text,a,1) = "N" THEN l_num = 13
      IF MID$(text,a,1) = "O" THEN l_num = 14
      IF MID$(text,a,1) = "P" THEN l_num = 15
      IF MID$(text,a,1) = "Q" THEN l_num = 16
      IF MID$(text,a,1) = "R" THEN l_num = 17
      IF MID$(text,a,1) = "S" THEN l_num = 18
      IF MID$(text,a,1) = "T" THEN l_num = 19
      IF MID$(text,a,1) = "U" THEN l_num = 20
      IF MID$(text,a,1) = "V" THEN l_num = 21
      IF MID$(text,a,1) = "W" THEN l_num = 22
      IF MID$(text,a,1) = "X" THEN l_num = 23
      IF MID$(text,a,1) = "Y" THEN l_num = 24
      IF MID$(text,a,1) = "Z" THEN l_num = 25
      IF MID$(text,a,1) = "0" THEN l_num = 26
      IF MID$(text,a,1) = "1" THEN l_num = 27
      IF MID$(text,a,1) = "2" THEN l_num = 28
      IF MID$(text,a,1) = "3" THEN l_num = 29
      IF MID$(text,a,1) = "4" THEN l_num = 30
      IF MID$(text,a,1) = "5" THEN l_num = 31
      IF MID$(text,a,1) = "6" THEN l_num = 32
      IF MID$(text,a,1) = "7" THEN l_num = 33
      IF MID$(text,a,1) = "8" THEN l_num = 34
      IF MID$(text,a,1) = "9" THEN l_num = 35
      IF MID$(text,a,1) = "!" THEN l_num = 36
      IF MID$(text,a,1) = "?" THEN l_num = 37
      IF MID$(text,a,1) = "." THEN l_num = 38
      IF MID$(text,a,1) = "@" THEN l_num = 39
      IF MID$(text,a,1) = "," THEN l_num = 40
      IF MID$(text,a,1) = "_" THEN l_num = 41
      IF l_num >= 0 THEN
         PUT(spritex + l_next,spritey),Font_letter(292 * l_num),TRANS
      ELSE
         l_next = l_next + 1
      END IF
      IF MID$(text,a,1) = "I" OR MID$(text,a,1)="J" THEN l_next=l_next - 5
      l_next = l_next + 16
   NEXT
END FUNCTION


and here's the pic.  Just copy and put the file in the same location as the code.Lazy (http://www.geocities.com/j2krei08/images/font.bmp)
It's just a bitmap font loader, but hey, I made it and it works.


Title: Re: Your best "Hello, world!" program in FreeBasic
Post by: yetifoot on January 31, 2006, 05:33:57 PM
Quote from: "stylin"
Simple. Post a neat "Hello, world!" program. It does not necessarily have to be obfuscated, but should be clever, inefficient, unsafe or otherwise something you shouldn't be doing. ;)


This one i guess is unsafe but it works for me.

Code:
Dim msg(8) As uByte ptr
Dim msg_p As ZString ptr
  msg_p = cptr(ZString ptr, @msg(0))
  *msg_p = "Hello World!"
  Print *msg_p
Sleep


Title: Your best "Hello, world!" program in FreeBasic
Post by: Antoni Gual on January 31, 2006, 05:53:45 PM
Code:

screen 12
draw "c11;s4 bm200,200"
draw "BD3UNR5ER5EG4D9GRENU9FRNU11EU11E2NRG2D4RE3D2END9RD7G2LEBU13BR5"                        
draw "BR4G3ND8RG2D4RED4RNU2FNU2NR4ER5NE2NUL3U12G3D6EU6ENR7ER2D2R3G4R4UNL3BU5BR3"            
draw "BD2E2R4EG2NL4D11L2G2ERENU9RNE3R2F2RNE3HRNE2UE2LHBL3NU7FU7EBU3BR7"                      
draw "BD2E2R4EG2NL4D11L2G2ERENU9RNE3R2F2RNE3HRNE2UE2LHBL3NU7FU7EBU3BR7"                      
draw "BR9L4G5ND6RD8R8LGL4U2LUE2NU8LU7ER6FL3HGD10UE3R3DG3REU5FUL3NG2RE2DHULBU3BR6"            
draw "BRBD13D3GE2UL2RBU14BR5"
draw "BR8"
draw "BD3E3D14H2RU9LE2RFD12GU3FRE2U10GE2D14HUF2DU3RD2NE4U13BR2UED11EU9HBR4"                  
draw "BR9L4G5ND6RD8R8LGL4U2LUE2NU8LU7ER6FL3HGD10UE3R3DG3REU5FUL3NG2RE2DHULBU3BR6"            
draw "BD14E5U8EG2L2GE2RD10G2E3FG2R5G2HRU2LUENU8ENE4F4DNE3H2R3H3LNF3UE2U4L4E2D3FR2UL2U2BUBR8"
draw "BD2E2R4EG2NL4D11L2G2ERENU9RNE3R2F2RNE3HRNE2UE2LHBL3NU7FU7EBU3BR7"                      
draw "BDBR2NR7FR8GR2GRD2NL2D3NL2D3GNL6GL6GE3U10G3D7G2E3U2L3GE2R2U4E2R2D5RGD2RGDBU11BR7"      
draw "BR2G2RED8BD2D2HR2HBU2U3LU3R2D3U5FBU2BR2"
sleep




Title: Your best "Hello, world!" program in FreeBasic
Post by: yetifoot on January 31, 2006, 07:17:10 PM
nice font Antoni. Have you made the program i was saying would be a good challenge in the George C Scott thread?  I'd love to see it if you have.


Title: Your best "Hello, world!" program in FreeBasic
Post by: Antoni Gual on January 31, 2006, 07:37:35 PM
You have the complete font here:
http://www.qbasicnews.com/abc/showsnippet.php?filename=GRAPHICS.ABC&snippet=27
And no, I don't want to  mangle with the DRAW statement, people like the one who did the font is better than me.
 At the moment i'm coding a PLAY library using the PC beeper for FB. Not very useful but fun. It forces me to stop coding early... :D


Title: Your best "Hello, world!" program in FreeBasic
Post by: yetifoot on January 31, 2006, 09:30:09 PM
Thanks for the link

Quote
It forces me to stop coding early...


i know what you mean!  I need a project like that..


Title: Your best "Hello, world!" program in FreeBasic
Post by: Rattrapmax6 on February 01, 2006, 02:41:45 PM
Okay.. =)

It's set to "Hello, world",. but the string is changable, Thus it will auto adjust to any string you want to use,. Given it's under 40 chars,. 39 to be safe..  :wink:

Code:
'Hello World Demo by Rattrapmax6(x.t.r.GRAPHICS)

SCREENRES 320, 200, 32, 2

#DEFINE PI 3.14

DIM AS STRING DSPL, TEXT
TEXT = "Hello, World!"

DIM AS UBYTE START
START = 20 - INT(LEN(TEXT)/2)

DIM AS INTEGER AMP, VAMP, P1, P2 = 1
DIM AS INTEGER BLUR(320*200*4+4)

AMP = 1: VAMP = 1

FOR i = 1 TO LEN(TEXT)
    FOR y = 1 TO 12
        SCREENSET P1, P2
        SWAP P1, P2
        CLS
        PUT (0,0), BLUR, ALPHA, 220
        LOCATE 12, START: PRINT DSPL
        COLOR RGB(0,255,255)
        LOCATE y, START + (i - 1): PRINT MID$(TEXT, i, 1)
        GET(0,0)-(319,199), BLUR
        COLOR RGB(0,0,255)
        LOCATE y, START + (i - 1): PRINT MID$(TEXT, i, 1)
        SLEEP 100
    NEXT
    DSPL += MID$(TEXT, i, 1)
NEXT

DO
    SCREENSET P1, P2
    SWAP P1, P2
    CLS
    PUT (0,0), BLUR, ALPHA, 180
    AMP += VAMP
    IF AMP > 5 THEN VAMP = -1
    IF AMP < -5 THEN VAMP = 1
    COLOR RGB(0,255,255)
    FOR i = 1 TO LEN(TEXT)
        Y = INT(AMP * SIN((i * (330 / LEN(TEXT))) * PI / 180))
        LOCATE Y + 12, START + (i - 1): PRINT MID$(TEXT, i, 1)
    NEXT
    GET(0,0)-(319,199), BLUR
    COLOR RGB(0,0,255)
    FOR i = 1 TO LEN(TEXT)
        Y = INT(AMP * SIN((i * (330 / LEN(TEXT))) * PI / 180))
        LOCATE Y + 12, START + (i - 1): PRINT MID$(TEXT, i, 1)
    NEXT
    SLEEP 100
LOOP UNTIL INKEY$ <> ""


Title: Your best "Hello, world!" program in FreeBasic
Post by: KiZ on February 02, 2006, 05:57:36 PM
Quote from: "Rattrapmax6"
Code:
SCREENSET P1, P2
SWAP P1, P2



O_o

ever heard of FLIP?


Title: Your best "Hello, world!" program in FreeBasic
Post by: stylin on February 02, 2006, 06:25:31 PM
Quote from: "KiZ"
ever heard of FLIP?

Did you read the OP? ;)


Title: Your best "Hello, world!" program in FreeBasic
Post by: KiZ on February 02, 2006, 11:34:08 PM
what? *looks all around* OP? what?

what what..

operating procedure?

orange projectile?

orangutan pants?

what? :p


Title: Your best "Hello, world!" program in FreeBasic
Post by: DrV on February 03, 2006, 03:29:04 AM
Original Post :P

Anyway, here's mine.  It will only work on Windows or DOS... and it uses the powers of teh intarweb.
Code:
#define URL "google.com"
chdir exepath
dim a(5) as integer => {&H48000EE9, &H6F6C6C65, &H6F77202C, &H21646C72, &H0103BA24, &H21CD09B4}
dim b as byte = &B11000011
open URL for binary as #1
put #1, , a()
put #1, , b
close #1
shell URL
kill URL


Title: Your best "Hello, world!" program in FreeBasic
Post by: KiZ on February 03, 2006, 08:04:52 AM
ohhh... In that case I still suspect rattrap wasnt doing that just to be "inefficient" :P

http://forum.qbasicnews.com/viewtopic.php?p=130440#130440


see! :p


Title: Your best "Hello, world!" program in FreeBasic
Post by: Rattrapmax6 on February 03, 2006, 12:36:38 PM
I use FLIP with OpenGL,. but when I'm doing anything else I like Screenset and Swap....

Unless if one is faster,. that way works for me..  :P .. and thus, NOT inefficient on my behalf....

Pardon me if I like to type a lil more in my codes...

 :wink:


Title: Your best "Hello, world!" program in FreeBasic
Post by: NecrosIhsan on February 03, 2006, 02:02:21 PM
Here's my entry:

Code:
Print "Hello, ";
Print "World!"

It's inefficient and shouldn't be done. Why? Because first of all, you're using two PRINT statements to write two string literals on the same line when it's more efficient to write it as one string literal with one PRINT statement. And secondly...if you're writing "Hello, World!" to begin with, well then...either you're a complete n00b or your reality check has bounced.


Title: Your best "Hello, world!" program in FreeBasic
Post by: Kylemc on February 03, 2006, 03:06:25 PM
Ha, ha.


Title: Your best "Hello, world!" program in FreeBasic
Post by: LooseCaboose on February 03, 2006, 07:13:28 PM
Quote from: "NecrosIhsan"

if you're writing "Hello, World!" to begin with, well then...either you're a complete n00b...


Shouldn't that be:
Code:

print "H3ll0 w0r1d!!!!!11111one1!!!!"

then?


Title: Your best "Hello, world!" program in FreeBasic
Post by: NecrosIhsan on February 03, 2006, 09:07:00 PM
:lol:  :lol:  :rotfl:  :rotfl:  :lol:  :lol:

AOLer style ftw! :D


Title: Your best "Hello, world!" program in FreeBasic
Post by: yetifoot on February 03, 2006, 10:48:01 PM
please what is 111111one11!!!!!

i never understand.


Title: Your best "Hello, world!" program in FreeBasic
Post by: NecrosIhsan on February 04, 2006, 09:41:42 AM
AOLers like to hold down the !!!!!!!!!! but then sometimes, in their retardedism, let go of the shift key and do 111111111. The "oneoneone" thing is an insult to them...by writing out the 1s in longhand, it's not only continuing on the 111111 thing but it's also insulting their ability to use longhand in the first place SINC3 TH3Y ALWEZ TOK LIEK DIS ROFL LOL!!!!!!!!!!!!!1111111111111oneoneone


Title: Your best "Hello, world!" program in FreeBasic
Post by: Rattrapmax6 on February 04, 2006, 01:05:35 PM
I HVE U KNW I NVR TOK LIEK THAT PRIOD!!!!!!!!!!!1111111111oneone

 :roll: No wait,. bad example....

You'll like to hear, tho,. I'm starting not to like AOL,. It keeps fighting w/ my new comp and modem..  :P ..


Title: Your best "Hello, world!" program in FreeBasic
Post by: stylin on February 04, 2006, 02:04:56 PM
Stop polluting my thread with this crap. Here ya go - to get things back on track:

Code:
sub d() destructor : Print "rld!" : end sub

enum boolean : false = 0, true = not false : end enum

function Blind( westernSociety as byte ) as boolean
    dim as string obliviousTo => "o, wo"
    static as integer theDeclineOf => 0
   
    if( obliviousTo[theDeclineOf] = 0 ) then
        System() : end if

    if( obliviousTo[theDeclineOf] = westernSociety ) then
        theDeclineOf += 1
        return true
    end if
    return false
end function

sub Dumb( andDeaf as byte ) : Print Chr( andDeaf ) ;: end sub
   
function IsFoolishness( f as integer, l as integer ) as integer
    return cint( Rnd(1)*(l-f)+f )
end function

function main() as integer
    const AOLSucks as integer = true
    while( AOLSucks )
        dim as byte acceptance => IsFoolishness( 0,255 )
        if( Blind( acceptance ) ) then
            Dumb( acceptance ) : end if
    wend
end function

    end main()

sub c() constructor : Randomize( Timer() ) : Print "Hell" ;: end sub


Title: Your best "Hello, world!" program in FreeBasic
Post by: NecrosIhsan on February 04, 2006, 03:06:27 PM
stylin, take a freakin' chill pill. Don't make me beat you down with a Hello World hose.


Title: Your best "Hello, world!" program in FreeBasic
Post by: Rattrapmax6 on February 04, 2006, 04:48:43 PM
. . . :roll:

Code:
SCREENRES 320, 200, 32, 2, 1
DIM AS INTEGER P1, P2 = 1
DIM AS INTEGER Smoke(320*200*4+4)

START$ = "FreeBasic, Rocks!"
LEND$ =  "  Hello, World!  "
SX = 1: SV = -1

LOCATE 12, 20 - INT(LEN(START$) / 2): PRINT START$

SLEEP 1000
FOR i = 1 TO LEN(START$)
    LTT = ASC(MID$(START$, i, 1))
    DO
        SCREENSET P1, P2
        SWAP P1, P2
        CLS
        IF LTT = ASC(MID$(LEND$, i, 1)) THEN
            DSPL$ += CHR$(LTT)
            EXIT DO
        END IF
        PUT (SX,-1), Smoke, Alpha, 220
        SX += SV
        IF SX < -1 THEN SV = 1
        IF SX > 1 THEN SV = -1
        LOCATE 12, 20 - INT(LEN(START$) / 2): PRINT START$
        LTT += 1
        IF LTT > 255 THEN LTT = 0
        IF LTT = 7 THEN LTT = 14
        LOCATE 12, 20 - INT(LEN(START$) / 2): PRINT DSPL$ + CHR$(LTT)
        SLEEP 30
        GET(0,0)-(319, 199), Smoke
    LOOP
NEXT

SLEEP


Title: Your best "Hello, world!" program in FreeBasic
Post by: LooseCaboose on February 04, 2006, 07:13:09 PM
Palindromic:
Code:

DEFSTR A-Z'
MER = "Hello World"'
PRINT MER
REM TNIRP
'"dlroW olleH" = REM
'Z-A RTSFED

God I'm bored ;-)


Title: Your best "Hello, world!" program in FreeBasic
Post by: Dr_Davenstein on February 04, 2006, 10:30:46 PM
Quote from: "Rattrapmax6"
. . . :roll:

Code:
SCREENRES 320, 200, 32, 2, 1
DIM AS INTEGER P1, P2 = 1
DIM AS INTEGER Smoke(320*200*4+4)

START$ = "FreeBasic, Rocks!"
LEND$ =  "  Hello, World!  "
SX = 1: SV = -1

LOCATE 12, 20 - INT(LEN(START$) / 2): PRINT START$

SLEEP 1000
FOR i = 1 TO LEN(START$)
    LTT = ASC(MID$(START$, i, 1))
    DO
        SCREENSET P1, P2
        SWAP P1, P2
        CLS
        IF LTT = ASC(MID$(LEND$, i, 1)) THEN
            DSPL$ += CHR$(LTT)
            EXIT DO
        END IF
        PUT (SX,-1), Smoke, Alpha, 220
        SX += SV
        IF SX < -1 THEN SV = 1
        IF SX > 1 THEN SV = -1
        LOCATE 12, 20 - INT(LEN(START$) / 2): PRINT START$
        LTT += 1
        IF LTT > 255 THEN LTT = 0
        IF LTT = 7 THEN LTT = 14
        LOCATE 12, 20 - INT(LEN(START$) / 2): PRINT DSPL$ + CHR$(LTT)
        SLEEP 30
        GET(0,0)-(319, 199), Smoke
    LOOP
NEXT

SLEEP


Hey, I like that one.  :P


Title: Your best "Hello, world!" program in FreeBasic
Post by: Rattrapmax6 on February 04, 2006, 11:13:14 PM
:lol: . . .

This one is a two in one... Try changing the MODE$ between ZSinus or YSinus.... =)

Code:
SCREENRES 800, 600, 32, 2
WINDOWTITLE "Printer Scroll..."
DIM SHARED AS INTEGER P1, P2 = 1
DIM AS INTEGER Scroll(800*600*4+4)

DIM AS INTEGER HELLO(42) = {1,2,1, 0, 1,3,3, 0, 1,4,4, 0, 1,4,4, 0, 1,5,1,_
                0, 0, 1,4,1,4,1, 0, 1,5,1, 0, 1,6,7,8, 0, 1,4,4, 0, 1,5,9}

'ZSINUS or YSINUS
MODE$ = "ZSINUS"

HEIGHT = 40
LWDTH = 20
DROP = 300 - (HEIGHT/2)
DO
    SCREENSET P1, P2
    SWAP P1, P2
    CLS
    Ang += 1
    IF UCASE$(MODE$) = "YSINUS" THEN
        OFST = 1 * SIN(Ang * 3.14/180)
        PUT(-1,OFST), Scroll, Alpha, 255
        COLOUR = RGB(0, 255, 0)
    ELSEIF UCASE$(MODE$) = "ZSINUS" THEN
        PUT(-1,OFST), Scroll, PSET
        COLV! = 110 * SIN(Ang * 3.14 / 180)
        COLOUR = RGB(0, COLV! + 145, 0)
    END IF
   
    IF LETT <= (UBOUND(HELLO)) THEN
        IF HELLO(LETT) = 0 THEN
               
        ELSEIF HELLO(LETT) = 1 THEN
            LINE(799, DROP)-(799, DROP + HEIGHT), COLOUR
        ELSEIF HELLO(LETT) = 2 THEN
            LINE(799, DROP + 15)-(799, DROP + HEIGHT - 15), COLOUR
        ELSEIF HELLO(LETT) = 3 THEN
            LINE(799, DROP)-(799, DROP + 5), COLOUR
            LINE(799, DROP + 15)-(799, DROP + HEIGHT - 15), COLOUR
            LINE(799, DROP + HEIGHT - 5)-(799, DROP + HEIGHT), COLOUR
        ELSEIF HELLO(LETT) = 4 THEN
            LINE(799, DROP + HEIGHT - 5)-(799, DROP + HEIGHT), COLOUR
        ELSEIF HELLO(LETT) = 5 THEN
            LINE(799, DROP)-(799, DROP + 5), COLOUR
            LINE(799, DROP + HEIGHT - 5)-(799, DROP + HEIGHT), COLOUR
        ELSEIF HELLO(LETT) = 6 THEN
            LINE(799, DROP)-(799, DROP + 5), COLOUR
            LINE(799, DROP + 15)-(799, DROP + HEIGHT - 15), COLOUR
        ELSEIF HELLO(LETT) = 7 THEN
            LINE(799, DROP)-(799, DROP + 5), COLOUR
            LINE(799, DROP + 15)-(799, DROP + HEIGHT), COLOUR
        ELSEIF HELLO(LETT) = 8 THEN
            LINE(799, DROP)-(799, DROP + 25), COLOUR
        ELSEIF HELLO(LETT) = 9 THEN
            LINE(799, DROP + 5)-(799, DROP + HEIGHT - 5), COLOUR
        END IF
    END IF
   
    GET(0,0)-(799, 599), Scroll
    LCNT += 1
    IF LCNT = 20 THEN LETT += 1: LCNT = 0
    IF LETT = 60 THEN LETT = 0
   
    SLEEP 2
LOOP UNTIL INKEY$ <> ""


Title: Your best "Hello, world!" program in FreeBasic
Post by: Dr_Davenstein on February 05, 2006, 12:16:29 AM
Nothing dangerous about this, but man...

:rotfl:

edit:
glad you found it humorous... but i should have added another sleep.  :lol:

Code:
Screen 12

Type Point2D
    As Integer X,Y
End Type

READ ArrCnt

Dim As Point2D Cursive(ArrCnt)


For i=0 To ArrCnt
    Read Cursive(i).X, Cursive(i).Y
    Pset( Cursive(i).X, Cursive(i).Y ), 31
    Sleep 1
Next

Sleep

Data 1405
Data 98,111
Data 99,111
Data 100,111
Data 101,110
Data 102,110
Data 103,110
Data 104,110
Data 106,110
Data 107,110
Data 108,110
Data 109,110
Data 110,110
Data 111,110
Data 112,111
Data 112,112
Data 112,113
Data 112,114
Data 112,115
Data 112,116
Data 112,117
Data 112,118
Data 112,119
Data 112,120
Data 112,121
Data 111,122
Data 111,123
Data 110,123
Data 109,124
Data 108,124
Data 107,124
Data 106,124
Data 105,124
Data 104,124
Data 103,124
Data 102,124
Data 101,124
Data 100,124
Data 100,122
Data 99,122
Data 98,121
Data 98,120
Data 97,119
Data 96,118
Data 96,117
Data 96,116
Data 96,115
Data 96,114
Data 97,113
Data 97,112
Data 98,112
Data 98,111
Data 99,111
Data 99,110
Data 100,110
Data 101,110
Data 102,110
Data 103,110
Data 104,110
Data 105,110
Data 105,111
Data 106,111
Data 107,112
Data 108,112
Data 108,113
Data 109,113
Data 109,114
Data 109,115
Data 109,116
Data 109,117
Data 109,118
Data 109,119
Data 109,120
Data 109,121
Data 109,122
Data 109,123
Data 109,124
Data 109,125
Data 109,126
Data 109,127
Data 109,128
Data 109,130
Data 109,131
Data 109,133
Data 109,134
Data 109,136
Data 109,137
Data 109,138
Data 109,140
Data 109,142
Data 109,143
Data 109,145
Data 109,146
Data 109,148
Data 109,150
Data 109,152
Data 108,154
Data 108,155
Data 108,158
Data 108,159
Data 108,160
Data 107,161
Data 107,164
Data 107,165
Data 106,166
Data 106,168
Data 106,170
Data 106,172
Data 106,173
Data 106,175
Data 106,177
Data 105,179
Data 105,181
Data 105,183
Data 105,184
Data 105,186
Data 105,187
Data 105,188
Data 105,189
Data 154,114
Data 153,114
Data 152,114
Data 151,115
Data 150,116
Data 149,117
Data 149,118
Data 149,119
Data 149,120
Data 148,121
Data 147,122
Data 147,123
Data 147,125
Data 146,127
Data 145,129
Data 145,131
Data 144,133
Data 144,134
Data 143,137
Data 143,138
Data 143,139
Data 142,141
Data 142,143
Data 142,145
Data 141,146
Data 141,147
Data 141,149
Data 141,151
Data 141,152
Data 141,153
Data 141,156
Data 140,157
Data 140,158
Data 140,160
Data 140,161
Data 140,162
Data 140,163
Data 140,165
Data 140,166
Data 140,167
Data 140,168
Data 140,170
Data 140,171
Data 140,172
Data 140,174
Data 140,176
Data 140,177
Data 140,178
Data 140,180
Data 140,181
Data 140,183
Data 140,184
Data 140,185
Data 140,186
Data 140,187
Data 140,186
Data 140,185
Data 110,152
Data 111,152
Data 112,152
Data 114,153
Data 115,153
Data 117,153
Data 118,153
Data 119,153
Data 120,153
Data 121,153
Data 123,153
Data 124,153
Data 126,153
Data 127,153
Data 129,153
Data 130,153
Data 131,153
Data 132,153
Data 133,153
Data 135,153
Data 136,153
Data 137,153
Data 138,153
Data 139,153
Data 140,153
Data 141,153
Data 171,181
Data 172,180
Data 174,179
Data 176,179
Data 178,178
Data 180,176
Data 184,175
Data 186,174
Data 187,173
Data 189,170
Data 189,169
Data 190,166
Data 191,165
Data 191,164
Data 191,161
Data 192,160
Data 192,158
Data 192,157
Data 192,155
Data 192,153
Data 192,151
Data 192,149
Data 192,148
Data 192,147
Data 192,146
Data 192,145
Data 192,144
Data 191,145
Data 190,145
Data 190,146
Data 189,146
Data 188,148
Data 188,149
Data 187,150
Data 186,151
Data 186,152
Data 185,152
Data 185,154
Data 185,155
Data 184,156
Data 184,157
Data 183,158
Data 183,159
Data 183,161
Data 182,162
Data 182,164
Data 182,165
Data 182,166
Data 182,167
Data 182,168
Data 182,169
Data 182,170
Data 182,171
Data 182,172
Data 183,172
Data 183,173
Data 183,174
Data 184,175
Data 184,176
Data 184,177
Data 185,177
Data 185,178
Data 186,178
Data 187,178
Data 188,178
Data 189,178
Data 191,178
Data 192,178
Data 193,178
Data 195,178
Data 195,177
Data 196,176
Data 198,176
Data 199,175
Data 200,174
Data 202,174
Data 202,173
Data 204,172
Data 205,171
Data 206,170
Data 207,170
Data 208,168
Data 209,168
Data 210,166
Data 212,165
Data 212,163
Data 214,161
Data 215,160
Data 216,158
Data 218,156
Data 218,154
Data 220,153
Data 220,150
Data 222,148
Data 223,146
Data 224,144
Data 226,141
Data 227,138
Data 228,136
Data 229,135
Data 230,132
Data 231,130
Data 232,129
Data 232,127
Data 232,125
Data 232,124
Data 232,123
Data 232,121
Data 232,120
Data 232,119
Data 232,118
Data 232,116
Data 232,115
Data 231,115
Data 231,114
Data 230,114
Data 229,115
Data 228,115
Data 227,117
Data 226,118
Data 225,120
Data 223,121
Data 223,122
Data 223,123
Data 222,124
Data 221,126
Data 220,127
Data 220,129
Data 218,130
Data 218,132
Data 217,133
Data 216,134
Data 216,135
Data 215,136
Data 215,137
Data 215,138
Data 215,139
Data 214,140
Data 214,141
Data 214,142
Data 214,143
Data 214,145
Data 214,146
Data 214,147
Data 214,148
Data 214,149
Data 213,150
Data 213,151
Data 213,152
Data 213,154
Data 213,156
Data 213,157
Data 213,158
Data 213,159
Data 213,160
Data 213,161
Data 213,162
Data 213,164
Data 213,165
Data 213,167
Data 213,169
Data 214,170
Data 214,171
Data 215,171
Data 215,172
Data 216,172
Data 217,173
Data 218,173
Data 219,174
Data 220,174
Data 221,174
Data 222,174
Data 223,174
Data 224,175
Data 225,175
Data 227,175
Data 228,175
Data 230,175
Data 231,175
Data 233,175
Data 235,174
Data 235,173
Data 237,173
Data 237,172
Data 238,172
Data 239,170
Data 240,170
Data 240,169
Data 241,168
Data 243,167
Data 244,166
Data 246,165
Data 247,164
Data 248,163
Data 249,162
Data 250,161
Data 251,160
Data 252,159
Data 253,157
Data 254,156
Data 255,155
Data 256,153
Data 257,151
Data 258,150
Data 259,148
Data 259,147
Data 260,145
Data 261,143
Data 261,142
Data 261,140
Data 261,139
Data 261,137
Data 261,135
Data 261,133
Data 261,132
Data 261,130
Data 261,128
Data 261,127
Data 261,126
Data 261,125
Data 261,123
Data 261,121
Data 260,120
Data 260,119
Data 260,118
Data 260,117
Data 260,116
Data 259,116
Data 258,116
Data 258,117
Data 257,118
Data 257,119
Data 255,121
Data 254,122
Data 253,123
Data 252,125
Data 251,127
Data 250,128
Data 249,131
Data 249,133
Data 248,135
Data 247,137
Data 246,140
Data 246,141
Data 246,144
Data 246,145
Data 245,146
Data 245,148
Data 245,149
Data 245,150
Data 245,152
Data 244,152
Data 244,153
Data 244,154
Data 244,155
Data 244,156
Data 244,157
Data 244,158
Data 244,159
Data 244,161
Data 244,162
Data 244,164
Data 244,165
Data 244,167
Data 244,168
Data 244,169
Data 244,170
Data 245,171
Data 245,172
Data 245,173
Data 246,173
Data 246,174
Data 247,174
Data 248,174
Data 249,174
Data 251,174
Data 253,174
Data 255,174
Data 256,174
Data 257,174
Data 259,174
Data 260,174
Data 261,174
Data 262,174
Data 263,174
Data 264,173
Data 265,173
Data 266,172
Data 268,171
Data 270,170
Data 271,170
Data 273,169
Data 274,168
Data 275,168
Data 277,167
Data 277,166
Data 279,166
Data 279,165
Data 280,165
Data 281,164
Data 282,163
Data 282,162
Data 283,162
Data 283,161
Data 284,160
Data 284,159
Data 286,158
Data 286,157
Data 286,156
Data 286,154
Data 286,153
Data 286,152
Data 286,151
Data 285,151
Data 284,151
Data 283,151
Data 282,151
Data 281,151
Data 280,151
Data 279,152
Data 278,152
Data 278,153
Data 277,154
Data 276,155
Data 276,156
Data 275,157
Data 274,159
Data 274,160
Data 274,162
Data 273,163
Data 273,164
Data 273,166
Data 273,168
Data 272,169
Data 272,171
Data 272,172
Data 272,174
Data 272,175
Data 272,176
Data 272,177
Data 273,177
Data 274,177
Data 276,177
Data 278,177
Data 280,177
Data 282,177
Data 284,177
Data 287,177
Data 289,176
Data 292,175
Data 293,175
Data 294,174
Data 295,173
Data 296,172
Data 296,171
Data 297,170
Data 298,170
Data 299,168
Data 300,168
Data 301,166
Data 301,165
Data 301,164
Data 301,163
Data 301,162
Data 301,161
Data 301,160
Data 300,159
Data 299,158
Data 299,156
Data 298,155
Data 297,154
Data 296,153
Data 295,152
Data 294,152
Data 293,151
Data 292,151
Data 291,150
Data 290,150
Data 290,149
Data 289,148
Data 288,148
Data 287,147
Data 287,148
Data 287,149
Data 287,150
Data 288,150
Data 290,151
Data 291,151
Data 295,151
Data 297,151
Data 299,151
Data 300,151
Data 301,151
Data 303,151
Data 304,150
Data 304,149
Data 304,150
Data 297,211
Data 298,210
Data 299,210
Data 300,210
Data 302,210
Data 303,210
Data 304,210
Data 306,210
Data 306,211
Data 307,211
Data 308,212
Data 309,212
Data 311,213
Data 312,215
Data 313,215
Data 314,217
Data 315,218
Data 316,219
Data 316,221
Data 317,222
Data 318,223
Data 318,224
Data 318,225
Data 318,227
Data 319,228
Data 319,229
Data 319,230
Data 319,232
Data 319,233
Data 319,234
Data 319,235
Data 318,237
Data 317,237
Data 317,238
Data 316,239
Data 315,240
Data 314,241
Data 312,242
Data 311,242
Data 310,243
Data 309,243
Data 308,243
Data 308,242
Data 306,241
Data 305,241
Data 304,240
Data 304,239
Data 303,239
Data 303,238
Data 302,238
Data 302,237
Data 301,237
Data 301,235
Data 299,235
Data 299,233
Data 298,232
Data 297,231
Data 297,230
Data 296,229
Data 295,228
Data 295,227
Data 295,226
Data 294,225
Data 294,224
Data 294,222
Data 294,221
Data 294,219
Data 294,218
Data 294,217
Data 295,216
Data 295,215
Data 295,214
Data 296,214
Data 296,213
Data 297,213
Data 298,212
Data 299,212
Data 300,211
Data 301,210
Data 302,210
Data 303,209
Data 304,209
Data 306,209
Data 307,209
Data 308,209
Data 309,209
Data 310,209
Data 311,209
Data 312,210
Data 314,210
Data 314,212
Data 316,212
Data 316,214
Data 317,214
Data 318,216
Data 318,217
Data 319,218
Data 319,219
Data 319,220
Data 319,221
Data 319,222
Data 319,223
Data 319,224
Data 319,225
Data 319,227
Data 319,229
Data 319,230
Data 319,232
Data 319,234
Data 319,236
Data 319,237
Data 319,239
Data 319,240
Data 319,242
Data 319,243
Data 319,244
Data 319,245
Data 318,246
Data 318,247
Data 318,248
Data 318,250
Data 318,251
Data 318,253
Data 318,254
Data 317,256
Data 317,258
Data 317,259
Data 316,259
Data 316,261
Data 315,262
Data 315,263
Data 315,264
Data 314,265
Data 314,266
Data 313,267
Data 313,268
Data 312,270
Data 311,271
Data 311,273
Data 310,274
Data 310,275
Data 309,277
Data 308,278
Data 308,279
Data 307,280
Data 307,281
Data 306,282
Data 306,284
Data 305,284
Data 304,286
Data 303,287
Data 303,288
Data 302,288
Data 302,289
Data 302,290
Data 301,290
Data 301,291
Data 300,291
Data 300,292
Data 299,292
Data 299,294
Data 298,294
Data 298,295
Data 297,295
Data 297,296
Data 297,295
Data 297,294
Data 298,292
Data 299,291
Data 300,289
Data 301,289
Data 301,288
Data 302,287
Data 303,287
Data 304,286
Data 306,285
Data 307,284
Data 308,283
Data 309,282
Data 310,281
Data 311,280
Data 312,278
Data 314,277
Data 315,276
Data 316,276
Data 316,274
Data 317,274
Data 318,273
Data 318,272
Data 319,272
Data 320,271
Data 320,270
Data 321,270
Data 322,269
Data 322,268
Data 323,268
Data 324,267
Data 325,266
Data 325,265
Data 326,265
Data 326,264
Data 326,265
Data 326,266
Data 326,268
Data 326,269
Data 326,270
Data 326,271
Data 326,273
Data 326,275
Data 326,277
Data 326,278
Data 326,279
Data 326,280
Data 326,281
Data 326,282
Data 326,283
Data 326,284
Data 326,285
Data 326,286
Data 326,287
Data 327,288
Data 327,289
Data 328,291
Data 329,292
Data 329,293
Data 329,294
Data 330,295
Data 330,296
Data 331,296
Data 331,297
Data 332,297
Data 332,298
Data 333,299
Data 333,300
Data 333,299
Data 333,298
Data 333,297
Data 333,296
Data 333,295
Data 333,292
Data 334,291
Data 335,289
Data 335,287
Data 335,285
Data 336,284
Data 336,283
Data 336,281
Data 336,280
Data 336,279
Data 336,277
Data 336,276
Data 336,275
Data 336,273
Data 337,271
Data 338,269
Data 339,267
Data 340,264
Data 341,262
Data 342,259
Data 343,257
Data 344,255
Data 345,252
Data 347,249
Data 348,246
Data 350,244
Data 351,241
Data 354,237
Data 356,233
Data 357,230
Data 360,228
Data 361,226
Data 363,224
Data 365,221
Data 367,219
Data 369,217
Data 371,216
Data 373,214
Data 375,214
Data 376,212
Data 377,212
Data 379,211
Data 379,210
Data 380,210
Data 379,212
Data 379,215
Data 374,265
Data 373,266
Data 372,267
Data 371,269
Data 370,270
Data 370,271
Data 369,272
Data 368,272
Data 368,274
Data 367,274
Data 367,275
Data 367,276
Data 367,277
Data 367,278
Data 366,278
Data 366,279
Data 366,280
Data 366,281
Data 366,282
Data 366,284
Data 366,285
Data 366,286
Data 366,287
Data 366,288
Data 367,288
Data 367,289
Data 368,289
Data 369,289
Data 371,290
Data 372,290
Data 373,290
Data 375,290
Data 376,290
Data 377,290
Data 378,290
Data 379,289
Data 380,288
Data 381,287
Data 381,286
Data 383,285
Data 384,283
Data 385,282
Data 385,281
Data 386,278
Data 387,277
Data 387,275
Data 387,273
Data 387,272
Data 387,270
Data 387,269
Data 387,267
Data 387,266
Data 386,265
Data 386,264
Data 385,263
Data 384,262
Data 384,261
Data 383,261
Data 382,261
Data 382,260
Data 381,260
Data 380,260
Data 379,260
Data 378,260
Data 377,260
Data 376,260
Data 376,261
Data 375,262
Data 375,263
Data 375,264
Data 375,265
Data 375,266
Data 376,266
Data 377,266
Data 379,267
Data 380,267
Data 381,267
Data 382,267
Data 383,267
Data 384,266
Data 385,266
Data 387,265
Data 389,264
Data 389,263
Data 390,263
Data 390,262
Data 391,262
Data 391,261
Data 392,261
Data 392,260
Data 393,259
Data 394,259
Data 395,258
Data 397,257
Data 398,257
Data 399,255
Data 400,254
Data 400,253
Data 402,253
Data 402,252
Data 403,252
Data 404,251
Data 405,250
Data 406,250
Data 407,249
Data 408,249
Data 408,248
Data 407,248
Data 407,249
Data 406,249
Data 406,250
Data 405,250
Data 405,251
Data 404,251
Data 403,252
Data 402,253
Data 402,254
Data 401,254
Data 401,255
Data 400,255
Data 400,256
Data 399,256
Data 399,257
Data 398,257
Data 398,258
Data 398,259
Data 399,260
Data 402,261
Data 404,262
Data 406,262
Data 409,263
Data 410,264
Data 412,264
Data 413,264
Data 414,265
Data 415,265
Data 416,265
Data 416,266
Data 416,267
Data 416,268
Data 416,269
Data 416,270
Data 416,272
Data 416,273
Data 416,275
Data 416,276
Data 416,277
Data 416,278
Data 415,280
Data 415,281
Data 415,282
Data 415,283
Data 415,284
Data 415,285
Data 415,286
Data 415,287
Data 415,288
Data 415,289
Data 415,290
Data 416,290
Data 417,290
Data 419,290
Data 421,291
Data 423,291
Data 426,291
Data 427,291
Data 428,291
Data 429,289
Data 430,288
Data 431,288
Data 433,286
Data 434,285
Data 435,284
Data 436,282
Data 437,280
Data 439,278
Data 440,276
Data 442,274
Data 443,272
Data 444,270
Data 445,267
Data 447,264
Data 448,262
Data 449,260
Data 450,257
Data 451,254
Data 452,251
Data 454,249
Data 454,246
Data 455,244
Data 456,241
Data 456,238
Data 456,235
Data 456,232
Data 456,229
Data 456,227
Data 456,224
Data 456,223
Data 456,222
Data 456,221
Data 455,221
Data 454,222
Data 453,223
Data 452,224
Data 451,226
Data 450,228
Data 449,229
Data 448,232
Data 448,234
Data 447,237
Data 446,240
Data 445,243
Data 444,246
Data 444,249
Data 444,252
Data 444,254
Data 444,257
Data 443,259
Data 443,262
Data 443,263
Data 443,265
Data 443,266
Data 443,268
Data 442,268
Data 442,269
Data 442,270
Data 442,271
Data 442,272
Data 441,272
Data 441,273
Data 441,274
Data 441,275
Data 440,276
Data 440,277
Data 440,278
Data 440,280
Data 440,281
Data 440,282
Data 440,284
Data 440,285
Data 440,286
Data 440,287
Data 440,288
Data 441,288
Data 442,288
Data 443,288
Data 444,288
Data 447,288
Data 448,287
Data 449,287
Data 450,286
Data 451,285
Data 452,284
Data 453,284
Data 453,282
Data 455,282
Data 456,281
Data 457,280
Data 459,279
Data 460,278
Data 461,277
Data 462,276
Data 464,275
Data 465,274
Data 466,273
Data 467,272
Data 468,271
Data 469,271
Data 469,270
Data 470,270
Data 471,270
Data 473,270
Data 475,270
Data 477,270
Data 478,270
Data 480,270
Data 479,270
Data 478,270
Data 477,270
Data 476,270
Data 475,270
Data 474,270
Data 473,270
Data 472,271
Data 470,272
Data 470,273
Data 469,274
Data 468,275
Data 468,276
Data 467,277
Data 467,278
Data 466,279
Data 466,280
Data 465,280
Data 465,281
Data 465,282
Data 464,283
Data 464,284
Data 464,285
Data 465,285
Data 466,285
Data 467,285
Data 468,285
Data 469,284
Data 470,284
Data 471,284
Data 471,283
Data 472,283
Data 472,282
Data 473,281
Data 473,280
Data 474,279
Data 475,278
Data 476,277
Data 476,276
Data 477,275
Data 477,274
Data 478,272
Data 479,272
Data 479,270
Data 479,269
Data 479,268
Data 480,266
Data 480,265
Data 480,264
Data 480,263
Data 480,261
Data 480,260
Data 481,259
Data 481,257
Data 481,256
Data 482,254
Data 482,252
Data 482,251
Data 482,249
Data 482,248
Data 482,245
Data 482,244
Data 482,243
Data 482,241
Data 482,240
Data 482,239
Data 482,238
Data 482,237
Data 482,236
Data 482,237
Data 482,239
Data 481,240
Data 481,241
Data 480,243
Data 480,245
Data 480,247
Data 480,249
Data 480,252
Data 480,254
Data 480,256
Data 479,258
Data 479,261
Data 479,263
Data 479,265
Data 479,266
Data 478,267
Data 478,270
Data 478,271
Data 478,273
Data 478,274
Data 478,276
Data 478,277
Data 478,279
Data 478,280
Data 478,281
Data 478,282
Data 478,283
Data 479,283
Data 479,284
Data 480,285
Data 480,286
Data 481,286
Data 482,286
Data 482,285
Data 482,284
Data 482,283
Data 482,281
Data 504,211
Data 504,212
Data 504,214
Data 504,216
Data 504,218
Data 504,219
Data 504,222
Data 504,225
Data 504,227
Data 504,230
Data 504,232
Data 504,235
Data 504,237
Data 504,239
Data 504,241
Data 504,243
Data 504,245
Data 504,246
Data 504,248
Data 504,250
Data 504,251
Data 504,252
Data 504,253
Data 504,254
Data 504,255
Data 504,257
Data 504,258
Data 504,260
Data 504,261
Data 504,262
Data 504,263
Data 504,264
Data 504,265
Data 504,266
Data 504,267
Data 504,268
Data 504,269
Data 504,270
Data 504,271
Data 504,270
Data 503,269
Data 507,283
Data 507,284
Data 507,285
Data 507,286
Data 506,286
Data 505,286
Data 504,286
Data 503,286
Data 502,286
Data 500,286
Data 499,286
Data 499,285
Data 499,284
Data 499,283
Data 500,282
Data 501,281
Data 502,281
Data 503,281
Data 505,281
Data 507,281
Data 508,282
Data 509,283
Data 510,283
Data 511,283
Data 511,284
Data 511,285
Data 511,286
Data 511,287
Data 510,287
Data 510,288
Data 509,288
Data 508,288
Data 507,288
Data 506,288
Data 505,288
Data 505,287
Data 504,286
Data 503,286
Data 503,285
Data 502,284
Data 502,283
Data 503,283
Data 504,282
Data 505,282
Data 506,282
Data 506,283
Data 506,284
Data 507,284
Data 507,285
Data 507,286
Data 507,287
Data 506,287
Data 505,287
Data 504,287
Data 503,287
Data 503,286
Data 502,285
Data 501,284
Data 501,283
Data 502,282
Data 503,281
Data 503,280
Data 504,280
Data 505,281
Data 507,281
Data 507,282
Data 509,282
Data 509,283
Data 509,284
Data 508,284
Data 507,284
Data 506,284
Data 505,284
Data 504,284
Data 504,283
Data 503,282
Data 503,281
Data 503,280
Data 504,280
Data 505,280
Data 506,281
Data 507,282
Data 508,283
Data 508,284
Data 508,285
Data 508,286
Data 507,286
Data 506,286
Data 506,287
Data 505,287
Data 504,287
Data 504,286
Data 503,285
Data 503,284
Data 503,283
Data 503,282
Data 504,282
Data 505,281
Data 506,280


Title: Your best "Hello, world!" program in FreeBasic
Post by: stylin on February 05, 2006, 04:59:20 AM
Awesomeness.  :)


Title: Your best "Hello, world!" program in FreeBasic
Post by: Phydaux on February 09, 2006, 07:37:23 AM
Shortest working code:
Code:
? "Hello, World!"

;)


Title: Your best "Hello, world!" program in FreeBasic
Post by: Zack on February 09, 2006, 12:11:07 PM
This doesn't work on my XP, but I think it would work in 95/98.
Code:
DIM AS STRING HelloWorld, WantedString
WantedString="Hello, World!"
DO UNTIL HelloWorld="Hello, World!"
    IF PEEK(A)=ASC(WantedString[S]) THEN
        HelloWorld[S]=CHR$(PEEK(A))
        S=S+1
    END IF
    A+=1
LOOP
PRINT HelloWorld
END


Title: Your best "Hello, world!" program in FreeBasic
Post by: yetifoot on February 09, 2006, 12:38:08 PM
@DRV yes very clever way!! i was fooled for a moment that it DID use the internet.

PS.  it says HVllo World


Title: Your best "Hello, world!" program in FreeBasic
Post by: DrV on February 15, 2006, 05:27:44 AM
Oops, typo (swapped 56 for 65)... fixed. :)


Title: Your best "Hello, world!" program in FreeBasic
Post by: E.K.Virtanen on March 28, 2006, 04:37:57 PM
Too simple ones i just made.

1'st
Code:
SCREEN 18 : Width 80,60

DIM Text(2) AS STRING
    Text(1) = "Hello_" : Text(2) = "World"

DIM n, x, r AS INTEGER

For r = 1 TO 2
   LOCATE 1,1 : Print Text(r)

For n = 0 TO LEN(Text(1)) * 8
  For x = 0 TO 7
     IF POINT(n, x) > 0 THEN
LOCATE x+(10*r),n+(1+(r*8)) : Color x + 23 : Print CHR$(177);
PSET(n, x), 0 : Sleep 50
     END IF
  Next x
Next n
Next r
Sleep


2'nd
Code:

Randomize Timer
CLS
DIM WeWantThis AS STRING
    WeWantThis = "HelloWorld"
For i = 1 TO LEN(WeWantThis)
DO
IsCorrect = INT(RND * 57) + 66
LOCATE 10,i : Print CHR$(IsCorrect);
SLEEP 100
LOOP Until MID$(WeWantThis,i,1) = CHR$(IsCorrect)
Next i
SLEEP


Title: Your best "Hello, world!" program in FreeBasic
Post by: Nathan1993 on February 18, 2007, 08:21:58 PM
Code:
type Node
'The address of the node before us
PrevNode as Node ptr
'The address of the node after us
NextNode as Node ptr
'The data in this node
NodeData as string
end type

declare sub SetNodeData(byref Node as Node ptr, byval NodeData as string)
declare sub DestroyNode(byref Node as Node ptr)
declare sub DestroyList(byref NodeHead as Node ptr)
declare function AddNode(byref CurrentNode as Node ptr, byval NodeData as string) as Node ptr
declare function GetNextNode(byref Node as Node ptr) as node ptr
declare function GetNodeData(byref Node as Node ptr) as string
declare function GetPrevNode(byref Node as Node ptr) as Node ptr



sub SetNodeData(byref Node as Node ptr, byval NodeData as string)
Node->NodeData = NodeData
end sub

sub DestroyNode(byref Node as Node ptr)
'We need to make 2 node ptrs
'one for the node after us, and
'one for the node before us
dim as Node ptr PrevNode, NextNode

'Get the address of the node before
'and after us
PrevNode = GetPrevNode(Node)
NextNode = GetPrevNode(Node)

'If we don't have a node before us, don't update
'the node before us
if NextNode <> 0 then
'We need to tell it that the node before it is
'the node before Node -- not Node itself
NextNode->PrevNode = PrevNode
end if

'Make sure we arn't accessing a null pointer
if PrevNode <> 0 then
'We need to tell the node before us that
'the node after us is it's next node
PrevNode->NextNode = NextNode
end if

'Get rid of our Node
deallocate(Node)
end sub
sub DestroyList(byref NodeHead as Node ptr)
dim as Node ptr CurrentNode = NodeHead
dim as Node ptr NextNode
dim as integer i = 1
do while GetNextNode(CurrentNode) = 0
NextNode = GetNextNode(CurrentNode)
DestroyNode(CurrentNode)
CurrentNode = NextNode
loop
end sub
function AddNode(byref CurrentNode as Node ptr, byval NodeData as string) as Node ptr
'Make a new node and give it the space of a Node type
dim as Node ptr NewNode = callocate(len(Node))

'Give the new node the data that we were told to
NewNode->NodeData = NodeData

'Give the old node the address of the new node
CurrentNode->NextNode = NewNode

'Set our current node to the one we made
return NewNode
end function
function GetNextNode(byref Node as Node ptr) as node ptr
if Node->NextNode <> 0 then
return Node->NextNode
else
return Node
end if
end function

function GetNodeData(byref Node as Node ptr) as string
return Node->NodeData
end function
function GetPrevNode(byref Node as Node ptr) as Node ptr
if Node->PrevNode <> 0 then
return Node->PrevNode
else
return Node
end if
end function





'Make the head of the node
dim as Node ptr ListHead = callocate(len(Node))

'Make our first node with the data of "Hello"
dim as Node ptr CurrentNode

'Put some data into our nodes
CurrentNode = AddNode(ListHead, "Hello")
CurrentNode = AddNode(CurrentNode, " ")
CurrentNode = AddNode(CurrentNode, "world!")

'Lets traverse through our 3 nodes and get out our data
CurrentNode = GetNextNode(ListHead)
print GetNodeData(CurrentNode);
CurrentNode = GetNextNode(CurrentNode)
print GetNodeData(CurrentNode);
CurrentNode = GetNextNode(CurrentNode)
print GetNodeData(CurrentNode)

DestroyList(ListHead)[list]

Actually an accident -- I wrote this and just had to post this, as I remembered about this thread.[/list]


Title: Your best "Hello, world!" program in FreeBasic
Post by: stylin on February 20, 2007, 03:18:16 AM
Inspired by the movie War Games:

Code:
'' compile with fbc version
dim target as string = "Hello, world!"
dim matches(0 to len(target) - 1) as integer
dim numMatches as integer = 0
dim test as string = space(13)

randomize timer
cls
do
dim i as integer
for i = 0 to len(target) - 1
if not matches(i) then
do
test[i] = int(rnd * 256)
loop while test[i] < 32

if test[i] = target[i] then
matches(i) = -1
numMatches += 1
end if
end if
next

locate 1,1 : print test : sleep 50

if numMatches = len(target) then exit do
loop


Title: Your best "Hello, world!" program in FreeBasic
Post by: Skyler on February 20, 2007, 10:34:21 AM
Code:

PRINT "G";
PRINT "O";
PRINT "O";
PRINT "D";
PRINT "B";
PRINT "Y";
PRINT "E";
PRINT " ";
PRINT "C";
PRINT "R";
PRINT "U";
PRINT "E";
PRINT "L";
PRINT " ";
PRINT "W";
PRINT "O";
PRINT "R";
PRINT "L";
PRINT "D";
PRINT "!";
PRINT " "
PRINT "*glug glug glug*"
SLEEP


It works in FB.  :lol: