Media Summary: This 4 lines of code: val piece = chessModel.pieceAt(col, row) if (piece != This is an important design decision. Classes working together should be loosely coupled. We created an interface named ... Half open range "0 until 8" is equivalent to closed range "0..7". We prefer half open range in our for loops.

Android Chess 005 Kotlin Nullable - Detailed Analysis & Overview

This 4 lines of code: val piece = chessModel.pieceAt(col, row) if (piece != This is an important design decision. Classes working together should be loosely coupled. We created an interface named ... Half open range "0 until 8" is equivalent to closed range "0..7". We prefer half open range in our for loops. We do need a singleton of our ChessGame class (was ChessModel in previous videos). Access 7000+ courses for 15 days FREE: Avoid NullPointerException in "Rank" and "File" are terminology used in

We started to play with MotionEvent.ACTION_DOWN, MotionEvent.ACTION_MOVE and MotionEvent.ACTION_UP. We'll use them ... Capture is also handled in this movePiece(..) method. GitHub repo: We also created a mutable set of ChessPiece named piecesBox in ChessModel. GitHub repo: ... We let moving piece follow our finger and fixed a bug caused by mutable ChessPiece in the mutable set pieceBox in ChessModel. We demonstrated a use case of MutableMap with key type Int, which is After removing those clunky braces, the latest code looks so elegant and stylish: desc += when (piece.rank) { ChessRank.

The second param in PrintWriter constructor is important for our app for auto flushing each Welcome to Debug Duck, Learn software engineering, programming, and technology in a simple and practical way. Tips, insights ...

Photo Gallery

Android Chess 005: Kotlin nullable used in method "pieceAt(col: Int, row: Int) : ChessPiece?"
Android Chess 015: Introducing Kotlin "let" and "it" syntax used for nullable
Android Chess 016: Using Kotlin interface to decouple classes ChessView and MainActivity
Android Chess 042: Half open range in Kotlin "0 until 8"
Android Chess 036: Using Kotlin keyword "object" for singleton
Android Kotlin Tutorial: Use Null Safety Operators to make code robust #4.4
Android Chess 051: Creating Kotlin data class Square to group col and row
Android Chess 020: Overriding onTouchEvent(..) method in ChessView
Android Chess 019: Implementing ChessModel.movePiece(..) method
Android Chess 003: Overriding toString() of class Any to print out the empty chess board in Logcat
Android Chess 007: Drawing 8x8 chessboard in Kotlin
Android Chess 004: Creating Kotlin data class ChessPiece, enum classes ChessPlayer and ChessRank
Sponsored
Sponsored
View Detailed Profile
Android Chess 005: Kotlin nullable used in method "pieceAt(col: Int, row: Int) : ChessPiece?"

Android Chess 005: Kotlin nullable used in method "pieceAt(col: Int, row: Int) : ChessPiece?"

Kotlin's

Android Chess 015: Introducing Kotlin "let" and "it" syntax used for nullable

Android Chess 015: Introducing Kotlin "let" and "it" syntax used for nullable

This 4 lines of code: val piece = chessModel.pieceAt(col, row) if (piece !=

Sponsored
Android Chess 016: Using Kotlin interface to decouple classes ChessView and MainActivity

Android Chess 016: Using Kotlin interface to decouple classes ChessView and MainActivity

This is an important design decision. Classes working together should be loosely coupled. We created an interface named ...

Android Chess 042: Half open range in Kotlin "0 until 8"

Android Chess 042: Half open range in Kotlin "0 until 8"

Half open range "0 until 8" is equivalent to closed range "0..7". We prefer half open range in our for loops.

Android Chess 036: Using Kotlin keyword "object" for singleton

Android Chess 036: Using Kotlin keyword "object" for singleton

We do need a singleton of our ChessGame class (was ChessModel in previous videos).

Sponsored
Android Kotlin Tutorial: Use Null Safety Operators to make code robust #4.4

Android Kotlin Tutorial: Use Null Safety Operators to make code robust #4.4

Access 7000+ courses for 15 days FREE: https://pluralsight.pxf.io/c/1291657/431340/7490 Avoid NullPointerException in

Android Chess 051: Creating Kotlin data class Square to group col and row

Android Chess 051: Creating Kotlin data class Square to group col and row

"Rank" and "File" are terminology used in

Android Chess 020: Overriding onTouchEvent(..) method in ChessView

Android Chess 020: Overriding onTouchEvent(..) method in ChessView

We started to play with MotionEvent.ACTION_DOWN, MotionEvent.ACTION_MOVE and MotionEvent.ACTION_UP. We'll use them ...

Android Chess 019: Implementing ChessModel.movePiece(..) method

Android Chess 019: Implementing ChessModel.movePiece(..) method

Capture is also handled in this movePiece(..) method. GitHub repo: https://github.com/zhijunsheng/

Android Chess 003: Overriding toString() of class Any to print out the empty chess board in Logcat

Android Chess 003: Overriding toString() of class Any to print out the empty chess board in Logcat

This is the

Android Chess 007: Drawing 8x8 chessboard in Kotlin

Android Chess 007: Drawing 8x8 chessboard in Kotlin

We created ChessView and drew 8x8

Android Chess 004: Creating Kotlin data class ChessPiece, enum classes ChessPlayer and ChessRank

Android Chess 004: Creating Kotlin data class ChessPiece, enum classes ChessPlayer and ChessRank

We also created a mutable set of ChessPiece named piecesBox in ChessModel. GitHub repo: ...

Android Chess 023: Don't use mutable element in Set

Android Chess 023: Don't use mutable element in Set

We let moving piece follow our finger and fixed a bug caused by mutable ChessPiece in the mutable set pieceBox in ChessModel.

Android Chess 011: Using Kotlin mutable map to cache all 12 piece bitmaps

Android Chess 011: Using Kotlin mutable map to cache all 12 piece bitmaps

We demonstrated a use case of MutableMap with key type Int, which is

Android Chess 039: Kotlin allows us to use less curly braces { and } to make code more readable

Android Chess 039: Kotlin allows us to use less curly braces { and } to make code more readable

After removing those clunky braces, the latest code looks so elegant and stylish: desc += when (piece.rank) { ChessRank.

What Happens if You Add `null + null` in Kotlin? | Kotlin Tips 2023

What Happens if You Add `null + null` in Kotlin? | Kotlin Tips 2023

Null

Kotlin Tutorial #4: Null Safety — Zero NullPointerExceptions

Kotlin Tutorial #4: Null Safety — Zero NullPointerExceptions

Kotlin

Android Chess 031: Game playable over socket now

Android Chess 031: Game playable over socket now

The second param in PrintWriter constructor is important for our app for auto flushing each

11- Nullable vs Non Nullable Types in Kotlin

11- Nullable vs Non Nullable Types in Kotlin

Welcome to Debug Duck, Learn software engineering, programming, and technology in a simple and practical way. Tips, insights ...

Related Video Content

Microsoft account | Sign In or Create Your Account Today – Microsoft information

Get access to free online versions of Outlook, Word, Excel, and PowerPoint.

Sign in to your account information

Access and manage your Microsoft account, subscriptions, and settings all in one place.

Office 365 login information

Collaborate for free with online versions of Microsoft Word, PowerPoint, Excel, and OneNote. Save documents,...

Microsoft - Wikipedia information

Microsoft Corporation is an American multinational technology company headquartered in Redmond, Washington. The...

Create your Microsoft account information

Create your Microsoft account to access various services and features.