Palindrome is possible ?????

New to FreeBASIC? Post your questions here.
mekenmk
Posts: 1
Joined: Sep 24, 2012 20:40

Palindrome is possible ?????

Postby mekenmk » Sep 24, 2012 20:55

I'm trying to make a palindrome in FreeBASIC. someone already did ???? .... o.O
Richard
Posts: 2964
Joined: Jan 15, 2007 20:44
Location: Australia

Re: Palindrome is possible ?????

Postby Richard » Sep 24, 2012 21:46

Code: Select all

' palindrome
Dim As Integer i
Dim As String s = "step on "

Cls
Locate 2,1
Print s

Locate 4,1
For i = 1 To Len(s)
    Print Mid(s, i, 1);
Next i
For i = Len(s) To 1 Step -1
    Print Mid(s, i, 1);
Next i
Print

Locate 6,1
For i = 1 To Len(s)
    Print Mid(s, i, 1);
Next i
For i = Len(s)-1 To 1 Step -1
    Print Mid(s, i, 1);
Next i
Print

Sleep
Destructosoft
Posts: 88
Joined: Apr 03, 2011 3:44
Location: Inside the bomb
Contact:

Re: Palindrome is possible ?????

Postby Destructosoft » Sep 25, 2012 4:39

FreeBASIC is a beer? F.
codeFoil
Posts: 255
Joined: Dec 22, 2011 4:45
Location: United States
Contact:

Re: Palindrome is possible ?????

Postby codeFoil » Sep 26, 2012 23:56

Perhaps it might be possible in lang qb or fblite, but in lang fb (without a trick header file included on the command line) I would be surpised.
counting_pine
Site Admin
Posts: 6174
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Palindrome is possible ?????

Postby counting_pine » Sep 27, 2012 0:26

What, you mean where the code itself is a palindrome?
Should be easy with comments, e.g: print "hello" ' "olleh" tnirp
codeFoil
Posts: 255
Joined: Dec 22, 2011 4:45
Location: United States
Contact:

Re: Palindrome is possible ?????

Postby codeFoil » Sep 27, 2012 23:37

Color me surprised.... and a little underwhelmed :)

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 1 guest