bellyoshi

# 練習用svn

• R/O
• SSH
• HTTPS

## コミット

### コミットメタ情報

リビジョン 399 (tree) 2018-08-04 11:57:18 bellyoshi

### 差分

--- MaxCoins/MaxCoins/CoinsSet.vb (revision 398)
+++ MaxCoins/MaxCoins/CoinsSet.vb (revision 399)
 @@ -59,12 +59,12 @@ 59 59 Next 60 60 End Sub 61 61 62 - Public Sub DecKeta() 62 + Public Sub DecKeta(ByVal useCoin As CoinsSet) 63 63 For i As Integer = 0 To typeMaxNum.Count - 1 64 64 If 0 < Me._coinNum(i) Then 65 65 Me._coinNum(i) = 0 66 66 For j = 0 To i - 1 67 - Me._coinNum(j) = typeMaxNum(j) 67 + Me._coinNum(j) = useCoin.CoinNum(j) 68 68 Next 69 69 Exit For 70 70 End If
--- MaxCoins/MaxCoins/Generator.vb (revision 398)
+++ MaxCoins/MaxCoins/Generator.vb (revision 399)
 @@ -9,8 +9,8 @@ 9 9 Dim chargeCoin = useCoin.subs(moneyCoin) 10 10 Dim mcPair = New MoneyChangePair(moneyCoin, chargeCoin) 11 11 Register.GetInstance.Regist(mcPair) 12 - moneyCoin.DecKeta() 13 - 12 + moneyCoin.DecKeta(useCoin) 13 + Console.WriteLine(mcPair) 14 14 End While 15 15 16 16 useCoin.dec()
--- MaxCoins/MaxCoins/Module1.vb (revision 398)
+++ MaxCoins/MaxCoins/Module1.vb (revision 399)
 @@ -3,7 +3,7 @@ 3 3 Sub Main() 4 4 Dim g As New Generator 5 5 g.generate() 6 - Register.GetInstance.Disp() 6 + ' Register.GetInstance.Disp() 7 7 End Sub 8 8 9 9 End Module
--- MaxCoins/MaxCoins/MoneyChangePair.vb (revision 398)
+++ MaxCoins/MaxCoins/MoneyChangePair.vb (revision 399)
 @@ -15,6 +15,14 @@ 15 15 End Function 16 16 17 17 Public Overrides Function ToString() As String 18 - Return \$"{money},{change}" 18 + Dim sb = New Text.StringBuilder 19 + sb.Append(Value()) 20 + sb.Append(",") 21 + sb.Append(CoinSumNum()) 22 + sb.Append(":") 23 + sb.Append(money) 24 + sb.Append("-") 25 + sb.Append(change) 26 + Return sb.ToString 19 27 End Function 20 28 End Class
--- MaxCoins/MaxCoins/Register.vb (revision 398)
+++ MaxCoins/MaxCoins/Register.vb (revision 399)
 @@ -27,10 +27,7 @@ 27 27 28 28 Sub Disp() 29 29 For Each p In dic 30 - Console.Write(p.Key) 31 - Console.Write(",") 32 - Console.Write(p.Value.CoinSumNum) 33 - Console.WriteLine() 30 + 34 31 Next 35 32 End Sub 36 33
--- MaxCoins/UnitTestProject1/CoinsSetTest.vb (revision 398)
+++ MaxCoins/UnitTestProject1/CoinsSetTest.vb (revision 399)
 @@ -47,8 +47,8 @@ 47 47 Public Sub ValueTest() 48 48 Dim cs1 = CoinsSet.GetMaxCoins() 49 49 Assert.AreEqual(1999, cs1.Value) 50 - cs1.DecKeta() 51 - cs1.DecKeta() 50 + cs1.DecKeta(CoinsSet.GetMaxCoins()) 51 + cs1.DecKeta(CoinsSet.GetMaxCoins()) 52 52 Assert.AreEqual(1994, cs1.Value) 53 53 End Sub 54 54
 @@ -60,8 +60,8 @@ 60 60 cs2.dec() 61 61 Dim cs4 = cs1.subs(cs2) 62 62 Assert.AreEqual(1, cs4.Value) 63 - cs2.DecKeta() 64 - cs2.DecKeta() 63 + cs2.DecKeta(CoinsSet.GetMaxCoins()) 64 + cs2.DecKeta(CoinsSet.GetMaxCoins()) 65 65 Assert.AreEqual(1999, cs1.Value) 66 66 Assert.AreEqual(1994, cs2.Value) 67 67 Dim cs5 = cs1.subs(cs2)
 @@ -68,6 +68,11 @@ 68 68 Assert.AreEqual(5, cs5.Value) 69 69 Assert.AreEqual(1999, cs1.Value) 70 70 Assert.AreEqual(1994, cs2.Value) 71 + 72 + Dim cs6 = New CoinsSet({4, 1, 4, 1, 4, 1, 1}) 73 + Dim cs7 = New CoinsSet({4, 0, 4, 1, 4, 1, 1}) 74 + Dim cs8 = cs6.subs(cs7) 75 + Assert.AreEqual(5, cs8.Value) 71 76 End Sub 72 77 73 78 Public Function CoinSetEqual(cs1 As CoinsSet, cs2 As CoinsSet)