質問編集履歴

4

pythonとkivyは以下のバージョンを追記しました。

2018/11/29 03:05

投稿

shield
shield

スコア16

test CHANGED
File without changes
test CHANGED
@@ -156,6 +156,14 @@
156
156
 
157
157
  ```
158
158
 
159
+ pythonとkivyは以下のバージョンを使用しています。
160
+
161
+
162
+
163
+ python ver 3.7.1
164
+
165
+ kivy ver 1.10.1
166
+
159
167
 
160
168
 
161
169
  ```python

3

kvファイルのコードを追加しました。

2018/11/29 03:05

投稿

shield
shield

スコア16

test CHANGED
File without changes
test CHANGED
@@ -158,6 +158,206 @@
158
158
 
159
159
 
160
160
 
161
+ ```python
162
+
163
+ Root:
164
+
165
+ <Root>:
166
+
167
+ canvas.before:
168
+
169
+ rgb:1,1,1
170
+
171
+ rectangle:
172
+
173
+ pos:self.pos
174
+
175
+ size:self.size
176
+
177
+
178
+
179
+
180
+
181
+ <Title@BoxLayout>:
182
+
183
+ orientation: 'vertical'
184
+
185
+ Label:
186
+
187
+ size_hint_y: 3
188
+
189
+ text:'魔方陣パズル'
190
+
191
+ GoToButton:
192
+
193
+ no:1
194
+
195
+ GoToButton:
196
+
197
+ no:2
198
+
199
+ GoToButton:
200
+
201
+ no:3
202
+
203
+ <GoToButton>:
204
+
205
+ no: 0
206
+
207
+ text: '問題' + str(self.no)
208
+
209
+ on_press: app.root.gotoBoard(self.no)
210
+
211
+
212
+
213
+ <Board>:
214
+
215
+ no: 0
216
+
217
+ orientation: 'vertical'
218
+
219
+ Label:
220
+
221
+ text: 問題' + str(root.no)
222
+
223
+ GridLayout:
224
+
225
+ id: board
226
+
227
+ rows:4
228
+
229
+ cols:4
230
+
231
+ size_hint_y:4
232
+
233
+ spacing:3
234
+
235
+ BoxLayout:
236
+
237
+ orientation:'horizontal'
238
+
239
+ Button:
240
+
241
+ text:'もどる'
242
+
243
+ no_press:app.root.gotoTitle()
244
+
245
+ Button:
246
+
247
+ text:'チェック'
248
+
249
+ on_press: app.root.board.check()
250
+
251
+ <Const@Label>:
252
+
253
+ canvas.before:
254
+
255
+ Color:
256
+
257
+ rgb:0.6,1,1
258
+
259
+ Rectangle:
260
+
261
+ pos:self.pos
262
+
263
+ size:self.size
264
+
265
+ <NumInput@textInput>:
266
+
267
+ font_size:32
268
+
269
+ hint_text: '-'
270
+
271
+ input_filter: 'int'
272
+
273
+ multiline: False
274
+
275
+ padding: self.width/4, (self.height-self.line_height)/2
276
+
277
+ on_text:
278
+
279
+ if len(self.text)>2:self.text = self.text[1:3]
280
+
281
+ if self.text=='':self.value=0
282
+
283
+ else:self.value = int(self.text)
284
+
285
+
286
+
287
+ <CheckView@ModalView>:
288
+
289
+ auto_dismiss: False
290
+
291
+ background_color:0,0,0,0.5
292
+
293
+ is_current : True
294
+
295
+ size_hint: 0.5,0.5
296
+
297
+ BoxLayout:
298
+
299
+ canvas.before:
300
+
301
+ Color:
302
+
303
+ rgb:1,1,0.9
304
+
305
+ Rectangle:
306
+
307
+ pos: self.pos
308
+
309
+ size: self.size
310
+
311
+ orientation: 'vertical'
312
+
313
+ padding:self.width/10
314
+
315
+ Label:
316
+
317
+ size_hint_y:4
318
+
319
+ text:'正解 :-)' if root.is_correct else '不正解 :-('
320
+
321
+ Button:
322
+
323
+ text: 'OK'
324
+
325
+ on_press:
326
+
327
+ root.dismiss()
328
+
329
+ if root.is_correct: app.root.gototitle()
330
+
331
+
332
+
333
+
334
+
335
+ <Label>:
336
+
337
+ color: 0.5,025,0.25,1
338
+
339
+ font_name: 'VL-Gothic-Regular.ttf'
340
+
341
+ font_size :32
342
+
343
+ <Button>:
344
+
345
+ color:1,1,1,1
346
+
347
+ font_size:24
348
+
349
+
350
+
351
+
352
+
353
+ ```
354
+
355
+
356
+
357
+
358
+
359
+
360
+
161
361
  ### 試したこと
162
362
 
163
363
 

2

コードの表示を変更しました。

2018/11/29 01:18

投稿

shield
shield

スコア16

test CHANGED
File without changes
test CHANGED
File without changes

1

コードの表示を変更しました。

2018/11/29 00:38

投稿

shield
shield

スコア16

test CHANGED
File without changes
test CHANGED
@@ -44,11 +44,7 @@
44
44
 
45
45
 
46
46
 
47
- ```ここに言語名を入力
47
+ ```python
48
-
49
- ソースコード
50
-
51
- ```
52
48
 
53
49
  from kivy.app import App
54
50
 
@@ -158,6 +154,8 @@
158
154
 
159
155
 
160
156
 
157
+ ```
158
+
161
159
 
162
160
 
163
161
  ### 試したこと