質問編集履歴
3
強調表示の削除、error発生部分の強調
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,53 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
|
19
|
+
----error発生部分ソースコード----
|
20
|
+
|
21
|
+
```
|
22
|
+
|
23
|
+
class Blackjack(self, deck.self):
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
##Point method
|
30
|
+
|
31
|
+
def Point(self):
|
32
|
+
|
33
|
+
sum = 0
|
34
|
+
|
35
|
+
sorted((deck.self), reverse = True)
|
36
|
+
|
37
|
+
for i in range(len(deck.self)):
|
38
|
+
|
39
|
+
if deck.self == 11 or 12 or 13:
|
40
|
+
|
41
|
+
sum += 10
|
42
|
+
|
43
|
+
elif deck.self == 1:
|
44
|
+
|
45
|
+
sum += 11
|
46
|
+
|
47
|
+
##error部分 if sum >= 21:
|
48
|
+
|
49
|
+
sum -=10
|
50
|
+
|
51
|
+
else:
|
52
|
+
|
53
|
+
sum += deck.self
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
19
|
-
----ソースコード----
|
65
|
+
----ソースコード全体----
|
20
66
|
|
21
67
|
```
|
22
68
|
|
@@ -64,7 +110,7 @@
|
|
64
110
|
|
65
111
|
sum += 11
|
66
112
|
|
67
|
-
|
113
|
+
if sum >= 21:
|
68
114
|
|
69
115
|
sum -=10
|
70
116
|
|
@@ -91,7 +137,3 @@
|
|
91
137
|
|
92
138
|
|
93
139
|
return sum
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
```
|
2
error内容の詳細を追記しました。よろしくお願いいたします。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
Pointメソッド中のif文(line21)にIndentation error(Unexpected indent)が表示され、先頭の位置を変えてみたのですが、errorが消えません。対処法と可能であれば原因をご教示頂けますと幸いです。
|
2
2
|
|
3
3
|
|
4
|
+
|
5
|
+
-----errorの内容-----
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
if sum >= 21:
|
10
|
+
|
11
|
+
^
|
12
|
+
|
13
|
+
IndentationError: unexpected indent
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
----ソースコード----
|
4
20
|
|
5
21
|
```
|
6
22
|
|
1
ご指摘ありがとうございます。バッククォートとコメントを追記いたしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
Pointメソッド中のif文(line21)にIndentation errorが表示され、先頭の位置を変えてみたのですが、errorが消えません。対処法と可能であれば原因をご教示頂けますと幸いです。
|
1
|
+
Pointメソッド中のif文(line21)にIndentation error(Unexpected indent)が表示され、先頭の位置を変えてみたのですが、errorが消えません。対処法と可能であれば原因をご教示頂けますと幸いです。
|
2
2
|
|
3
3
|
|
4
|
+
|
5
|
+
```
|
4
6
|
|
5
7
|
class Blackjack(self, deck.self):
|
6
8
|
|
7
9
|
|
8
10
|
|
9
|
-
|
11
|
+
###init method
|
10
12
|
|
11
13
|
def __init__(self,deck):
|
12
14
|
|
@@ -14,17 +16,21 @@
|
|
14
16
|
|
15
17
|
|
16
18
|
|
17
|
-
|
19
|
+
###HIt method
|
18
20
|
|
19
21
|
def HIt(self):
|
20
22
|
|
21
23
|
return random.randint(1,13)
|
22
24
|
|
25
|
+
|
26
|
+
|
23
|
-
|
27
|
+
###Dealer method
|
24
28
|
|
25
29
|
def Dealer(self):
|
26
30
|
|
27
31
|
|
32
|
+
|
33
|
+
##Point method
|
28
34
|
|
29
35
|
def Point(self):
|
30
36
|
|
@@ -50,7 +56,9 @@
|
|
50
56
|
|
51
57
|
sum += deck.self
|
52
58
|
|
59
|
+
|
60
|
+
|
53
|
-
|
61
|
+
###Hit_or_Stand method
|
54
62
|
|
55
63
|
def Hit_or_stand(self, Point, Hit):
|
56
64
|
|
@@ -67,3 +75,7 @@
|
|
67
75
|
|
68
76
|
|
69
77
|
return sum
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
```
|