Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make a program that is a person if they were coded!
#43
All behold the ULTIMATE AAP TEXT FORMATTER by yours truly.

Code:
#define BBCODE 1
#define COLOURS 2

#define NORMAL 0
#define BEFORESENTENCE 1
#define BEFOREPARAGRAPH 2

#define RANDOMNESS 25

Dim Shared wordWrapLimit As Integer
Dim text As String
Dim ch As String
Dim whatToDo As Short
Dim state As Short
Dim m As String
Dim o As String
Dim i As Integer, multiUso As Integer, j As Integer
Dim action As Integer

wordWrapLimit = Width And &Hffff

Cls
Print "The AAP text formatter"
Print "======================"

Print
Print "Enter any text (post-long, please, remember that you are pretending to be AAP)"
Print "Press ENTER when you are done. Use # to start a new paragraph, i.e., the text:"
Print
Print "This is Paragraph 1.#This is Paragraph 2."
Print
Print "Consists on two different paragraphs. (Sorry, I'm too lazy to write a proper"
Print "editor."
Print

Line Input text

Print
Print "Now select output format:"
Print "  1.- BBCode, i.e. forum-ready"
Print "  2.- Screen colored output, to delight your senses"
Print

Do
    Locate ,1
    Print "1 or 2 please: ";
    Line Input ch
Loop While (ch <> "1" And ch <> "2")

whatToDo = Val (ch)

state = NORMAL

text = text + " "

For i = 1 To Len (text)

    m = Mid (text, i, 1)

    If m = "." Or m = "," Or m = ";" Then
        state = BEFORESENTENCE
    ElseIf m = "#" Then
        state = BEFOREPARAGRAPH
        m = ""
    End If

    If m = " " Then
        If 1 + Pos + Len (o) > wordWrapLimit Then Print

        action = Int (Rnd * RANDOMNESS) + 1

        Select Case action
            Case 0 To 2:
                multiUso = Int (Rnd * 6) + 1
                If whatToDo <> BBCODE Then
                    Color multiUso
                Else
                    Select Case multiUso
                        Case 1
                            o = "[color=blue]" + o + "[/color]"
                        Case 2
                            o = "[color=red]" + o + "[/color]"
                        Case 3
                            o = "[color=cyan]" + o + "[/color]"
                        Case 4
                            o = "[color=green]" + o + "[/color]"
                        Case 5
                            o = "[color=magenta]" + o + "[/color]"
                        Case 6
                            o = "[color=yellow]" + o + "[/color]"
                    End Select
                End If
            Case 3:
                o = "___" + o + "___"
            Case 4:
                o = "*" + o + "*"
            Case 5:
                o = "^_^;; " + o
            Case 6:
                If whatToDo <> BBCODE Then
                    Color 15
                Else
                    o = "[size=24]" + o + "[/size]"
                End If
            Case 7:
                If whatToDo <> BBCODE Then
                    Color 15
                Else
                    o = "[b]" + o + "[/b]"
                End If
            Case 8:
                If whatToDo <> BBCODE Then
                    Color 15
                Else
                    o = "[i]" + o + "[/i]"
                End If
            Case Else:
                Color 7
        End Select

        Print o; " ";
        o = ""

        If state = BEFORESENTENCE Then

            multiUso = Int (Rnd * RANDOMNESS / 2)

            Select Case multiUso
                Case 1:
                    If whatToDo <> BBCODE Then
                        Color 10
                        Print ";-) ";
                    Else
                        Print "[color=green][b][i];-)[/b][/i][/color] ";
                    End If
                Case 2:
                    Print ":D=b ";
                Case 3:
                    Print "d=:D=b ";
                Case 4:
                    Print "^o^ ";
                case 5:
                    Print ";)=b ";
                Case 6:
                    Print "d=:) ";
            End Select

        ElseIf state = BEFOREPARAGRAPH Then
            multiUso = Int (Rnd * RANDOMNESS / 8)
            If multiUso <= 1 Then
                multiUso = Int (Rnd * 5) + 5
                Print
                If whatToDo <> BBCODE Then
                    Color 10
                Else
                    Print "[color=green][b][i]";
                End If

                For j = 1 To multiUso
                    Print ";-D ";
                Next j

                If whatToDo <> BBCODE Then
                    Color 7
                Else
                    Print "[/i][/b][/color]"
                End If
                Print
            Else
                Print
                Print
            End If
        End If

        state = NORMAL
    Else
        o = o + m
    End If

Next i

Basicly you enter this:

Quote:Most dearest and worshipped fB/QB4.5/QB7.1/QBasic/VB/Ratass community:#This is just a test to see if this stupid engine works. I remember how, a couple of years ago, someone wondered if AAP did actually spend two hours writing one of his retina-burner BBCODE stravaganzas. I bet he didn't, he just used a proggie like this one.#This is full of bugs as I don't code in BASIC since I can't remember and I've done this in around 10 minutes... So enjoy#

just to get this:

Quote:Most dearest and worshipped fB/QB4.5/QB7.1/QBasic/VB/Ratass Big Grin=b community:

;-D ;-D ;-D ;-D ;-D ;-D ;-D ;-D
This is just a test to see if this stupid engine *works.* I *remember* how, ;-) a *couple* ___of___ years ago, d=Smile someone wondered if AAP did actually spend two hours writing one of his retina-burner BBCODE stravaganzas. I bet ___he___ ^_^;; didn't, he just used a proggie like this one.

This is full of bugs as I don't code in BASIC since I can't remember and ^_^;; I've done this in around 10 minutes... ^o^ So enjoy d=Big Grin=b
;-D ;-D ;-D ;-D ;-D

:lol:
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Messages In This Thread
Make a program that is a person if they were coded! - by Anonymous - 03-30-2006, 04:13 PM
Make a program that is a person if they were coded! - by Anonymous - 03-30-2006, 05:07 PM
Make a program that is a person if they were coded! - by Anonymous - 03-30-2006, 11:19 PM
Make a program that is a person if they were coded! - by Anonymous - 03-31-2006, 02:14 PM
Make a program that is a person if they were coded! - by na_th_an - 04-04-2006, 08:25 PM
Make a program that is a person if they were coded! - by Anonymous - 04-04-2006, 11:43 PM
Make a program that is a person if they were coded! - by Anonymous - 04-25-2006, 08:30 AM
Make a program that is a person if they were coded! - by Anonymous - 05-03-2006, 03:34 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)