( if you know what online game I'm referring to, that is

Moderator: General Mods
Don't know what happened there. I had gone on a few more sentences on Nach's knowledge and experience with efficiency, design patterns, and algorithms. Kind of a high level, low level compliment thing. Not to say either of us in incapable of both, just stronger at one end versus the other.grinvader wrote:would like to read the end of your post, if that's possible.Nightcrawler wrote:I think our strengths would compliment the others potential weaknesses well. I
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Lemme guess, lunar wars or perhaps galava? Maybe cybernations?Franky wrote:Maybe he recieved a random event?
( if you know what online game I'm referring to, that is).
No, runescape.adventure_of_link wrote:Lemme guess, lunar wars or perhaps galava? Maybe cybernations?Franky wrote:Maybe he recieved a random event?
( if you know what online game I'm referring to, that is).
Code: Select all
Option Explicit On
Option Strict On
Module Module1
Dim usAddress, usNotation, usMax, usBin, usHex, sReturn As String
Function bVerifyAddress(ByRef sAddress As String) As Boolean
bVerifyAddress = True
Try
Call Convert.ToInt32(sAddress)
Catch ex As Exception
bVerifyAddress = False
End Try
If bVerifyAddress = True Then
If (Convert.ToInt32(sAddress) Mod 4) <> 0 Or Convert.ToInt32(sAddress) > 32 Or Convert.ToInt32(sAddress) < 4 Then
bVerifyAddress = False
End If
End If
End Function
Function bVerifyMax(ByRef sMax As String, ByRef iAddress As Integer, ByRef sNotation As String) As Boolean
bVerifyMax = True
Try
Call Convert.ToDouble(sMax)
Catch ex As Exception
bVerifyMax = False
End Try
If bVerifyMax = True Then
If (Convert.ToDouble(sMax) Mod 1) <> 0 Then
bVerifyMax = False
ElseIf sNotation = "signed" Then
If Convert.ToDouble(sMax) < (-(2 ^ (iAddress - 1))) Or Convert.ToDouble(sMax) > ((2 ^ (iAddress - 1)) - 1) Then
bVerifyMax = False
End If
ElseIf Convert.ToDouble(sMax) < 0 Or Convert.ToDouble(sMax) > ((2 ^ iAddress) - 1) Then
bVerifyMax = False
End If
End If
End Function
Function bVerifyBin(ByRef sBin As String, ByRef iAddress As Integer) As Boolean
bVerifyBin = True
If sBin = "" Then
bVerifyBin = False
ElseIf sBin.Length > iAddress Then
For j As Integer = 1 To sBin.Length
If Mid(sBin, j, 1) = "0" Then
ElseIf Mid(sBin, j, (sBin.Length - (j - 1))).Length > iAddress Then
bVerifyBin = False
Exit For
Else
Exit For
End If
Next
End If
If bVerifyBin = True Then
For j As Integer = 1 To sBin.Length Step 1
If Mid(sBin, j, 1) <> "1" And Mid(sBin, j, 1) <> "0" Then
bVerifyBin = False
Exit For
End If
Next
End If
End Function
Function bVerifyHex(ByRef sHex As String, ByRef iAddress As Integer) As Boolean
Dim sTempBin As String = ""
bVerifyHex = True
If sHex = "" Then
bVerifyHex = False
ElseIf (sHex.Length * 4) > iAddress Then
sTempBin = sHexadecimalToBinary(sHex)
For j As Integer = 1 To sTempBin.Length
If Mid(sTempBin, j, 1) = "0" Then
ElseIf Mid(sTempBin, j, (sTempBin.Length - (j - 1))).Length > iAddress Then
bVerifyHex = False
Exit For
Else
Exit For
End If
Next
End If
If bVerifyHex = True Then
For j As Integer = 1 To sHex.Length
If Not (Mid(sHex, j, 1) Like "[A-F]" Or Mid(sHex, j, 1) Like "#") Then
bVerifyHex = False
Exit For
End If
Next
End If
End Function
Function sDecimalToBinary(ByVal iMax As Double, ByRef sNotation As String, ByRef iAddress As Integer) As String
sDecimalToBinary = ""
If sNotation = "signed" And iMax < 0 Then
iMax += (2 ^ iAddress)
End If
Do
If Not ((iMax Mod 2) = 0) Then
sDecimalToBinary = "1" + sDecimalToBinary
Else
sDecimalToBinary = "0" + sDecimalToBinary
End If
iMax = Int(iMax / 2)
Loop Until iMax = 0
End Function
Function sBinaryToHexadecimal(ByRef sBin As String) As String
sBinaryToHexadecimal = ""
If Not ((sBin.Length Mod 4) = 0) Then
Do
sBin = "0" + sBin
Loop Until (sBin.Length Mod 4) = 0
End If
For j As Integer = 1 To sBin.Length Step 4
Select Case Mid(sBin, j, 4)
Case "0000"
sBinaryToHexadecimal += "0"
Case "0001"
sBinaryToHexadecimal += "1"
Case "0010"
sBinaryToHexadecimal += "2"
Case "0011"
sBinaryToHexadecimal += "3"
Case "0100"
sBinaryToHexadecimal += "4"
Case "0101"
sBinaryToHexadecimal += "5"
Case "0110"
sBinaryToHexadecimal += "6"
Case "0111"
sBinaryToHexadecimal += "7"
Case "1000"
sBinaryToHexadecimal += "8"
Case "1001"
sBinaryToHexadecimal += "9"
Case "1010"
sBinaryToHexadecimal += "A"
Case "1011"
sBinaryToHexadecimal += "B"
Case "1100"
sBinaryToHexadecimal += "C"
Case "1101"
sBinaryToHexadecimal += "D"
Case "1110"
sBinaryToHexadecimal += "E"
Case "1111"
sBinaryToHexadecimal += "F"
End Select
Next
End Function
Function sHexadecimalToBinary(ByRef sHex As String) As String
sHexadecimalToBinary = ""
For j As Integer = 1 To sHex.Length Step 1
Select Case Mid(sHex, j, 1)
Case "0"
sHexadecimalToBinary += "0000"
Case "1"
sHexadecimalToBinary += "0001"
Case "2"
sHexadecimalToBinary += "0010"
Case "3"
sHexadecimalToBinary += "0011"
Case "4"
sHexadecimalToBinary += "0100"
Case "5"
sHexadecimalToBinary += "0101"
Case "6"
sHexadecimalToBinary += "0110"
Case "7"
sHexadecimalToBinary += "0111"
Case "8"
sHexadecimalToBinary += "1000"
Case "9"
sHexadecimalToBinary += "1001"
Case "A"
sHexadecimalToBinary += "1010"
Case "B"
sHexadecimalToBinary += "1011"
Case "C"
sHexadecimalToBinary += "1100"
Case "D"
sHexadecimalToBinary += "1101"
Case "E"
sHexadecimalToBinary += "1110"
Case "F"
sHexadecimalToBinary += "1111"
End Select
Next
End Function
Function iBinaryToDecimal(ByRef sBin As String, ByRef sNotation As String, ByRef iAddress As Integer) As Double
iBinaryToDecimal = 0
For j As Integer = sBin.Length To 1 Step -1
If Mid(sBin, j, 1) = "1" Then
iBinaryToDecimal += (2 ^ (sBin.Length - j))
End If
Next
If sNotation = "signed" And iBinaryToDecimal > ((2 ^ (iAddress - 1)) - 1) Then
iBinaryToDecimal -= (2 ^ iAddress)
End If
End Function
Sub InterfaceVerifyAddress()
Do
Call Console.Write("?Address: ")
usAddress = Console.ReadLine()
If Not (bVerifyAddress(usAddress) = True) Then
Call Console.WriteLine("Invalid input")
End If
Loop Until bVerifyAddress(usAddress) = True
End Sub
Sub InterfaceVerifyMax()
Do
Call Console.Write("?Decimal: ")
usMax = Console.ReadLine()
If Not (bVerifyMax(usMax, Convert.ToInt32(usAddress), usNotation) = True) Then
Call Console.WriteLine("Invalid input")
End If
Loop Until bVerifyMax(usMax, Convert.ToInt32(usAddress), usNotation) = True
End Sub
Sub InterfaceVerifyNotation()
Do
Call Console.Write("?Sign: ")
usNotation = Console.ReadLine().ToLower
If Not (usNotation = "signed" Or usNotation = "unsigned") Then
Call Console.WriteLine("Invalid input")
End If
Loop Until usNotation = "signed" Or usNotation = "unsigned"
End Sub
Sub InterfaceVerifyBin()
Do
Call Console.Write("?Bin: ")
usBin = Console.ReadLine()
If Not (bVerifyBin(usBin, Convert.ToInt32(usAddress)) = True) Then
Call Console.WriteLine("Invalid input")
End If
Loop Until bVerifyBin(usBin, Convert.ToInt32(usAddress)) = True
End Sub
Sub InterfaceVerifyHex()
Do
Call Console.Write("?Hex: ")
usHex = Console.ReadLine().ToUpper
If Not (bVerifyHex(usHex, Convert.ToInt32(usAddress)) = True) Then
Call Console.WriteLine("Invalid input")
End If
Loop Until bVerifyHex(usHex, Convert.ToInt32(usAddress)) = True
End Sub
Sub InterfaceDecimalToBinary()
Call Console.WriteLine("Decimal to binary conversion")
Do
Call InterfaceVerifyAddress()
Call InterfaceVerifyNotation()
Call InterfaceVerifyMax()
Call Console.WriteLine(sDecimalToBinary(Convert.ToDouble(usMax), usNotation, Convert.ToInt32(usAddress)))
Do
Call Console.Write("Would you like to go again? y/n: ")
sReturn = Console.ReadLine().ToLower
If Not (sReturn = "y" Or sReturn = "n") Then
Call Console.WriteLine("Invalid choice")
End If
Loop Until sReturn = "y" Or sReturn = "n"
Call Console.WriteLine()
Loop Until sReturn = "n"
End Sub
Sub InterfaceDecimalToHexadecimal()
Call Console.WriteLine("Decimal to hexadecimal conversion")
Do
Call InterfaceVerifyAddress()
Call InterfaceVerifyNotation()
Call InterfaceVerifyMax()
Call Console.WriteLine(sBinaryToHexadecimal(sDecimalToBinary(Convert.ToDouble(usMax), usNotation, Convert.ToInt32(usAddress))))
Do
Call Console.Write("Would you like to go again? y/n: ")
sReturn = Console.ReadLine().ToLower
If Not (sReturn = "y" Or sReturn = "n") Then
Call Console.WriteLine("Invalid choice")
End If
Loop Until sReturn = "y" Or sReturn = "n"
Call Console.WriteLine()
Loop Until sReturn = "n"
End Sub
Sub InterfaceBinaryToDecimal()
Call Console.WriteLine("Binary to decimal conversion")
Do
Call InterfaceVerifyAddress()
Call InterfaceVerifyNotation()
Call InterfaceVerifyBin()
Call Console.WriteLine(iBinaryToDecimal(usBin, usNotation, Convert.ToInt32(usAddress)).ToString)
Do
Call Console.Write("Would you like to go again? y/n: ")
sReturn = Console.ReadLine().ToLower
If Not (sReturn = "y" Or sReturn = "n") Then
Call Console.WriteLine("Invalid choice")
End If
Loop Until sReturn = "y" Or sReturn = "n"
Call Console.WriteLine()
Loop Until sReturn = "n"
End Sub
Sub InterfaceBinaryToHexadecimal()
Call Console.WriteLine()
Do
Call InterfaceVerifyAddress()
Call InterfaceVerifyBin()
Call Console.WriteLine(sBinaryToHexadecimal(usBin))
Do
Call Console.Write("Would you like to go again? y/n: ")
sReturn = Console.ReadLine().ToLower
If Not (sReturn = "y" Or sReturn = "n") Then
Call Console.WriteLine("Invalid choice")
End If
Loop Until sReturn = "y" Or sReturn = "n"
Call Console.WriteLine()
Loop Until sReturn = "n"
End Sub
Sub InterfaceHexadecimalToDecimal()
Do
Call InterfaceVerifyAddress()
Call InterfaceVerifyNotation()
Call InterfaceVerifyHex()
Call Console.WriteLine(iBinaryToDecimal(sHexadecimalToBinary(usHex), usNotation, Convert.ToInt32(usAddress)))
Do
Call Console.Write("Would you like to go again? y/n: ")
sReturn = Console.ReadLine().ToLower
If Not (sReturn = "y" Or sReturn = "n") Then
Call Console.WriteLine("Invalid choice")
End If
Loop Until sReturn = "y" Or sReturn = "n"
Loop Until sReturn = "n"
Call Console.WriteLine()
End Sub
Sub InterfaceHexadecimalToBinary()
Do
Call InterfaceVerifyAddress()
Call InterfaceVerifyHex()
Call Console.WriteLine(sHexadecimalToBinary(usHex))
Do
Call Console.Write("Would you like to go again? y/n: ")
sReturn = Console.ReadLine().ToLower
If Not (sReturn = "y" Or sReturn = "n") Then
Call Console.WriteLine("Invalid choice")
End If
Loop Until sReturn = "y" Or sReturn = "n"
Call Console.WriteLine()
Loop Until sReturn = "n"
End Sub
Sub Main()
Dim sInputChoice As String = ""
Call VersionInformation()
Call DisplayOptions()
Do
Call Console.Write("?: ")
sInputChoice = Console.ReadLine().ToLower
Select Case sInputChoice
Case "dec2bin"
Call InterfaceDecimalToBinary()
Case "dec2hex"
Call InterfaceDecimalToHexadecimal()
Case "bin2dec"
Call InterfaceBinaryToDecimal()
Case "bin2hex"
Call InterfaceBinaryToHexadecimal()
Case "hex2dec"
Call InterfaceHexadecimalToDecimal()
Case "hex2bin"
Call InterfaceHexadecimalToBinary()
Case "display"
Call DisplayOptions()
Case "about"
Call VersionInformation()
Call Console.WriteLine()
Call Console.Write("Press enter to continue...")
Call Console.ReadLine()
End Select
If Not (sInputChoice = "quit") Then
Call Console.WriteLine()
Call DisplayOptions()
End If
Loop Until sInputChoice = "quit"
End Sub
Sub DisplayOptions()
Call Console.WriteLine("Options:")
Call Console.WriteLine("dec2bin - Decimal to binary conversion")
Call Console.WriteLine("dec2hex - Decimal to hexadecimal conversion")
Call Console.WriteLine("bin2dec - Binary to decimal conversion")
Call Console.WriteLine("bin2hex - Binary to hexadecimal conversion")
Call Console.WriteLine("hex2dec - Hexadecimal to decimal conversion")
Call Console.WriteLine("hex2bin - Hexadecimal to binary conversion")
Call Console.WriteLine("display - Show these options")
Call Console.WriteLine("about - Show information about this program")
Call Console.WriteLine("quit - Exit this program")
Call Console.WriteLine()
End Sub
Sub VersionInformation()
Call Console.WriteLine("ZBinc: Decimal/Binary/Hexadecimal Conversion")
Call Console.WriteLine("License: Public Domain")
Call Console.WriteLine("Written by Zero-Hero")
Call Console.WriteLine()
End Sub
End Module
Code: Select all
Option Explicit On
Option Strict On
Public Class AK3N
Function sConvertN10toN13(ByRef usISBN10 As String) As String
Dim iMax As Integer = 0
sConvertN10toN13 = "978" + Mid(usISBN10, 1, 9)
For j As Integer = 2 To 12 Step 2
iMax += (Convert.ToInt32(Mid(sConvertN10toN13, (j - 1), 1))) + (3 * (Convert.ToInt32(Mid(sConvertN10toN13, j, 1))))
Next
sConvertN10toN13 += ((10 - (iMax Mod 10)) Mod 10).ToString
End Function
Function bVerifySum10(ByRef usISBN10 As String) As Boolean
Dim iMax As Integer = 0
bVerifySum10 = True
If usISBN10 Like "##########" Or usISBN10.Length = 10 And Mid(usISBN10, 1, 9) Like "#########" And Mid(usISBN10, 10, 1) = "X" Then
For j = 10 To 2 Step -1
iMax += ((Convert.ToInt32(Mid(usISBN10, (10 - (j - 1)), 1))) * j)
Next
If Not (Mid(usISBN10, 10, 1) = "X") Then
iMax += Convert.ToInt32(Mid(usISBN10, 10, 1))
Else
iMax += 10
End If
If Not ((iMax Mod 11) = 0) Then
bVerifySum10 = False
End If
Else
bVerifySum10 = False
End If
End Function
Function sConvertN13toN10(ByRef usISBN13 As String) As String
Dim iMax As Integer = 0
Dim iCount As Integer = 0
sConvertN13toN10 = Mid(usISBN13, 4, 9)
For j As Integer = 10 To 2 Step -1
iMax += ((Convert.ToInt32(Mid(sConvertN13toN10, (10 - (j - 1)), 1))) * j)
Next
If Not ((iMax Mod 11) = 0) Then
Do
iCount += 1
Loop Until ((iMax + iCount) Mod 11) = 0
If iCount = 10 Then
sConvertN13toN10 += "X"
Else
sConvertN13toN10 += iCount.ToString
End If
Else
sConvertN13toN10 += "0"
End If
End Function
Function bVerifySum13(ByRef usISBN13 As String) As Boolean
Dim iMax As Integer = 0
bVerifySum13 = True
If usISBN13 Like "#############" Then
If Not (Mid(usISBN13, 1, 3) = "979") Then
For j As Integer = 2 To 12 Step 2
iMax += ((Convert.ToInt32(Mid(usISBN13, (j - 1), 1))) + (3 * (Convert.ToInt32(Mid(usISBN13, j, 1)))))
Next
If Not (((10 - (iMax Mod 10)) Mod 10) = Convert.ToInt32(Mid(usISBN13, 13, 1))) Then
bVerifySum13 = False
End If
Else
bVerifySum13 = False
End If
Else
bVerifySum13 = False
End If
End Function
Private Sub txtInput_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtInput.KeyPress
If rdbInputISBN10.Checked = True Then
If txtInput.Text.Length = 10 Then
Select Case e.KeyChar
Case Chr(8)
Case Else
e.KeyChar = Nothing
End Select
Else
Select Case e.KeyChar.ToString
Case "0" To "9"
Case Chr(8)
Case "X"
If Not (txtInput.Text.Length = 9) Then
e.KeyChar = Nothing
End If
Case "x"
If txtInput.Text.Length = 9 Then
txtInput.Text += e.KeyChar.ToString.ToUpper
End If
e.KeyChar = Nothing
Case Else
e.KeyChar = Nothing
End Select
End If
ElseIf rdbInputISBN13.Checked = True Then
If txtInput.Text.Length = 13 Then
Select Case e.KeyChar
Case Chr(8)
Case Else
e.KeyChar = Nothing
End Select
Else
Select Case e.KeyChar.ToString
Case "0" To "9"
Case Chr(8)
Case Else
e.KeyChar = Nothing
End Select
End If
End If
End Sub
Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
If txtInput.Text = "" Then
Call MsgBox("Please enter a value")
ElseIf rdbInputISBN10.Checked = True Then
If Not (txtInput.Text.Length = 10) Then
Call MsgBox("ISBN10 number must be 10 digits")
ElseIf Not (bVerifySum10(txtInput.Text) = True) Then
Call MsgBox("Invalid ISBN-10 number")
Else
txtOutput.Text = sConvertN10toN13(txtInput.Text)
End If
ElseIf rdbInputISBN13.Checked = True Then
If Not (txtInput.Text.Length = 13) Then
Call MsgBox("ISBN13 number must be 13 digits")
ElseIf Not (bVerifySum13(txtInput.Text) = True) Then
Call MsgBox("Invalid ISBN-13 number")
Else
txtOutput.Text = sConvertN13toN10(txtInput.Text)
End If
End If
End Sub
Private Sub rdbInputISBN10_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdbInputISBN10.CheckedChanged
txtInput.Text = ""
txtOutput.Text = ""
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtInput.Text = ""
txtOutput.Text = ""
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
End
End Sub
End Class
Shut up.h4tred wrote:Tell me when you wrote it in C.
As much as I knew he was taking the piss, I don't want my thread to be derailed, so rather than respond to h4tred with a swift "fuck you", I responded peacefully.adventure_of_link wrote:Shut up.h4tred wrote:Tell me when you wrote it in C.
If you have nothing meaningful to say, then don't say anything at all. You're not welcome around these boards anyway, so if people want to tell you to shut up, they can. I don't particularly like you, either. If it were up to me, you'd already be banned, right down to the ISP level.dickhead wrote:No!
You. Shut. Up.
I didn't say anything wrong, so how dare you tell me to shut up. All I said is that I am interested in it when its done in C. Thats all. How the fuck is that flaming or are you just finding excuses to say "shut up" to me?
Meh, I usually just hit printscreen, paste it into mspaint and save it as jpeg. Sure, there'll be a few artifacts in the image, but I'm not at all bothered. I do use png occasionally though. I like compression, and it's not as if you need every pixel to be perfect anyway.creaothceann wrote:Franky:
Use PNG next time, instead of JPG with insanely high compression.
Code: Select all
Option Explicit On
Option Strict On
Public Class AK3N
Private Sub txtInput_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtInput.KeyPress
If rdbInputISBN10.Checked = True And txtInput.Text.Length = 10 Or rdbInputISBN13.Checked = True And txtInput.Text.Length = 13 Then
If Not (e.KeyChar.ToString = Chr(8)) Then
e.KeyChar = Nothing
End If
ElseIf rdbInputISBN10.Checked = True Then
If e.KeyChar.ToString.ToUpper = "X" And txtInput.Text.Length = 9 Then
ElseIf Not (e.KeyChar.ToString Like "#" Or e.KeyChar.ToString = Chr(8)) Then
e.KeyChar = Nothing
End If
ElseIf Not (e.KeyChar.ToString Like "#" Or e.KeyChar.ToString = Chr(8)) Then
e.KeyChar = Nothing
End If
End Sub
Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
If txtInput.Text = "" Then
Call MsgBox("Please enter a value")
ElseIf rdbInputISBN10.Checked = True Then
If Not (txtInput.Text.Length = 10) Then
Call MsgBox("ISBN10 number must be 10 digits")
ElseIf Not (bVerifySum10(txtInput.Text) = True) Then
Call MsgBox("Invalid ISBN-10 number")
Else
txtOutput.Text = sConvertN10toN13(txtInput.Text.ToUpper)
End If
ElseIf rdbInputISBN13.Checked = True Then
If Not (txtInput.Text.Length = 13) Then
Call MsgBox("ISBN13 number must be 13 digits")
ElseIf Mid(txtInput.Text, 1, 3) = "979" Then
Call MsgBox("ISBN-13 numbers of prefix 979 cannot be converted to ISBN-10")
ElseIf Not (Mid(txtInput.Text, 1, 3) = "978") Then
Call MsgBox("ISBN-13 prefix must be 978")
ElseIf Not (bVerifySum13(txtInput.Text) = True) Then
Call MsgBox("Invalid ISBN-13 number")
Else
txtOutput.Text = sConvertN13toN10(txtInput.Text)
End If
End If
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtInput.Text = ""
txtOutput.Text = ""
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
End
End Sub
Private Sub rdbInputISBN10_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdbInputISBN10.CheckedChanged
txtInput.Text = ""
txtOutput.Text = ""
End Sub
Function sConvertN10toN13(ByRef usISBN10 As String) As String
Dim iMax As Integer = 0
sConvertN10toN13 = "978" + Mid(usISBN10, 1, 9)
For j As Integer = 2 To 12 Step 2
iMax += (Convert.ToInt32(Mid(sConvertN10toN13, (j - 1), 1))) + (3 * (Convert.ToInt32(Mid(sConvertN10toN13, j, 1))))
Next
sConvertN10toN13 += ((10 - (iMax Mod 10)) Mod 10).ToString
End Function
Function bVerifySum13(ByRef usISBN13 As String) As Boolean
Dim iMax As Integer = 0
bVerifySum13 = True
For j As Integer = 2 To 12 Step 2
iMax += ((Convert.ToInt32(Mid(usISBN13, (j - 1), 1))) + (3 * (Convert.ToInt32(Mid(usISBN13, j, 1)))))
Next
If Not (((10 - (iMax Mod 10)) Mod 10) = Convert.ToInt32(Mid(usISBN13, 13, 1))) Then
bVerifySum13 = False
End If
End Function
Function sConvertN13toN10(ByRef usISBN13 As String) As String
Dim iMax As Integer = 0
Dim iCount As Integer = 0
sConvertN13toN10 = Mid(usISBN13, 4, 9)
For j As Integer = 10 To 2 Step -1
iMax += ((Convert.ToInt32(Mid(sConvertN13toN10, (10 - (j - 1)), 1))) * j)
Next
If Not ((iMax Mod 11) = 0) Then
Do
iCount += 1
Loop Until Not (((iMax + iCount) Mod 11) <> 0)
If Not (iCount <> 10) Then
sConvertN13toN10 += "X"
Else
sConvertN13toN10 += iCount.ToString
End If
Else
sConvertN13toN10 += "0"
End If
End Function
Function bVerifySum10(ByRef usISBN10 As String) As Boolean
Dim iMax As Integer = 0
bVerifySum10 = True
For j = 10 To 2 Step -1
iMax += ((Convert.ToInt32(Mid(usISBN10, (10 - (j - 1)), 1))) * j)
Next
If Not ((iMax Mod 11) = 0 And Mid(usISBN10, 10, 1) = "0") Then
If Not (Mid(usISBN10, 10, 1).ToUpper = "X") Then
iMax += Convert.ToInt32(Mid(usISBN10, 10, 1))
Else
iMax += 10
End If
If Not ((iMax Mod 11) = 0) Then
bVerifySum10 = False
End If
End If
End Function
End Class
If that ain't the pot calling the kettle black......VB.NET turd wrote:If you have nothing meaningful to say, then don't say anything at all. You're not welcome around these boards anyway, so if people want to tell you to shut up, they can. I don't particularly like you, either. If it were up to me, you'd already be banned, right down to the ISP level.
You have no right to harrass other people as you've been doing for some time now.
Yes.h4tred wrote:Permabans?
Yes.h4tred wrote:Apologies to the people I trolled?
You keep forgetting I merely did it because he asked me to.adventure_of_link wrote:Talk to the one who banned your mudlord nick.
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
I was trying to say that I don't have the power to ban people, but whatever.grinvader wrote:You keep forgetting I merely did it because he asked me to.adventure_of_link wrote:Talk to the one who banned your mudlord nick.
Fix that.