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
AWSでサーバレスな書籍管理アプリを作る
step63r
0
5
PythonでSlack通知botを作る
step63r
0
2
ChatGPT実践
step63r
1
280
IoT実践! 行先予定表を電子ペーパーで作る
step63r
0
3
React x Socket.ioで人狼サーバを作る 第一章 フロントエンド実装
step63r
0
2
深層強化学習で東方AI 第一章 DQNの基本
step63r
0
150
Build 2021 プレイバック
step63r
0
27
WPFで実践アプリ開発! 第四章 機能の実装 Part 2
step63r
0
36
WPFで実践アプリ開発! 第三章 機能の実装 Part 1
step63r
0
100
Other Decks in Programming
See All in Programming
MySQL初心者が311個のカラムにNot NULL制約を追加していってALTER TABLEについて学んだ話
hatsu38
2
100
七輪ライブラリー: Claude AI で作る Next.js アプリ
suneo3476
1
170
2025-04-25 GitHub Copilot Agent ライブデモ(スクリプト)
goataka
0
100
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
200
Rubyの!メソッドをちゃんと理解する
alstrocrack
1
120
The Implementations of Advanced LR Parser Algorithm
junk0612
2
1.3k
note の Elasticsearch 更新系を支える技術
tchov
9
3.4k
Serving TUIs over SSH with Go
caarlos0
0
580
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
360
音声プラットフォームのアーキテクチャ変遷から学ぶ、クラウドネイティブなバッチ処理 (20250422_CNDS2025_Batch_Architecture)
thousanda
0
390
KawaiiLT 登壇資料 キャリアとモチベーション
hiiragi
0
160
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1031
460k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
780
Faster Mobile Websites
deanohume
306
31k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
KATA
mclloyd
29
14k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
How to Ace a Technical Interview
jacobian
276
23k
The Cult of Friendly URLs
andyhume
78
6.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Why Our Code Smells
bkeepers
PRO
336
57k
We Have a Design System, Now What?
morganepeng
52
7.5k
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とかで盤面認識&自動解答) •
マルチスレッド(たぶんやらないやつ)