This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
' 参照設定 | |
' Microsoft WinHttp Services, version 5.1 | |
Private Enum HTTPREQUEST_SETCREDENTIALS_FLAGS | |
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0 | |
HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1 | |
End Enum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub SplitTest() | |
Dim Result() As String | |
Dim ErrNum As Long | |
Result = Split("") | |
Debug.Assert LBound(Result) = 0 And UBound(Result) = -1 | |
Result = Split("A,B,C", ",", 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Function Quotient(ByVal Dividend, ByVal Divisor) As Variant | |
'Quotient = Dividend \ Divisor | |
Quotient = Fix(Dividend / Divisor) | |
End Function | |
Function Modular(ByVal Dividend, ByVal Divisor) As Variant | |
'Modular = Dividend Mod Divisor | |
Modular = Dividend - Quotient(Dividend, Divisor) * Divisor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub test() | |
Hex2DecTest | |
Dec2BinTest | |
Hex2BinTest | |
Bin2DecTest | |
Bin2HexTest | |
Dec2HexTest | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub test() | |
Debug.Assert RotateBinImg("3:5b8") = "3:de0" | |
Debug.Assert RotateBinImg("1:8") = "1:8" | |
Debug.Assert RotateBinImg("2:8") = "2:4" | |
Debug.Assert RotateBinImg("2:4") = "2:1" | |
Debug.Assert RotateBinImg("2:1") = "2:2" | |
Debug.Assert RotateBinImg("3:5d0") = "3:5d0" | |
Debug.Assert RotateBinImg("4:1234") = "4:0865" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub test() | |
Debug.Assert TickTackToe("79538246") = "x won." | |
Debug.Assert TickTackToe("35497162193") = "x won." | |
Debug.Assert TickTackToe("61978543") = "x won." | |
Debug.Assert TickTackToe("254961323121") = "x won." | |
Debug.Assert TickTackToe("6134278187") = "x won." | |
Debug.Assert TickTackToe("4319581") = "Foul : x won." | |
Debug.Assert TickTackToe("9625663381") = "Foul : x won." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub test() | |
Debug.Assert Poker("S2H2D2C2S3") = "4K" | |
Debug.Assert Poker("D3C3C10D10S3") = "FH" | |
Debug.Assert Poker("S2H2D2C3S4") = "3K" | |
Debug.Assert Poker("S8D10HJS10CJ") = "2P" | |
Debug.Assert Poker("S2H2D3C4S5") = "1P" | |
Debug.Assert Poker("S2H3D4C5S6") = "--" | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Reg As Object | |
#Const ONE_LINER = 0 | |
Sub test() | |
Debug.Assert Seats("6:NABEbBZn") = "-ZAB-E" | |
Debug.Assert Seats("1:A") = "A" | |
Debug.Assert Seats("1:Aa") = "-" | |
Debug.Assert Seats("2:AB") = "AB" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub test() | |
Debug.Print CountAllPaths(5, 5) ' 70 | |
Debug.Print CountAllPaths(10, 10) ' 48620 | |
Debug.Print CountAllPaths(20, 20) ' 35345263800 | |
End Sub | |
Function CountAllPaths(ByVal Row As Long, ByVal Col As Long) As Double | |
Dim r As Long | |
Dim c As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reverse' :: [a] -> [a] | |
reverse' = foldl (flip (:)) [] | |
reverse'' :: [a] -> [a] | |
reverse'' = foldl (:) [] |