質問編集履歴

1

コードを読めるように改造しました 大丈夫でしょうか?

2021/01/27 11:56

投稿

yamasita_uruki
yamasita_uruki

スコア29

test CHANGED
File without changes
test CHANGED
@@ -1,211 +1,227 @@
1
+ `````````ここに言語を入力
2
+
3
+ ここに言語を入力
4
+
5
+ ```
6
+
7
+ ここに言語を入力
8
+
1
- ```python
9
+ ````import random
10
+
11
+ coin=0
12
+
13
+ kati=0
14
+
15
+
16
+
17
+
18
+
19
+ room=random.choice([ "✊","✌","✋"])
20
+
21
+ cho=(input("何を出しますか?【1】✊【2】✌【3】✋"))
22
+
23
+ if cho==1:
24
+
25
+ gu_kumi()
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+ elif cho==2:
34
+
35
+ tyoki_kumi()
36
+
37
+
38
+
39
+ elif cho==3:
40
+
41
+ pa_kumi()
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ def gu_kumi():
54
+
55
+ global kati
56
+
57
+ global coin
58
+
59
+ if room=="✌":
60
+
61
+
62
+
63
+ coin=coin+1
64
+
65
+ kati=1
66
+
67
+ tyoki()
68
+
69
+ elif room=="✋":
70
+
71
+ coin=coin-1
72
+
73
+ kati=-1
74
+
75
+ pa()
76
+
77
+ elif room=="✊":
78
+
79
+ gu()
80
+
81
+
82
+
83
+ def tyoki_kumi():
84
+
85
+ global kati
86
+
87
+ global coin
88
+
89
+
90
+
91
+ if room=="✌":
92
+
93
+ tyoki()
94
+
95
+
96
+
97
+
98
+
99
+ elif room=="✋":
100
+
101
+ coin=coin+1
102
+
103
+ kati=-1
104
+
105
+ pa()
106
+
107
+
108
+
109
+ elif room=="✊":
110
+
111
+ coin=coin-1
112
+
113
+ kati=-1
114
+
115
+ gu()
116
+
117
+
118
+
119
+ def pa_kumi():
120
+
121
+ global kati
122
+
123
+ global coin
124
+
125
+ if room=="✌":
126
+
127
+ kati=-1
128
+
129
+ coin=coin-1
130
+
131
+ tyoki()
132
+
133
+ elif room==" ✋":
134
+
135
+ pa()
136
+
137
+
138
+
139
+ elif room== "✊":
140
+
141
+ coin=coin+1
142
+
143
+ kati=1
144
+
145
+ gu()
146
+
147
+
148
+
149
+ def tyoki():
150
+
151
+ global kati
152
+
153
+ print("✌")
154
+
155
+ if kati>0:
156
+
157
+ print("貴方の勝ち")
158
+
159
+ elif kati<0:
160
+
161
+ print("私の勝ち")
162
+
163
+ elif kati==0:
164
+
165
+ print("あいこ")
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ def gu():
176
+
177
+ global kati
178
+
179
+ print("✊")
180
+
181
+ if kati>0:
182
+
183
+ print("貴方の勝ち")
184
+
185
+ elif kati<0:
186
+
187
+ print("私の勝ち")
188
+
189
+ elif kati==0:
190
+
191
+ print("あいこ")
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+ def pa():
200
+
201
+ global kati
202
+
203
+ print("✋")
204
+
205
+ if kati>0:
206
+
207
+ print("貴方の勝ち")
208
+
209
+ elif kati<0:
210
+
211
+ print("私の勝ち")
212
+
213
+ elif kati==0:
214
+
215
+ print("あいこ")
2
216
 
3
217
  コード
4
218
 
219
+ ``````python
220
+
221
+ コード
222
+
5
223
  ```import random
6
224
 
7
225
  coin=0
8
226
 
9
227
  kati=0
10
-
11
-
12
-
13
-
14
-
15
- room=random.choice([ "✊","✌","✋"])
16
-
17
- cho=(input("何を出しますか?【1】✊【2】✌【3】✋"))
18
-
19
- if cho==1:
20
-
21
- gu_kumi()
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
- elif cho==2:
30
-
31
- tyoki_kumi()
32
-
33
-
34
-
35
- elif cho==3:
36
-
37
- pa_kumi()
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
- def gu_kumi():
50
-
51
- global kati
52
-
53
- global coin
54
-
55
- if room=="✌":
56
-
57
-
58
-
59
- coin=coin+1
60
-
61
- kati=1
62
-
63
- tyoki()
64
-
65
- elif room=="✋":
66
-
67
- coin=coin-1
68
-
69
- kati=-1
70
-
71
- pa()
72
-
73
- elif room=="✊":
74
-
75
- gu()
76
-
77
-
78
-
79
- def tyoki_kumi():
80
-
81
- global kati
82
-
83
- global coin
84
-
85
-
86
-
87
- if room=="✌":
88
-
89
- tyoki()
90
-
91
-
92
-
93
-
94
-
95
- elif room=="✋":
96
-
97
- coin=coin+1
98
-
99
- kati=-1
100
-
101
- pa()
102
-
103
-
104
-
105
- elif room=="✊":
106
-
107
- coin=coin-1
108
-
109
- kati=-1
110
-
111
- gu()
112
-
113
-
114
-
115
- def pa_kumi():
116
-
117
- global kati
118
-
119
- global coin
120
-
121
- if room=="✌":
122
-
123
- kati=-1
124
-
125
- coin=coin-1
126
-
127
- tyoki()
128
-
129
- elif room==" ✋":
130
-
131
- pa()
132
-
133
-
134
-
135
- elif room== "✊":
136
-
137
- coin=coin+1
138
-
139
- kati=1
140
-
141
- gu()
142
-
143
-
144
-
145
- def tyoki():
146
-
147
- global kati
148
-
149
- print("✌")
150
-
151
- if kati>0:
152
-
153
- print("貴方の勝ち")
154
-
155
- elif kati<0:
156
-
157
- print("私の勝ち")
158
-
159
- elif kati==0:
160
-
161
- print("あいこ")
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
- def gu():
172
-
173
- global kati
174
-
175
- print("✊")
176
-
177
- if kati>0:
178
-
179
- print("貴方の勝ち")
180
-
181
- elif kati<0:
182
-
183
- print("私の勝ち")
184
-
185
- elif kati==0:
186
-
187
- print("あいこ")
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
- def pa():
196
-
197
- global kati
198
-
199
- print("✋")
200
-
201
- if kati>0:
202
-
203
- print("貴方の勝ち")
204
-
205
- elif kati<0:
206
-
207
- print("私の勝ち")
208
-
209
- elif kati==0:
210
-
211
- print("あいこ")