blob: 2fd17c17e4ba61f1cd9f9b473c60c16f08ea53ef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
Module Com_Cowsay
Public Sub Cowsay(Say As String)
Select Case Say.Length
Case 1 To 40
Dim SubtractLength As Integer = Say.Length + 1
NewLine(" ")
Do
AddLine("_")
SubtractLength = SubtractLength - 1
If SubtractLength = 0 Then
AddLine("_")
SubtractLength = Say.Length + 1
Exit Do
End If
Loop
NewLine("< " & Say & " >")
NewLine(" ")
Do
AddLine("-")
SubtractLength = SubtractLength - 1
If SubtractLength = 0 Then
AddLine("-")
SubtractLength = Say.Length + 1
Exit Do
End If
Loop
NewLine(" \ ^__^")
NewLine(" \ (oo)\_______")
NewLine(" (__)\ )\/\")
NewLine(" ||----w |")
NewLine(" || ||")
Case 41 To 80
NewLine(" __________________________________________ ")
NewLine("/ " & Say.Substring(0, 40) & " \")
Say = Say.Substring(40, Say.Length - 40)
NewLine("\ " & Say)
Dim Spaces As Integer = 40 - Say.Length
Do
AddLine(" ")
If Spaces = 0 Then
AddLine("/")
Exit Do
End If
Spaces = Spaces - 1
Loop
NewLine(" ------------------------------------------ ")
NewLine(" \ ^__^")
NewLine(" \ (oo)\_______")
NewLine(" (__)\ )\/\")
NewLine(" ||----w |")
NewLine(" || ||")
Case >= 81
NewLine("cowsay: Character limit exceeded")
'Dim SubtractLength As Integer = Say.Length + 1
'Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & " __________________________________________ "
'Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "/ " & Say.Substring(0, 40) & " \"
'Dim CurrentLength As Integer = 40
'Dim WhatSay As String
'Dim Spaces As Integer
'Do
' Try
' WhatSay = Say.Substring(CurrentLength, 40)
' Catch ex As Exception
' WhatSay = Say.Substring(CurrentLength, (CurrentLength + 40) - Say.Length)
' End Try
' Spaces = 40 - WhatSay.Length
' If Spaces > 0 Then
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "\ " & WhatSay
' Do
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & " "
' If Spaces = 0 Then
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & "/"
' Exit Do
' End If
' Spaces = Spaces - 1
' Loop
' Exit Do
' Else
' Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "| " & WhatSay & " |"
' CurrentLength = CurrentLength + 40
' End If
'Loop
End Select
End Sub
End Module
|