Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
数独ではじめるアルゴリズム 第二章 UI
Search
Ryosuke Uchiyama
October 28, 2020
Programming
0
31
数独ではじめるアルゴリズム 第二章 UI
Ryosuke Uchiyama
October 28, 2020
Tweet
Share
More Decks by Ryosuke Uchiyama
See All by Ryosuke Uchiyama
ChatGPT実践
step63r
1
270
深層強化学習で東方AI 第一章 DQNの基本
step63r
0
120
Build 2021 プレイバック
step63r
0
27
WPFで実践アプリ開発! 第四章 機能の実装 Part 2
step63r
0
36
WPFで実践アプリ開発! 第三章 機能の実装 Part 1
step63r
0
98
WPFで実践アプリ開発! 第二章 UI
step63r
0
120
WPFで実践アプリ開発! 第一章 Windowsアプリの歴史
step63r
0
310
数独ではじめるアルゴリズム 第三章 OCR
step63r
0
78
数独ではじめるアルゴリズム 第一章 実装と高速化
step63r
0
110
Other Decks in Programming
See All in Programming
SpringBoot3.4の構造化ログ #kanjava
irof
2
970
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
Formの複雑さに立ち向かう
bmthd
1
720
Pulsar2 を雰囲気で使ってみよう
anoken
0
230
Software Architecture
hschwentner
6
2.1k
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
270
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
130
定理証明プラットフォーム lapisla.net
abap34
1
1.7k
Amazon S3 TablesとAmazon S3 Metadataを触ってみた / 20250201-jawsug-tochigi-s3tables-s3metadata
kasacchiful
0
100
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
5
3.8k
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
200
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Scaling GitHub
holman
459
140k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Code Review Best Practice
trishagee
66
17k
Transcript
数独ではじめるアルゴリズム 第二章 UI Ryosuke Uchiyama step63r
グラフ構造と深さ優先探索(DFS) 0 1 2 3 4 11 5 8 6
7 9 10 12 13 14 前 回 の あ ら す じ
入れられる数字の選択肢が少ないマスから埋めていく 3 6 5 4 8 7 9 4 5
1 9 7 3 5 6 8 9 6 5 4 4 6 5 5 6 5 3 5 3 4 5 6 5 3 4 4 4 6 5 5 5 4 4 5 5 5 4 4 5 5 5 4 7 3 3 4 3 4 4 5 6 4 4 5 6 5 4 4 6 4 5 7 7 4 6 7 7 5 6 6 8 問題 入れられる数字の残数 ここから処理するよりも… この辺から処理した方が速い! 前 回 の あ ら す じ
一意に決まるマスはあらかじめ埋めておく 3 6 5 4 8 7 9 4 5
1 9 7 3 5 6 8 9 問題 5 8 3 6 5 4 8 7 5 9 4 6 5 9 1 5 9 7 3 5 6 8 5 9 5 前処理後の問題 前 回 の あ ら す じ
今後やること • UI実装(WPFかXamarinあたり) • モバイル対応(iOSアプリをビルドする環境がない……つらたん……) • OCR(問題をカメラで撮ってAzure Cognitive Servicesとかで盤面認識&自動解答) •
マルチスレッド(たぶんやらないやつ) 前 回 の あ ら す じ
WPFとMVVMパターン
WPFにおける見た目 <> C# XAML (MainWindow.xaml) コードビハインド (MainWindow.xaml.cs)
素直に分離 <> XAML (MainWindow.xaml) C# コードビハインド (MainWindow.xaml.cs) C# その他クラス 見た目
ロジック
データバインディングに最適化 <> XAML + コードビハインド C# C# その他クラス C# 見た目
ロジック データバインドの ソース
MVVMパターン View ViewModel Model データ バインディング コマンド メソッド呼出し プロパティ設定 変更通知
変更通知
なぜMVVMなのか • 見た目とロジックを分離できる • 分離できるのでテストコードが書きやすくなる • コードビハインドの記述が減る(複雑な描画処理の場合は必要) • UIスレッド外からの変更通知が容易に受け取れる •
Viewがインスタンスを持たなくてもオブジェクトの操作が可能になる
Xamarin
今までのアプリ開発 iOS App Android App Windows App Objective-C Xcode Java
Eclipse C# Visual Studio
Xamarin • ネイティブAPIを100%移植 • ネイティブアプリを作成できる • C# / .NET /
Visual Studioで開発できる • コードを共通化できる • 画面も共通化できる
Xamarinネイティブ iOS C# UI Android C# UI Windows C# UI
Shared C# Backend
Xamarin.Forms Shared C# Backend Shared UI Code iOS Android Windows
つくったもの
SudokuApp MainPage Button Button SudokuControl SudokuControl Entry Entry Entry Entry
Entry Entry Entry Entry Entry ︙ … MainViewModel カメラ起動 コマンド 解答実行 コマンド SudokuControlViewModel 数独 プロパティ 盤面 プロパティ メッセージ通知 連動 Sudoku 盤面 メンバ変数 深さ優先探索 メソッド
Demo
今後やること • UI実装(WPFかXamarinあたり) • モバイル対応(iOSアプリをビルドする環境がない……つらたん……) • OCR(問題をカメラで撮ってAzure Cognitive Servicesとかで盤面認識&自動解答) •
マルチスレッド(たぶんやらないやつ)