Category: SmartGo

Edit Game Record

It’s easy for mistakes to sneak in when you use SmartGo Kifu to record a game. At move 100, you notice that you placed an opening move off by one. Or you record afterwards, from memory, and you forgot an exchange played outside the main flow of the game. How do you fix it?

Go to Move

To correct a move, you first need to get back to when that move was played. Tap and hold on a stone, then choose Go to Move.

Go to move

Adjust Move

When you’re at the move that’s in the wrong place, tap and hold on that stone until the feedback changes, then drag it to the right spot. Voilà.

Insert Move Pair

If you’ve forgotten a pair of moves, first go to the position where those moves should have been played. Then tap on the popup menu in the bottom left of the board, and tap on Edit. Tap on the Insert 2 icon, then play the two moves. Instead of creating a new variation, those moves will be inserted directly into the game.

Insert two moves

SmartGo Kifu also provides commands to delete a single move or a whole branch, if your game record needs more extensive surgery. The Macintosh and Windows versions of SmartGo provide additional features to help you fix any issues in your game records.

Double-Tap to Zoom

Such a simple feature: double-tap to zoom in on the Go board. On the iPhone, it conveniently zooms to use the full height available. So why does SmartGo Kifu have a setting to turn it off?

Double tap to zoom

When SmartGo detects a tap on the board, your intent is not clear: do you plan to play a move, or is there a second tap coming? On iOS you can tell the system to disambiguate between the two gestures – for the single-tap to succeed, the double-tap has to fail:

singleTapGesture.require(toFail: doubleTapGesture)

The price you pay is that move entry is delayed by a quarter of a second. Thus that setting gives you a choice: convenient zooming or faster move entry. Not a good choice. (But at least you now know how to speed up move entry.)

There’s a better way to solve this: always play the move right away. Then if it turns out to be the first tap in a double-tap, undo the move and zoom the board instead. Fast move entry and zoom, no setting needed. However, that means being able to cleanly undo the move (and anything else that a tap on the board might do), and in SmartGo Kifu, that would be harder to implement than what the feature is worth.

Rewriting SmartGo in Swift is still work in progress; a long journey. But thanks to less technical debt, I’m able to add features like undo, and thus make move input fast while still allowing you to double-tap. Getting rid of a confusing setting always makes me happy.

Search and URL Scheme

The newest versions of SmartGo Kifu and SmartGo for Macintosh both include the enhanced names dictionary by John Fairbairn (GoGoD), with mini-biographies of over 4,000 players: life, career, status, teacher, Go style, and notes. Just tap on the player name above the board to see the biography.

Blog takemiya bio 

Improved search

The names dictionary includes translations as well as alternate names, and these are now used to significantly improve searching for players. Just type in the search bar, and it will try to match any property containing that text.

You can use ! to negate, e.g. type ‘Kato !Masao’ to look for all the other players named Kato. Anything that looks like a four-digit year will be matched to the date property, and you can search for a range, so e.g. ‘1990-1994 Takemiya’ will search for games Takemiya played during those years.

For more precise searches, you can test for specific properties and conditions, and combine conditions using & (and) and | (or). For example, you can type ‘winner=Lee Sedol & result~~0.5’ to find half-point wins by Lee Sedol (spelled Yi Se-tol in the game collection).

Blog winner lee sedol 

URL scheme

This kind of search is powerful within the app, but you can now access it from other apps too, thanks to the smartgo:// URL scheme. For example, the following link will get you directly to Shusaku’s ear-reddening move:

smartgo://games?id=1846-09-11a#127

Or find all the games played between AlphaGo and Ke Jie:

smartgo://games?player==AlphaGo & player==Ke Jie

Or find cool kyu-level problems:

smartgo://problems?coolness=10 & difficulty<=1k

Recent games of Gu Li playing black against Lee Sedol:

black==Gu Li & white==Lee Sedol & date>=2012

Games that Takemiya won by resignation playing black against a 9 dan:

smartgo://games?black=Takemiya Masaki & result=B+R & rankw=9d

Games played in the Kisei or Honinbo tournaments:

smartgo://games?event~~Kisei | event~~Honinbo

Three-stone handicap games played in the ’90s:

