2011年8月26日金曜日

▲ 今日からはじめる 「ドキュメントトーカ 日本語音声合成エンジン for Windows 7」


【はじめに】
・ここに掲載してあります、「BLOG投稿」の内容は主に概要を記載してあります。
・詳細な、「導入・構築・操作マニュアル」等は本文中に記載してあります、
>(例)・click -> ■マニュアルのタイトル のような別リンクを張っています。
・このリンクは、■Google ドキュメント で記載されたもので、
>「共有設定」-> ◎「ウエッブで一般公開」されています。
●また、画像はクリックすると拡大表示できます。

■ ドキュメントトーカ 日本語音声合成エンジン for Windows 7 and ドキュメントトーカ Plusの導入と運用フロー

・click (pdf)-> ■ CD-ROM版ドキュメントトーカ 日本語音声合成エンジン for Windows (x64)
・click (pdf)-> ■ ドキュメントトーカ 日本語音声合成エンジン for Windows ドキュメントトーカ Plus

【ドキュメントトーカ Plusの機能】

■64ビット機において、日本語合成エンジンの32ビット版、64ビット版の共存は可能です。
■ドキュメントトーカ 日本語音声合成エンジンは、
・Microsoft社のSpeech API Ver4(SAPI4)及び Ver5(SAPI5) に対応した音声合成エンジンです。
・Windows 7, Windows Vista, Windows XPでは、標準でSAPI5 英語エンジンが搭載されておりますが
日本語エンジンは搭載されておりません。
●ドキュメントトーカ日本語音声合成エンジンをインストールすることにより、
・【「ドキュメントトーカ Plus」】のほか、
・【Microsoft Office】や、【Excel の数値読み上げ】などの音声合成を利用したアプリケーション
の実行が可能です。
●声種(SAPI4, SAPI5)について
・たかし / けいこ / 太郎 / 花子 / 小太郎 / はなちゃん / ロボ太郎 / ロボ子
●【ドキュメントトーカ Plus(Freeware)】の機能について
・ブラウザー( Internet Explorer )上で任意の個所の読み上げ
・クリップボードの読み上げ
・さまざまな文書ファイルの読上げ
▲LAMEを利用すれば、文書ファイルやホームページをMP3に変換して携帯音楽プレーヤーで
聞くことができます。

■インストール準備(アプリケーションの準備:Download)
・<参照> ⇨ http://www.createsystem.co.jp/DTalkerSapi1.html

★製品版「ドキュメントトーカ日本語音声合成エンジン for Windows」には
⊿「ドキュメントトーカPlus」⊿「ドキュメントトーカPlus V2.1」が同梱

(注)
Install[要:☑ 否:* 任意:-(開発対応)] ファイル名 サイズ(ファイル数)

⊿【購入】日本語音声合成エンジン(ドキュメントトーカ日本語音声合成エンジン)
☑ CD-ROM 提供

①【free】ドキュメントトーカ日本語音声合成エンジン64ビット版へのアップデータ
* DTENGINEX64UPDATE.EXE 59094907

②【free】ドキュメントトーカ辞書アップデータ(64ビット版)
☑ dtdictupdt_setupx64.zip 573604

③【free】ドキュメントトーカ辞書アップデータ(32ビット版)
* dtdictupdt_setupx86.zip 573424

⊿【free】 ④ドキュメントトーカPlus
☑ DTalkerPFree.EXE 2338135

⊿【free】 ⑤ドキュメントトーカ Plus Ver2.1.1.7 20100917
☑ DTALKERPV2117.EXE 10342486

⑥【free】ドキュメントトーカ クリップボードリーダー
☑ DTCLPREADER.EXE 863039

⑦【free】Visual Studio .NET 用コンポーネント・サンプル・説明
- DTttsFramwork.zip 222224

・click (ppt)-> ■ ドキュメントトーカ導入編

・click (ppt)-> ■ ドキュメントトーカ操作編(例)

・Plus V2 MP3 作成 / 読む
・Plus MP3 作成 / 読む
・Internet Explorer
・メール
・文書ファイル

■
■

2011年8月23日火曜日

▲ 今日からはじめる Microsoft Office Labs Community Clips 導入・操作