smartgo://games?handicap=3 & date>=1990 & date<=1999

Single-digit kyu life and death problems:

smartgo://problems?difficulty<=1k & difficulty>=9k & genre~~life

Please let me know how you use this new feature, and what could make it more useful to you.

Properties and operators

Here’s the complete list of properties currently supported (SGF tag):

  • Player: player (PB/PW), black (PB), white (PW), winner (PB/PW/RE), loser (PB/PW/RE), rankb (BR), rankw (WR).
  • Game info: id (GN), date (DT), event (EV), round (RO), komi (KM), handicap (HA), oldhandicap (OH), result (RE), rules (RU), time (TM), source (SO), analysis (AN), user (US), comment (GC).
  • Problems: difficulty (DI), coolness (CO), genre (GE).
  • Special: favorite (FA), any (any game info property).

The following operators are supported (comparisons are not case sensitive):

  • == or = : Equal
  • != : Not equal
  • ^= : Starts with
  • ~~ : Contains
  • !~ : Does not contain
  • >= : At least
  • <= : At most

Go Congress 2016

I really enjoyed the Go Congress in Boston this year. Some observations:

    • Next year, I will bring a 9.7″ iPad. The 12.9″ iPad Pro just doesn’t fit well between Go boards at the tournament, so I ended up using my iPhone to record games. Luckily, there’s an app for that.
    • Brady Daniels makes a good case that you should come to the next Go Congress. And Kevin’s Go Talk about “What did you like most about the Go Congress?” clearly shows that people are a main feature, not just Go. Indeed, it was great to meet many old friends again, and meeting new ones in real life for the first time, in particular David Nolen, John Tromp, and Jonathan Hop.
    • I always get a lot of valuable feedback from SmartGo Kifu and Go Books users at the Congress, mostly positive, some feature requests. Here’s a happy SmartGo user from Kyoto: Go instructor Yasuko Imamura.

Yasuko Imamura

  • There were several interesting talks about AlphaGo (watch the Opening Keynote and AlphaGo Insider). It’s clear that AlphaGo is adding to and not taking away from Go. I’m really looking forward to the commented AlphaGo games the DeepMind team teased several times.
  • I just realized that I never made it to the vendor area in the basement. Future Congress organizers: please put the vendors where everybody sees them.
  • The 13×13 tournament is usually a fun warm-up for the main tournament, hope it will be back next year.

Looking forward to San Diego in 2017! See you all there.

Learn Go Now

In March, Google’s AlphaGo is going to play a five-game match against Lee Sedol. For Go, this may become the equivalent of Kasparov’s match against Deep Blue. Tremendously exciting. And if you don’t know the game of Go, you’ll miss out.

So how do you get up to speed so you have a clue what’s going on? Several possibilities:

  • Friend or Go club: If you have a friend who has been trying to tell you about Go for years, now’s the time. Otherwise, check the American Go Association or the European Go Federation for a Go club near you. (In Salt Lake City, we meet every Thursday after 7 pm at the Salt Lake Roasting Co. — everybody is welcome, and we love to teach beginners about the game.)
  • App with tutorial: The SmartGo Player app for iPhone and iPad includes a tutorial that guides you through the (very simple) rules, then provides over 100 interactive problems to apply those rules (much more complex) and practice your tactics. Then as you play against the computer, it automatically adjusts the handicap to keep the game challenging.
  • Books about Go: There are a number of books that will give you a good introduction to the game , e.g. the “Learn to Play Go” series by Janice Kim followed by the “Graded Go Problems for Beginners” series. Here’s a list of beginner books. If you have an iPad or iPhone, use the Go Books app to read and solve problems interactively; if you prefer printed books, click on the Printed Book link in that list.

Enjoy learning about Go — it’s a game worth knowing. There’s a reason it has been played for thousands of years, and it will remain popular even after computers eventually conquer it.

My Path to Swift

After some experiments with Swift, I’ve been spending an increasing amount of time on a new project written completely in Swift. (Project to be revealed in due time.) Faster development, fewer bugs, and more fun — I’m hooked, and I don’t want to go back.

With the open source announcement of Swift delivering everything I wanted and more, there’s no reason to go back. Swift will be my main language for the next decade.

My programming language history