【はじめに】
・ここに掲載してあります、「BLOG投稿」の内容は主に概要を記載してあります。
・詳細な、「導入・構築・操作マニュアル」等は本文中に記載してあります、
>(例)・click -> ■マニュアルのタイトル のような別リンクを張っています。
・このリンクは、■Google ドキュメント で記載されたもので、
>「共有設定」-> ◎「ウエッブで一般公開」されています。
●また、画像はクリックすると拡大表示できます。

■Community Clips を使ってみる

・Community Clips は、デスクトップを動画としてキャプチャーできる
Microsoft社の動画キャプチャーソフトです。

・click (PowerPoint)-> ■ CommunityClips_概要導入操作

【特徴】

[使用方法]

・【録画開始】-> [Windows]+[Alt]+[R]
・【録画終了】-> [Windows]+[Alt]+[T]
・【キャプチャー動画の閲覧・ファイル保存】

[動画フォーマット]

・WMV形式のみ

[その他]

・Microsoft Officeのアドインとして動作します。

■
■

2011年8月19日金曜日

▲ 今日からはじめる Scratch 概要・導入・演習


【はじめに】
・ここに掲載してあります、「BLOG投稿」の内容は主に概要を記載してあります。
・詳細な、「導入・構築・操作マニュアル」等は本文中に記載してあります、
>(例)・click -> ■マニュアルのタイトル のような別リンクを張っています。
・このリンクは、■Google ドキュメント で記載されたもので、
>「共有設定」-> ◎「ウエッブで一般公開」されています。
●また、画像はクリックすると拡大表示できます。

【概要】:
Scratchは、対話的なストーリーやゲーム、アニメーションを作成したり、作品を
web上の他の ユーザと共有することを容易にする新しいプログラミング言語です。

・click (PDF)-> ■ Scratch_概要導入演習

・click (ppt)-> ■ Scratch_概要


■【Scratch習得のステップガイド】


△“Getting Started Guide” :(http://scratch.mit.edu/files/ScratchGettingStarted.pdf)

△リファレンスガイド :http://scratch.mit.edu/files/ScratchReferenceGuide.pdf

△Scratchのウェブサイト :http://scratch.mit.edu/howto
・チュートリアルビデオ
・Scratchカード

■「Scratch」プロジェクトの基本的な【構成要素】

▲【Scratchのプロジェクト】は、
●【スプライト】と呼ばれる『オブジェクト』から成り立っています。
【Sprite】-- ①Paint new sprite -> ②Choose new sprite from file -> ③Get suprise sprite
↓ (外見:人間・電車・チョウ・画像)
+【Scripts】-【Spriteへの指示】
「Scratch」はスクリプトの最初のブロックから最後までを実行します
+【Costumes】(どのような外見かを別のコスチューム(衣装)を与える)
+【Sounds】--+-- Record --
+-- Import -- Animal/Effect/Electronic/Human/Instruments
Music Loops/Percussion/Vocals

■【サポート】どこからScratchとScratchのWebサイトを始めればよいですか?
・http://info.scratch.mit.edu/ja/Support

■step 1:【Scratchをはじめようを読む】
・http://info.scratch.mit.edu/ja/Support/Get_Started

■step 2:【Scratchをはじめよう】
・http://docs.google.com/viewer?url=http://info.scratch.mit.edu/sites
/infoscratch.media.mit.edu/files/file/translated-docs/scratchgsguide_10ja_080811.pdf

【Scratch ブロックの解説】
・ [1] 動き      Motion
・ [2] 見た目   Looks
・ [3] 音         Sound
・ [4] ペン      Pen
・ [5] 制御     Control     
・ [6] 調べる  Sensing
・ [7] 数        Operators
・ [8] 変数     Variables

■step 3:【Scratchリファレンスガイド 】
・http://docs.google.com/viewer?url=http://info.scratch.mit.edu/sites/
infoscratch.media.mit.edu/files/file/translated-docs/ReferenceGuide_v1.4ja_080902.pdf

■step 4:【Scratchカード 】
・Scratch_Cards_Japanese_a-z_080813

■step 5:【Scratchのビデオ】
⊿http://info.scratch.mit.edu/ja/Support/Videos

・Welcome to Scratch
・How to use Scratch intro
http://www.youtube.com/watch?v=jxDw-t3XWd0&feature=player_embedded
・About Scratch - Interviews
・Example: Image effects
・Our Scratch Workshop
http://www.youtube.com/watch?v=eQGiv53SE4k&feature=player_embedded
・Ideasforlife.tv
・Kids Programming with Scratch
・Scratch on Channel 8 news
http://www.youtube.com/watch?v=AZn4z2qii3k&feature=player_embedded
・Fairfax County Schools SchoolScene

■【Scratchについて質問】があるときは?

⊿Scratch FAQを読む
【Scratch FAQ】 http://info.scratch.mit.edu/ja/Support/Scratch_FAQ

⊿Scratchフォーラムを検索
【Scratch Forums】 http://scratch.mit.edu/forums/

⊿教員用の資料が必要ですか?
【Educators】 http://info.scratch.mit.edu/ja/Educators
【ScratchEd】 http://scratched.media.mit.edu/

⊿他の言語用のScratchはありますか?
【Languages】 http://info.scratch.mit.edu/ja/Languages
【Translation】 http://info.scratch.mit.edu/ja/Translation

⊿Scratchセンサーボードとは何ですか?
【Sensor Boards】 http://info.scratch.mit.edu/ja/Sensor_Boards

⊿Scratchの関連商品はどこにありますか?
【Scratch Store】 http://info.scratch.mit.edu/ja/Scratch_Store

■【導入】

・click (ppt)-> ■ Scratch_導入

①Scratchソフトウェアをダウンロード(FreeWare)
【Windows】:ScratchInstaller1.4.exe
・http://info.scratch.mit.edu/Scratch_1.4_Download

【Linux Ubunts】:scratch_1.4.0.1-0ubuntu5_i386.deb
・http://info.scratch.mit.edu/Scratch_1.4_Download

②Scratchソフトウェアをインストール

■【演習】

・click (ppt)-> ■ Scratch_演習_ScratchCard_1

・click (ppt)-> ■ Scratch_演習_ScratchCard_2

・click (ppt)-> ■ Scratch_演習_Dancing and Music

・click (ppt)-> ■ Scratch_Simple Pong Game

・click (ppt)-> ■ Scratch_プロジェクト_バックアップ & リストア

■【資料:Scratch Scripts Help Hand Book】

・click (ppt)-> ■ Scratch_About Scratch 1.4

・click (ppt)-> ■ Scratch Scripts Help Hand Book_1

・click (ppt)-> ■ Scratch Scripts Help Hand Book_2

・click (ppt)-> ■ Scratch Scripts Help Hand Book_3

・click (ppt)-> ■ Scratch Scripts Help Hand Book_4

■【資料:Scratch -> How to create a sprite (Spriteの作り方)】

・click (ppt)-> ■ Scratch_How to create a sprite (Spriteの作り方)

③「Scratchをはじめよう」を実施する
⊿step 1:【Scratchをはじめようを読む】
http://info.scratch.mit.edu/ja/Support/Get_Started

⊿step 2:【Scratchをはじめよう】 http://docs.google.com/viewer?url=
http://info.scratch.mit.edu/sites/infoscratch.media.mit.edu/files/file/
translated-docs/scratchgsguide_10ja_080811.pdf

④Webサイトの「アカウントを作成」(サインアップ)する。
http://scratch.mit.edu/signup

⑤作品を「ScratchのWebサイト」で「共有」する。

⑥ScratchのWebサイトにログインして自分の作品を見る。

■【マイプロジェクト】
http://scratch.mit.edu/users/*******
⑦他の人の作品をダウンロードしてプログラムを見る。

■【スクラッチのダウンロード】
http://scratch.mit.edu/download

■【YouTube : Scratch tutorilal】

・■ Mitchel Resnick Scratch
・■ Musical Live Coding Improv Performance using Scratch at the MIT Media Lab
・■ Poznaj Scratch'a (Scratch, Media Lab Video, PL)
・■ Scratch simple gravity game
・■ Scratch Tutorial 1
・■ Scratch Lesson 1 of 10
・■ Scratch Lesson 2 of 10
・■ Scratch Lesson 3: Dance to the Beat!
・■ Scratch Lesson 4: Sprite Interactions via Variables
・■ Scratch Lesson 5: Get On the Stage!
・■ Making A Simple Pong Game in Scratch
・■ Scratch Tutorial Animation
・■ Scratch Car Race Tutorial - Part 1
・■ Scratch Car Race Tutorial - Part 2
・■ Scratch Car Race Tutorial - Part 3
・■ Scratch Tutorial 2 - Move and Change Costume
・■ Scratch Tutorial 3 - Making Sounds
・■ Scratch Random Numbers Tutorial by Passy's World
・■ Scratch Short Story Tutorial - Part 1 of 3
・■ Scratch Short Story Tutorial - Part 2 of 3
・■ Scratch Short Story Tutorial - Part 3 of 3
・■ Scratch Tutorial 1 - Move With Arrow Keys
・■ Scratch Tutorial Broadcast Basics
・■ Scratch Tutorial
・■ Scratch Tutorial: Looks
・■ How to Easily Fire: Scratch Tutorial
・■ Basic Scratch Tutorial 3 - Creating Sprites
・■ Scratch Tutorial 4 - Motion
・■ Scratch 5 - Looks Commands
・■ How to use scratch: Variables
・■ Lesson 1 - Scratch Basics
・■ Lesson 2 - Sensing and Events
・■ Lesson 3 - Sensing and Broadcasting
・■ Scratch Tutorial - How To Use BroadCast
・■ Scratch Animation - How to change backgrounds using "broadcast"


■
■

2011年7月21日木曜日

▲ 今日からはじめる 名刺作成:無償ラベルカード印刷ソフト 【A-one ラベル屋さんHOME】 / 【 Avery maxellラベルプロデューサー】で作る名刺


【はじめに】
・ここに掲載してあります、「BLOG投稿」の内容は主に概要を記載してあります。
・詳細な、「導入・構築・操作マニュアル」等は本文中に記載してあります、
>(例)・click -> ■マニュアルのタイトル のような別リンクを張っています。
・このリンクは、■Google ドキュメント で記載されたもので、
>「共有設定」-> ◎「ウエッブで一般公開」されています。
●また、画像はクリックすると拡大表示できます。

■名刺作成フロー



・click (PowerPoint)-> ■ A one_スケルトンでの名刺作成マニュアル_(1/2)

・click (PowerPoint)-> ■ A one_新規作成マニュアル_(2/2)

・click (PowerPoint)-> ■ Avery_スケルトンでの名刺作成マニュアル


■ラベル屋さんHOME ver.8
・click (PDF)-> ■ ラベル屋さんHOME ver.8 < 機能 説明 1/2 >
・click (PDF)-> ■ ラベル屋さんHOME ver.8 < 機能 説明 2/2 >
■
■

2011年7月2日土曜日

▲ 今日からはじめる Google The Go programming language

【はじめに】
・ここに掲載してあります、「BLOG投稿」の内容は主に概要を記載してあります。
・詳細な、「導入・構築・操作マニュアル」等は本文中に記載してあります、
>(例)・click -> ■マニュアルのタイトル のような別リンクを張っています。
・このリンクは、■Google ドキュメント で記載されたもので、
>「共有設定」-> ◎「ウエッブで一般公開」されています。
●また、画像はクリックすると拡大表示できます。

【Windows版 32bit 対応】
(1)まず、Linux環境に導入する前にWindows環境でGO言語を試して、
その後Ubuntu 11.04 Linux 環境を構築し導入する試行手順を紹介いたします。

・click(PowerPoint:詳細手順操作マニュアル) -> ■ Windows Porting –GOを試行してみる。 Install->Compile->Run 迄を実行

【Windows Porting –GO 導入フロー】
【Go言語:ソースコード】作成例
【Go言語:Compile & Run】実行例
【Go言語:Command】


【Ubuntu Linux版 32bit 対応】
■The Go programming languageの導入

【The Go programming languageの特徴】
・Goプログラミング言語の文法は、型宣言を除いてC言語と似ている。
・for文やif文について、括弧 () で括らない
・メモリ管理はガベージコレクションに一任され、連想配列も備える。
・並列処理はアントニー・ホーアによるCSPのプロセス代数をモデルとする。
 また、チャンネル といったPi-calculusの特徴も持つ。
・例外処理やクラスの継承、ジェネリックプログラミング、アサーション、
 オーバーロードといった機能が存在しない。
・関数は多値を返すことができる。

【Introduction:The Go programming language】
□The Go programming language (open source コンパイル型の言語) Introduction Links □Quick Links □For newcomers:   http://golang.org/doc/install.html ■Getting Started   http://golang.org/doc/go_tutorial.html ■Tutorial   http://golang.org/doc/effective_go.html ■Effective Go http://golang.org/doc/go_faq.html ■Go FAQ http://golang.org/doc/docs.html ■Other Documentation http://code.google.com/intl/ja/appengine/docs/go/ ■Go for Google App Engine □For developers: http://godashboard.appspot.com/package ■Package Dashboard http://code.google.com/p/go/issues/list ■Issue Tracker http://godashboard.appspot.com/ ■Build Status http://code.google.com/p/go/source/browse/ ■Go Source http://code.google.com/p/go/source/list ■[changes] http://golang.org/pkg/ ■Package Reference http://golang.org/doc/go_spec.html ■Language Specification □Go Videos  http://www.youtube.com/watch?v=-i0hat7pdpk ■Google I/O 2011: Writing Web Apps in Go □Go Blog  http://blog.golang.org/2011/06/profiling-go-programs.html  ■Profiling Go ProgramsFri, 24 Jun http://blog.golang.org/2011/06/spotlight-on-external-go-libraries.html  ■Spotlight on external Go librariesFri, 03 Jun  http://blog.golang.org/2011/05/gif-decoder-exercise-in-go-interfaces.html  ■A GIF decoder: an exercise in Go interfacesWed, 25 May 【step_01:Getting Started】 
・click -> (注):「2011年7月2日土曜日:▲ 今日からはじめる 
 Ubuntu 11.04 (Natty Narwhal) の Install 操作ガイド」で構築した
 Ubuntu 11.04に「Google The Go programming language」を導入します。
 
・click -> (PowrPoint) ■The Go programming language 導入操作マニュアル:Getting Started ■A Tutorial for the Go Programming Language 【Day 1】The Go Programming Language Part 1 【Day 2】The Go Programming Language Part 2 【Day 3】The Go Programming Language Part 3 【Videos and Talks】 ■Writing Web Apps in Go ・presentation slides ■Real World Go ・presentation slides ■Go Programming ■Practical Go Programming ・presentation slides ■The Go Tech Talk ・presentation slides ■gocoding YouTube Channel ■Screencast: Writing Go Packages ■Screencast: Testing Go Packages (slide)■The Expressiveness Of Go ■Another Go at Language Design ・presentation slides ■Go Emerging Languages Conference Talk ・presentation slides (pdf)■The Go frontend for GCC ■The Go Promo Video ◆◆◆ Samples ◆◆◆ ◆【01_Hello World!】 package main import "fmt" func main() { fmt.Println("Hello, 世界") } 【01_Compile & Run】 Hello, 世界 ◆【02_Fibonacci Closure】 package main // fib returns a function that returns // successive Fibonacci numbers. func fib() func() int { a, b := 0, 1 return func() int { a, b = b, a+b return b } } func main() { f := fib() // Function calls are evaluated left-to-right. println(f(), f(), f(), f(), f()) } 【02_Compile & Run】 1 2 3 5 8 ◆【03_Peano Integers】 // Peano integers are represented by a linked list // whose nodes contain no data (the nodes are the data). // See: http://en.wikipedia.org/wiki/Peano_axioms // This program demonstrates the power of Go's // segmented stacks when doing massively recursive // computations. package main import "fmt" // Number is a pointer to a Number type Number *Number // The arithmetic value of a Number is the count of // the nodes comprising the list. // (See the count function below.) // ------------------------------------- // Peano primitives func zero() *Number { return nil } func isZero(x *Number) bool { return x == nil } func add1(x *Number) *Number { e := new(Number) *e = x return e } func sub1(x *Number) *Number { return *x } func add(x, y *Number) *Number { if isZero(y) { return x } return add(add1(x), sub1(y)) } func mul(x, y *Number) *Number { if isZero(x) || isZero(y) { return zero() } return add(mul(x, sub1(y)), x) } func fact(n *Number) *Number { if isZero(n) { return add1(zero()) } return mul(fact(sub1(n)), n) } // ------------------------------------- // Helpers to generate/count Peano integers func gen(n int) *Number { if n > 0 { return add1(gen(n - 1)) } return zero() } func count(x *Number) int { if isZero(x) { return 0 } return count(sub1(x)) + 1 } // ------------------------------------- // Print i! for i in [0,9] func main() { for i := 0; i <= 9; i++ { f := count(fact(gen(i))) fmt.Println(i, "! =", f) } } 【03_Compile & Run】 0 ! = 1 1 ! = 1 2 ! = 2 3 ! = 6 4 ! = 24 5 ! = 120 6 ! = 720 7 ! = 5040 8 ! = 40320 9 ! = 362880 ◆【04_Concurrent pi】 // Concurrent computation of pi. // See http://goo.gl/ZuTZM. // // This demonstrates Go's ability to handle // large numbers of concurrent processes. // It is an unreasonable way to calculate pi. package main import ( "fmt" "math" ) func main() { fmt.Println(pi(5000)) } // pi launches n goroutines to compute an // approximation of pi. func pi(n int) float64 { ch := make(chan float64) for k := 0; k <= n; k++ { go term(ch, float64(k)) } f := 0.0 for k := 0; k <= n; k++ { f += <-ch } return f } func term(ch chan float64, k float64) { ch <- 4 * math.Pow(-1, k) / (2*k + 1) } 【04_Compile & Run】 3.1417926135957908 ◆【05_concurrent Prime Sieve】 // A concurrent prime sieve // See "Prime Numbers" section of the tutorial: // http://golang.org/doc/go_tutorial.html package main // Send the sequence 2, 3, 4, ... to channel 'ch'. func Generate(ch chan<- int) { for i := 2; ; i++ { ch <- i // Send 'i' to channel 'ch'. } } // Copy the values from channel 'in' to channel 'out', // removing those divisible by 'prime'. func Filter(in <-chan int, out chan<- int, prime int) { for { i := <-in // Receive value from 'in'. if i%prime != 0 { out <- i // Send 'i' to 'out'. } } } // The prime sieve: Daisy-chain Filter processes. func main() { ch := make(chan int) // Create a new channel. go Generate(ch) // Launch Generate goroutine. for i := 0; i < 10; i++ { prime := <-ch print(prime, "\n") ch1 := make(chan int) go Filter(ch, ch1, prime) ch = ch1 } } 【05_Compile & Run】 2 3 5 7 11 13 17 19 23 29 ◆【06_peg Solitaire Solver】 // This program solves the (English) peg solitaire // board game. See also: // http://en.wikipedia.org/wiki/Peg_solitaire package main import "fmt" const N = 11 + 1 // length of a board row (+1 for \n) // The board must be surrounded by 2 illegal fields // in each direction so that move() doesn't need to // check the board boundaries. Periods represent // illegal fields, ● are pegs, and ○ are holes. var board = []int( `........... ........... ....●●●.... ....●●●.... ..●●●●●●●.. ..●●●○●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... `) // center is the position of the center hole if // there is a single one; otherwise it is -1. var center int func init() { n := 0 for pos, field := range board { if field == '○' { center = pos n++ } } if n != 1 { center = -1 // no single hole } } var moves int // number of times move is called // move tests if there is a peg at position pos that // can jump over another peg in direction dir. If the // move is valid, it is executed and move returns true. // Otherwise, move returns false. func move(pos, dir int) bool { moves++ if board[pos] == '●' && board[pos+dir] == '●' && board[pos+2*dir] == '○' { board[pos] = '○' board[pos+dir] = '○' board[pos+2*dir] = '●' return true } return false } // unmove reverts a previously executed valid move. func unmove(pos, dir int) { board[pos] = '●' board[pos+dir] = '●' board[pos+2*dir] = '○' } // solve tries to find a sequence of moves such that // there is only one peg left at the end; if center is // >= 0, that last peg must be in the center position. // If a solution is found, solve prints the board after // each move in a backward fashion (i.e., the last // board position is printed first, all the way back to // the starting board position). func solve() bool { var last, n int for pos, field := range board { // try each board position if field == '●' { // found a peg for _, dir := range [...]int{-1, -N, +1, +N} { // try each direction if move(pos, dir) { // a valid move was found and executed, // see if this new board has a solution if solve() { unmove(pos, dir) println(string(board)) return true } unmove(pos, dir) } } last = pos n++ } } // tried each possible move if n == 1 && (center < 0 || last == center) { // there's only one peg left println(string(board)) return true } // no solution found for this board return false } func main() { if !solve() { fmt.Println("no solution found") } fmt.Println(moves, "moves tried") } 【06_Compile & Run】 ........... ........... ....○○○.... ....○○○.... ..○○○○○○○.. ..○○○●○○○.. ..○○○○○○○.. ....○○○.... ....○○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○○○○.. ..○○○○○○○.. ..○○○●○○○.. ....○●○.... ....○○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○○○○.. ..○○○○○○○.. ..○○○○●●○.. ....○●○.... ....○○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○○○●○○.. ..○○○○○●○.. ....○●○.... ....○○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○○○●○○.. ..○○○●●○○.. ....○●○.... ....○○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○○○●○○.. ..○●●○●○○.. ....○●○.... ....○○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○○○●○○.. ..○●○○●○○.. ....●●○.... ....●○○.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○○○●○○.. ..○●○○●○○.. ....●●○.... ....○●●.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○●○●○○.. ..○●●○●○○.. ....○●○.... ....○●●.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○●○●○○.. ..○●○○●○○.. ....●●○.... ....●●●.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○●○●○○.. ..○●○○○●●.. ....●●○.... ....●●●.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○●○○○○.. ..○●○○●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○●○○○○.. ..○○●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○○.... ....○○○.... ..○○○○●○○.. ..○○●○○○○.. ..●●○●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○○.... ....●○○.... ..○○●○●○○.. ..○○○○○○○.. ..●●○●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○○.... ....●○○.... ..○○○○●○○.. ..○○●○○○○.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○●.... ....●○●.... ..○○○○○○○.. ..○○●○○○○.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○●.... ....●○○.... ..○○○○●○○.. ..○○●○●○○.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○●.... ....●○○.... ..○○○○●○○.. ..○○●○○●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○●.... ....●○○.... ..○○○○●○○.. ..○○○●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○●.... ....○○○.... ..○○●○●○○.. ..○○●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○○●.... ....○○○.... ..○○●○●○○.. ..●●○●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●○●.... ....●○○.... ..○○○○●○○.. ..●●○●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●○●.... ....○○○.... ..○○●○●○○.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●○●.... ....○○○.... ..○○●○○●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●○○.... ....○○●.... ..○○●○●●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●○○.... ....○○●.... ..●●○○●●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●○○.... ....○○●.... ..●○●●●●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....○●●.... ....○○●.... ..●○●●●●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●●●.... ....●○●.... ..●○○●●●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●●●.... ....●○●.... ..●●●○●●●.. ..●●●●●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... ........... ........... ....●●●.... ....●●●.... ..●●●●●●●.. ..●●●○●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... 391865 moves tried ◆【07_Tree Comparison】 // Two binary trees may be of different shapes, // but have the same contents. For example: // // 4 6 // 2 6 4 7 // 1 3 5 7 2 5 // 1 3 // // Go's concurrency primitives make it easy to // traverse and compare the contents of two trees // in parallel. package main import ( "fmt" "rand" ) // A Tree is a binary tree with integer values. type Tree struct { Left *Tree Value int Right *Tree } // Walk traverses a tree depth-first, // sending each Value on a channel. func Walk(t *Tree, ch chan int) { if t == nil { return } Walk(t.Left, ch) ch <- t.Value Walk(t.Right, ch) } // Walker launches Walk in a new goroutine, // and returns a read-only channel of values. func Walker(t *Tree) <-chan int { ch := make(chan int) go func() { Walk(t, ch) close(ch) }() return ch } // Compare reads values from two Walkers // that run simultaneously, and returns true // if t1 and t2 have the same contents. func Compare(t1, t2 *Tree) bool { c1, c2 := Walker(t1), Walker(t2) for { v1, ok1 := <-c1 v2, ok2 := <-c2 if !ok1 || !ok2 { return ok1 == ok2 } if v1 != v2 { break } } return false } // New returns a new, random binary tree // holding the values 1k, 2k, ..., nk. func New(n, k int) *Tree { var t *Tree for _, v := range rand.Perm(n) { t = insert(t, (1+v)*k) } return t } func insert(t *Tree, v int) *Tree { if t == nil { return &Tree{nil, v, nil} } if v < t.Value { t.Left = insert(t.Left, v) return t } t.Right = insert(t.Right, v) return t } func main() { t1 := New(100, 1) fmt.Println(Compare(t1, New(100, 1)), "Same Contents") fmt.Println(Compare(t1, New(99, 1)), "Differing Sizes") fmt.Println(Compare(t1, New(100, 2)), "Differing Values") fmt.Println(Compare(t1, New(101, 2)), "Dissimilar") } 【07_Compile & Run】 true Same Contents false Differing Sizes false Differing Values false Dissimilar