Most of my career has been focused on two large code bases, PowerPoint and SmartGo, and just a few programming languages. These languages have paved my path to Swift.

6502 assembler: After the TI-59 pocket calculator, my first real computer was a KIM-1. With a blistering speed of 1 MHz and a whole 1KB of RAM, that was an amazing machine. I squeezed my first Othello program into that computer, and learned a lot about performance and knowing every bit.

Modula-2: After some Pascal on Apple II, my time at ETH Zürich and UNC Chapel Hill was spent with Modula-2, first on the Lilith and then on the Mac. The original Smart Go Board for Macintosh was written in Modula-2. With the strong influence of Niklaus Wirth, I got drilled in the fundamentals of strong typing and modularity.

C++: When I started at Microsoft in 1991, most of the PowerPoint code was in C, with some Pascal in Mac-specific files (PowerPoint originally started as a Pascal program on the Mac). Over the next several releases, piece by piece, we successfully rewrote the whole program in C++, completely object-oriented. Both speed and memory usage were critical, and we learned how to use a subset of C++ to achieve high performance. (At one time, six of the twenty developers on PowerPoint had a connection to ETH Zürich — the Swiss influence was strong on that team. Still is.)

Once I left Microsoft in 1999 to work on SmartGo, C++ on Windows was the natural choice. C++ worked really well for Go, from fast low-level bitset operations to object-oriented UI code. But Vista pushed me over the edge and back to the Mac.

Objective-C: The Mac version of SmartGo got interrupted when Apple opened the iPhone for development. Keeping the base code in C++, I added the UI for SmartGo on iOS as I learned Objective-C. Seven years later, I’ve written a lot of Objective-C code, but it’s not my language of choice. The lack of type safety, the convenience of nil objects hiding potential errors, the need to avoid dynamic allocations and message passing in tight loops: these all worked against my nature. And having to interface with Go-specific code in C++ kept me from taking advantage of the full power of Objective-C.

Swift: With just a few months of Swift experience, it’s already clear that it gives me the building blocks for writing fast, high-quality software for the game of Go. It has strong typing and performance rivaling C++. It supports operator overloading (useful for bitset operations in Go) and generics (useful for arrays indexed by .Black and .White). Unicode string handling is a godsend for a game that originated in the Far East. Value semantics. Returning tuples. No crazy block syntax. Functional programming. And good riddance to semicolons.

I’m still in the early stages of learning Swift, and I’m already writing code better and faster than with the subset of C++ I had been using for 20 years. Did I mention it’s more fun too? So to me, it’s a clear choice.

Moving forward

I know where I’m going: my apps are transitioning to Swift. I know the first step: a separate Swift project to help me master the language and build up some base modules. After that? It will take me a while, but I will figure it out.

Transitioning a large code base is risky and never easy. I have no illusions that this will be simple. (Moving PowerPoint to C++ was good practice, but also a warning.) The fact that Swift doesn’t interoperate with C++ makes it harder. And it all has to be done while keeping the existing apps healthy and customers happy and dealing with any other curve balls Apple throws my way.

Yes, this will slow down development on my Go apps for the next years. It’s a risk I have to take: I’ve worked on these apps for fifteen years, and plan to work on them for many more. As an indie developer, I need to invest in my apps and in myself.

Quick Actions and Side Matching

SmartGo Kifu now supports split view on the newest iPads running iOS 9, so you can run it next to Safari, Notes, or even Go Books. And in addition to numerous UI refinements, there are two new features.

Quick Actions

On an iPhone 6S or 6S Plus, deep press on the app icon to see two Quick Actions:

Blog quick actions

  • Empty Board: Creates a new game in My Games. You can then quickly enter a position or analyze joseki, for example.
  • Random Game: Goes to a random game in the library of 84,000 pro games. Just one more click and you’re watching a pro game on auto-replay while waiting in line.

Side Matching

Joseki matching has been extended with the ability to match a whole side of the board.

Blog side matching

This lets you match popular openings like the low Chinese opening or the sanrensei. It also gives you more context to see how pros handle a joseki in relation to another corner.

As with joseki matching, tap on the matching stats to see a list of the games matching that position, then explore how those games typically develop from that position.

Side matching is also supported in the Mac version.