Simon says

When I first joined Google, I learned that a common interview question was “How would you code the game, Simon?” For those aren’t familiar with this 80s masterpiece of technological entertainment: Simon is a game in which you are shown a sequence of one of four colors. The game starts with a sequence of one color, and your job is to repeat the sequence. If you get the sequence right, the game adds a new color to the sequence. The game continues until you get the sequence wrong. I don’t know if reading this description makes the game seem fun, but it was fun.

At the time I joined Google, I had little experience writing code. The idea that I could have been asked that question terrified me. (I was not asked that question. The story of how I dodged the technical portion of my interview is a story for another time, however.) If I had been asked that question, I don’t know how I would have answered. So, you can imagine my delight when I came across a JavaScript code example that built a basic version of Simon. The code doesn’t go into a ton of detail about what it’s doing, so I thought it would be fun to try to document my interpretation here.

Note that I don’t have the experience to judge if this example is coded well. So I’ll just focus on what the code does, and leave discussions on better implementations to wiser heads than mine.

Before we get into the code, we should start by understanding how Simon actually works. I know that I explained the gameplay, but it’s helpful to think about what the game actually needs to do. I’m learning that how a user (in this case, the player) experiences an application doesn’t necessarily reflect what the application is doing. (I wonder how much of any application is smoke and mirrors, but again, that’s a topic for another time.) As I mentioned, in a Simon game you need to repeat a sequence of colors. The number of colors in each sequence increases by one each time you repeat a sequence correctly. (As long as the sequence is greater than 0, of course.) The next color in the sequence is randomly generated, but it’s limited to one of 4 colors.

With that in mind, we can start to build our application.

Accessing HTML elements

In this topic, I’m not going to dive deeply into HTML and CSS, as I’d rather focus on the JavaScript. You can look at the source code for the application if you’re interested in looking at those files further. But I have learned that, when I’m working with vanilla JavaScript–that is, JavaScript that isn’t used within a framework like React–it’s always good to get programmatic access to any of the elements I’m going to need. Here’s what that looks like for this application:

const scoreEl = document.getElementById("score");<br>const colorParts = document.querySelectorAll(".colors");<br>const containerEl = document.querySelector(".container");<br>const startBtn = document.querySelector("#start-btn");
const resultEl = document.querySelector("#score-result");
const wrapperEl = document.querySelector(".wrapper");

Each of these variables corresponds either to a specific element, like scoreEl, or a group of elements, like colorParts. I admit that I do wonder why some of these variables use document.querySelector to get an element by its class name, while others use document.getElementById to get an element by its id value. I would think that the latter method is better, but I’m still learning.

Setting up game colors

Now that we have variables representing the HTML elements in the game, the next task we can complete is to create some sort of collection that specifies which colors are available in the game. This code uses an object for this purpose:

const colorObj = {
    color1: { current: "#006400", new: "#00ff00" },
    color2: { current: "#800000", new: "#ff0000" },
    color3: { current: "#0000b8", new: "#0000ff" },
    color4: { current: "#808000", new: "#ffff00" },
};

This object has four properties, one for each color. Each property has another object as a value, and that object has two additional properties: a string representing the current color, and a string representing a new color. Later on, the code uses these properties to visual indicate to the player the colors in the sequence, or to indicate that the player clicked on a color.

Controlling gameflow with a flag

But we get into more of the game logic, I want to call out one thing that is the code that I hadn’t thought of when I was thinking through this code on my own: it creates a flag. Remember that, in a Simon game, the game displays a sequence of colors. The player then clicks on colors in an attemp to match the sequence. But it would get very messy if the player started clicking on colors while the game logic was creating or displaying a new sequence. To avoid that scenario, the application uses a flag–basically, a variable that it uses to control the flow of the game:

let isPathGenerating = false;

This flag will be useful in a little bit.

Creating a delay function

In addition to this flag, we need a way to control the speed at which the game displays the colors. Otherwise, the game will cycle through the sequence so fast that no human could hope to keep up. In this code, this control is implemented with a delay function.

const delay = async (time) => {
 return await new Promise((resolve) => setTimeout(resolve, time));
}; 

Basically, this function takes a parameter, time, and uses that value to delay the game by that amount of time. Now we have a way of controlling how long of a delay we want at different points in the application.

Keeping score and tracking clicks

One last thing before we get too far ahead of ourselves: the application also includes two additional variables: score, which is used to track the player’s score, and clickCount which is used to track how many times the player has clicked one of the colors.

let score = 0;
let clickCount = 0;

Nothing too fancy here, but I’m talking about them now because, like the isPathGenerating flag, they become important later.

Getting a random color

Okay! With the code framework in place, we can talk about how code stores the color sequence generated during a game. To start, the code creates an empty array:

let randomColors = [];

Notice that the code uses JavaScript’s let keyword, so we can change the contents of this array as the game progresses.

Moving on, the application adds a function to select a random color from the colorObj defined earlier.

const getRandomColor = (colorsObj) => {
 const colorKeys = Object.keys(colorsObj);
 return colorKeys[Math.floor(Math.random() * colorKeys.length)];
};

When the application calls this function, it passes in the colorObj object. The function then gets an array of keys from that object–in this case, the name of the object: color1, color2, and so on. Then the function uses two Math functions to randomly select a color object. With this code in place, the application now has a way to get a random color.

That’s great.

Generating a color sequence

Now that we have the ability to generate a random color, we can create a function that generates a color sequence. In this code, that capability is a function, generateRandomPath:

const generateRandomPath = async() => {
 randomColors.push(getRandomColor(colorObj));
 score = randomColors.length;
 isPathGenerating = true;
 await showPath(randomColors);
};

This function is an asynchronous function that performs a few tasks:

  1. It calls getRandomColor and adds that new color to our randomColors array.
  2. It updates the game score, which will always e the same value as the length of the randomColors array.
  3. It sets the isPathGenerating flag to true. That will be important later.
  4. It uses the await keyword to wait until the showPath function finsihes. We’ll define that function next.

Displaying the color sequence to the player

The function, generateRandomPath, asynchronously waits for a new function, showPath to complete. That function is responsible for showing the latest color sequence to the player.

const showPath = async(colors) => {
 scoreEl.innerText = score;<br> for (let color of colors) {
  const currentColor = document.querySelector(`.${color}`);
    await delay(500);
  currentColor.style.backgroundColor = colorObj[color].new;
  await delay(600);
  currentColor.style.backgroundColor = colorObj[color].current;
  await delay(600);
 }
 isPathGenerating = false;
}

Again, we have another async function. This time, the function takes an array of colors (our randomColors array, in fact). Then, the code loops through the array. For each color in the array, the code:

  1. Creates a variable, currentColor, and sets it to the appropriate HTML element.
  2. Waits 500 milliseconds.
  3. Sets the background color for the element to the colors new property. This change provides a visual cue to the player of what the next color in the sequence is.
  4. Waits again.
  5. Sets the color of the element back.
  6. Waits just a little more.

After the loop completes, the function sets the isPathGenerating flag to false.

With the generateRandomPath and showPath functions complete, we can turn our focus to handling the user inputs. Oh, and we’ll finally put that isPathGenerating flag to work.

Creating an event handler

We want each of the 4 colors in the game to handle click events the same way, so we should create a function. This time, let’s walk through the function bit by bit.

To start, we create (you guessed it) an async function, which we’ll call handleColorClick.

const handleColorClick = async (e) => {

We don’t want to handle clicks if the game is generating a new color sequence. So we’ll use our isPathGenerating flag:

if (isPathGenerating) {
  return false;
}

Now, if the application is generating a sequence, the game will ignore clicks (on those colors, of course).

It’s this next bt of code that I find fascinating–even if it’s pretty straightforward once you see it. It’s a conditional statement:

If (e.target.classList.contains(randomColors[clickCount])) {
   // ...more to come...
} else {
  endGame();
}

To understand this code, it helped me to think about what information was available. First, I know what the correct color is in the sequence. I know it, because I can use the clickCount value as an index in the randomColors array to find it. If clickCount is 5, then randomColors[clickCount] will return the fifth color in the sequence. Second, we know the color of the HTML element that the user clicked. That information is available through e.target.classList. These two pieces of information taken together, tell us if the user clicked on the right color. Each time the user clicks a color, the code uses the clickCount value to find what the correct color is, then sees if the HTML element that the user clicked has a class that matches that color. If there is a match, the user clicked the right color, and the game continues. If not, then the user clicked the wrong color, and the endGame() function executes.

I find this code interesting because, to be honest, I don’t know if I would have thought of it. I think it’s kind of a cool way of consistently tracking if the user is following the sequence correctly. Ask me in a few years if I think there’s a better way to do this. (Plot twist: There are a few other ways to do this for sure, but I couldn’t tell you if any of them are better.)

If the user makes the right selection, the code does a few other things:

  1. It changes the color of the element to it’s new value, waits, then changes it back. Just like when the game displays the current color sequence, this code gives a visual cue to the user that they clicked a specific color.
  2. It increments the clickCount value.
  3. It checks to see if the current clickCount value equals the current score. If it does, we know the user has completed the current sequence. The game then sets clickCount back to 0 and calls generateRandomPath(), continuing the game.

Here’s the entire handleColorClick function in its entirety.

const handleColorClick = async (e) => {
    if (isPathGenerating) {
        return false;
    }
    if (e.target.classList.contains(randomColors[clickCount])) {
        e.target.style.backgroundColor = colorObj[randomColors[clickCount]].new;
        await delay(500);
        e.target.style.backgroundColor = colorObj[randomColors[clickCount]].current;
        clickCount++;
        if (clickCount == score) {
            clickCount = 0;
            generateRandomPath();
        }
    } else {
        endGame();
    }
};

Adding the event handler

Of course, a function to handle events isn’t very useful unless you actually add it to the corresponding event listener. In this code, that’s handled like this:

colorParts.forEach((color) => color.addEventListener("click", handleColorClick));

This line uses the colorParts variable we created earlier. That variable is an array of HTML elements that represent the colors of our game. It then loops through each of these elements and adds the handleClickColor function to the element’s click event listener.

Final touches

There just a few more details to make the game functional. First, we need an endGame() function, to handle how each game ends.

const endGame = () => {
    resultEl.innerHTML = `<span> Your Score : </span> ${score}`;
    resultEl.classList.remove("hide");
    containerEl.classList.remove("hide");
    wrapperEl.classList.add("hide");
    startBtn.innerText = "Play Again";
    startBtn.classList.remove("hide");
};

Remember that the code calls this function if the user clicks the wrong color.

Next is a resetGame() function, which sets all of the application’s variables back to their original states.

const resetGame = () => {
    score = 0;
    clickCount = 0;
    randomColors = [];
    isPathGenerating = false;
    wrapperEl.classList.remove("hide");
    containerEl.classList.add("hide");
    generateRandomPath();
};

The game calls this function when the user clicks the Start button.

startBtn.addEventListener("click", resetGame);

With that, we have a working Simon game!

Dave’s thoughts

A few final thoughts I have about this code example:

  • I’m not sure why the code uses querySelector in some cases and getElementById in others. You’d think that getElementId would be better/easier. I understand why it uses querySelectorAll, though.
  • In the real Simon game, the sequence gets faster and faster as the sequence gets longer and longer. I bet this is way to guarantee that the user will fail before any mechanical limitations are met. That would be a nice addition to this code, and I might add that someday.
  • Another nice addition would be to play a sound with each color–that’s another aspect of the original Simon game that’s absent here.
  • I’d be really curious what more experienced developers think of this code. I wonder what improvements could be made to make the code more readable and maintainable.
  • This experience was really, really fun.

Finally, I’d like to call out ASMR programmer for the code. Check out their GitHub repository for this and other code examples. You’re welcome to check out my GitHub repository as well.

Until next time.

Tenkan

There is a particular warm up exercise that most aikido practitioners do before starting their training. This particular movement, however, also seems to encapsulate nearly everything there is to know about the art. And the principles that underpin this movement can, if you’re willing, have significant reverberations in other aspects of your life as well.

The movement is called “tenkan.” Literally translated into English, the word means “to convert or divert.” The physical movement is straightforward–at least in principle. You stand, one foot in front of the other, with the hand of your forward foot extended. (There are significant variations as to exactly how your feet should be placed, and exactly how your hand should be extended. But these variations mean little to you if you aren’t actively practicing the art.) In a fluid, controlled motion, you pivot from this initial position 180 degrees, then take a step backwards. You then reverse the movement, taking a step forwards (and switching to extend your other hand), pivoting in the opposite direction. To the uninitiated, the movement looks a little silly, almost dance-like.

Beneath the surface of this movement, however, is a torrent of activity and thought. Tenkan, as the name implies, is intended to do two things simultaneously: (1) divert an opponent’s movement around you, and (2) convert that movement into something that is no longer a threat. To successfully do a tenkan turn requires complete engagement throughout your body. Fail to extend your arm and it will collapse when your opponent enters your space. Fail to ground your legs and feet and you will only divert yourself–flailing around your opponent in an uncontrolled fashion. The movement becomes even more complicated when your working with a training partner. Now, you have the momentum and power of someone else to consider. This is where the “convert” part of the movement comes into play. What will you do with this energy? Can you simply dissipate it, and do so in such a way that you reduce your opponent’s ability to harm you to zero? Can you use it, powering your own movement to send your opponent flying away from you? And these choices are but two extremes–there are many other options that could be available to you, depending on your skill and your intention.

Over my 20+ years studying aikido, I have come to see many exercises and techniques, like tenkan, less as mere movements and more crucial decisions. This is because you should not let your opponent dictate your actions. Rather, your opponent is simply one set of data points that you should use to make a decision as to whether converting and diverting them is necessary. (Other options include, but are not limited to, your environment, your individual health at this moment, or your ultimate objectives.) When viewed as a choice, as opposed to a movement, an exercise, or–worst of all–a reaction, tenkan becomes an incredibly powerful statement to shape and accomplish your objectives.

It is at this intersection between physical action and mental commitment that the ideas of tenkan transforms beyond a simple martial art technique into something far more useful. For example, consider a typical day at work. Whether you are an individual contributor or a manager, nearly every day you will find yourself faced with the unexpected. Perhaps a team, in their enthusiasm to make their launch date, neglected to tell you of a crucial deadline, and now everyone is panicked that you’ll cause their release date to slip. Maybe a customer changed their acceptance requirements for a new feature. And maybe your CI/CD pipeline has just decided to fail without warning or explanation.

During these admittedly stressful situations, tenkan becomes incredibly useful. But before we get into how it is useful, there is an important point to remember. In all of these situations–and in the numerous other situations too long to list here–none of these events involve an actual opponent or enemy. That product team? They had the best of intentions. That customer? They have pressures of their own to deal with. And a CI/CD pipeline has all sorts of dependencies –sometimes, something just breaks. Part of understanding tenkan–any aikido movement, really–involves the eventual discovery that looking at a situation merely in the context of conflict is inaccurate at best. Only by being fully present in the moment, objectively observing what is happening, can you make the right decision for you or your team.

With that in mind, tenkan becomes very useful indeed. You can identify how to convert the situation into something beneficial to all involved. You can partner with the product team. You can use your customer’s changing demands as an opportunity to deepen your relationship with them. And you can use the downtime of your CI/CD pipeline to make your workflwos even more resilient in the future. And you can do these things without unnecessary confrontation or animosity.

True, tenkan is not easy. It takes practice focus, and many instances of failure before you find the implementation that works for you. More importantly, you also need to learn when you think tenkan is appropriate, and when a different tool or idea makes more sense. But, discovering how to employ tenkan in your every day life can help you increase productivity, decrease stress, and reduce the negative effects of confrontation.

Leaving Social Media

I think it’s time I depart from social media for a time.

My first steps into “social media” was with Facebook. When I first joined the platform, so many years ago, it seemed like a novel way to keep in touch with a whole bunch of people that I didn’t, or couldn’t see. Old high school and college friends. People I used to work with. Family members. The platform seemed so interesting–does anyone remember when status updates took the form of partial sentences, like:

Dave Shevitz is writing a Facebook post. How meta.

Then, of course, came other platforms: Instagram. Twitter. Tumblr.

But I don’t like what I see on Facebook any more.

An initial assumption might be that this is a direct result of the last election, and the discoveries that–shock and horror–these platforms may have been manipulated for political means. Another assumption might be slightly less Illuminati in nature: that I have grown tired of being in a self-inflicted bubble, in which the only comments and posts I see are ones that I already agree with.

Both are valid assumptions, but neither capture what’s going on in my mind right now.

To explain, we have to go back a number of years. I was just starting out in my career and my marriage, and I discovered a remarkable game: EverQuest. It was expansive. It was online. It was always there. And I quickly became addicted to it. I would spend hours playing–because you had to. It took you at least an hour to find a good group! Another hour to find a good spot to fight digital monsters! And then you had maybe a couple of hours of where the group was working together to actually play the game. Although it was a game, EverQuest was also a social media platform itself–an opportunity for me to talk and engage with a whole community of people.

I was unaware of what was going on. My wife was not. And it became clear that I had let this game consume way too much of my attention. It had to stop. So I stopped playing.

I wish I could say “I stopped playing entirely.” But I can’t. I reduced my playing time. I even quit EverQuest. But, over the years, there were many, many other games. I justified playing them because, well, my wife got into watching her own shows. Shows that I didn’t particularly care for. So an equilibrium was struck: she watched her shows, I played my games. Eventually, I found other interests, such as guitar, shows that I liked myself (hello, Star Trek Discovery!) and, well, there’s always a work. (Which is fine. I like what I do!) So my evenings now are mostly spent playing guitar and working, and my wife still watches shows that creep me out, like Criminal Minds. (Seriously, what is WITH that show?)

What do these last few paragraphs have to do with anything? I guess I’m pointing out that I have gone through having one platform dominate my life, and that experience helps me (sometimes) see when another platform is doing the same.

Let’s return to traditional social media for a moment. (Wait–not just yet. Let’s just marvel at the fact that we can use the phrase “traditional social media.” Because social media has been around THAT long?) My major experience with social media is Facebook. And, as I mentioned, at first it was a novel way of keeping in touch with people. And it still is.

But I’m also discovering that Facebook has become the ONLY way I communicate with some people, or with how some people communicate with me. My own family is not exempt. I find that I check Facebook primarily because I’m curious what’s going on with my family. My immediate family. This stresses me out. First, I want to have direct communication with my family. I want to talk with them, listen to them. I don’t want these events to occur only on Facebook.

I’m also becoming disenchanted with what I call the Scrapbook Lie. (There is probably a better name for this, but I like this one.) When you look through a scrapbook, most of the pictures you see are of people smiling, happy, enjoying themselves. We all know that’s not really how life is. It pains me to see a photo “Look how much fun we are having!” when I know, firsthand, that a few moments ago everyone was in tears. I understand that filters are important. But I don’t understand the line between filters and outright censorship/propaganda, and that bothers me.

I really should say that I don’t consider social media to be a bad thing. It is a tool, a technology, and whatever is good or bad about it is what we bring to it. I’ve stayed on Facebook, for example, because I enjoy the interesting perspectives many of my friends share, and I am glad to provide a word of support when someone mentions that they are suffering. But I can no longer tell if social media, as a whole, is a net-positive influence on my life. And it seems the only way to find out for sure is to step away for a while.

For those of you with whom I communicate with regularly, you know there are plenty of other ways to reach me. For those who would like to communicate with me more regularly but don’t know how, message me here and I’ll happily share some of my contact info. And for those who couldn’t care one way or the other: I commend you for reading this far.

The Last Jedi and Communication

So on my Facebook feed a friend of mine was positing that the latest Star Wars movie, The Last Jedi, could easily be a treatise/commentary on the failure of how men tend to think and act versus how women tend to think and act.

(Yes, I said tend to. I don’t mean to generalize. I am also being lazy and sticking with typical male/female pronouns. I’m not trying to disrespect anyone here.)

The basic idea is this: during the movie, male characters like Poe and Skywalker seem to act impulsively, and with their own self-interests in mind. Poe wants to blow things up. Skywalker wants to crawl into a hole and die. Neither, at the beginning, see that sometimes, you have to think beyond yourself.

It’s a great argument, and a great point of view. One of the reasons I like the latest Star Wars movies is because they have such strong female characters. Check that. They have strong characters, some of whom appear to identify as female. My opinion on this matters not one little bit, but I still think it is fantastic.

But I’m not writing to lend weight for or against this particular viewing of the movie. Rather, I wanted to capture another thought, which came while I was discussing the first one.

The Last Jedi could really be an interesting comparison of rigid, top-down, proprietary organization structures versus fluid, open-source communities. Consider the First Order. It is led by the Supreme Leader. He holds the vision, and he alone sees the big picture. The people he attracts are those who do not want to think for themselves, who want to be told what to do. (Kylo Ren is a possible exception here.)

These traits are similar to the classic top-down communication structure found in older technology companies. One person has the vision. Everyone else is supposed to execute on that vision. The vision is not to be questioned.

Now look at the Resistance. It is organic. (Maybe it gets that from it’s nominal leader, Leia. Organa = organic? Ha! I amuse myself so.) Low-level captains can argue with Vice Admirals. Individual rebels can take on a mission without asking anyone else’s help. It is chaotic, crazy, and often at the brink of failure. Yet it is also has the potential to be inspirational, awe-inspiring and world (okay, galaxy) changing. Just like more modern technology companies, where the individuals make the call, not someone sitting in an ivory tower or massive Star Destroyer.

Dunno. I should probably spend more time thinking on this. Or maybe I’ve spent enough.

A New Year; A New Beginning

Long ago, I had a blog.

Originally, I wrote in a vain attempt to keep myself from talking too much while I taught at Aikido Kokikai South Everett. That, however, proved unsuccessful. It seems that, when I teach, I cannot help but talk. A lot.

Anyway. In addition to the blog failing its original purpose, it also became, in my mind, repetitive. Too often I would have an idea, write about it, and then realize that I had already written about that very topic some months or years earlier. That didn’t bother me, necessarily; I think it’s normal and good to rehash old ideas and see if any new insights emerge. But when I started to find the previous writings to be better than what I had to say in the present–that’s when I knew things had to stop. Or change. Or something.

(In hindsight, perhaps the blogs slide into obscurity was an omen of things to come, a marker that my time teaching aikido was coming to its conclusion. But that’s a different post, I suppose.)

So I stopped writing. Well, I stopped writing here. I write for a living, so I never really stopped writing, per se. And life, like water across stone*, filled in the cracks in my schedule, so I didn’t notice that I wasn’t writing.

But over the past several months–perhaps longer–I have felt the urge to write for me again. To put some structure to my thoughts and, perhaps, share what I have written with others. With the new year upon us, it seemed a good time to write again. I toyed with creating a new blog, on a new platform. But in the end, I already have a blog here; to create something completely from scratch seemed an exercise in making things more difficult for myself.

And so here I am. I no longer teach aikido, so I can no longer say this blog is about its practice. But I can say that, after 20+ years teaching, I am unable to extract aikido from my thought processes. So the title of this blog, Aikithoughts, is still appropriate. It’s just that now I plan on thinking about more things. Maybe aikido. Probably about a lot of other ideas.

I didn’t want to write this post, in a way. I think I’ve written a couple of “I’m reviving this blog!” posts before. But, like a diet, or a workout routine, you have to hold yourself accountable. So writing down that I’m starting this process again is my way of making a proclamation: I’m going to write.

Let’s go.

* I do enjoy a good turn of phrase**. I don’t know if this is one of them, but I do enjoy them.

** I also enjoy footnotes.

Applied Principles: Playground Swings and Hot Summer Days

Yesterday, the family and I went to a BBQ sponsored by my daughter’s swim team. It was one part “end-of-the-season” celebration, and one part farewell party for one of Hannah’s coaches. My daughter, H, spent most of her time playing at the lake with her teammates and friends. My wife spent her time taking pictures and (hopefully) relaxing with some of the other parents. My youngest was your typical four-year-old–bouncing from one event to the other.

And my middle child, M? He wanted to swing.

At first, I resisted this. It was 80-90 degrees out. The swingset was smack in the middle of the playground. No shade anywhere nearby. Standing out in the sun was hot and tiring and boring. On our first two trips out there, I lasted for about 10 minutes before I told M we had to do something else. He went sadly–throwing a little fit here and there. I transferred my fatigue and frustration to him without even realizing it.

It was inevitable before he’d ask me to take him swinging again. At last, I gave in and told him I would push him on the swings one more time. He joyfully ran to find a swing. As I watched him go, I realized that this was all he wanted–was to have his dad push him on the swings. I resolved at that moment to do so as long as possible. So I pushed him on the swings. And I stayed there. I only left twice–to check on my youngest. Each time I would give M a huge push, run like crazy to find my youngest (who was usually with my wife or on another part of the playground) and then ran back just as M’s momentum was starting to ebb. I’d then give M another huge push, and his smiles and laughter returned.

It was hot. Really hot, for me. But this time, it wasn’t boring, because I focused solely on M and making him happy. We stayed there on the swings for at least 45 minutes–perhaps longer. At one point, I pushed M and said: “Are you having fun?” A tired, contented voice responded: “Yes. This makes me happy.” Finally, when I knew it was nearly time for us to go home, I asked him if we could stop and I’d carry him. He was nearly asleep on the swing, and gratefully climbed into my arms.

In Kokikai Aikido, we talk a lot about keeping one point. Often, we talk about it as the center of your balance. But I think it applies more broadly than that. Keeping one point means your focus on what truly matters at that instant in time. To throw away what you think you want or need and just take in the world as it is before you. Yesterday, one point meant pushing M on the swings for as long as he wanted. After all, how many days do I get where he’ll ask me to do that? And making him happy filled me with such contentment, such peace. I am so very glad that I somehow had the presence of mind to throw away my own wants and instead focus on someone else. With luck, this type of awareness–this keeping of one point–will become more frequent.

 

Applied Principles: Being a good husband

Kokikai Basic Principles:

  1. Keep One Point
  2. Relax (progressively)
  3. Correct Posture
  4. Positive Mind

At our dojo, we look at these principles every time we step on and off the mat. When I teach, I tend to call attention to them–sometimes to a specific one, sometimes to all of them. Of these principles, perhaps the one that most often comes up in class is the second one: Relax (progressively). The idea is simple in concept, if difficult in execution: the more relaxed we are, the better we can assess a situation. We can move more correctly and more efficiently. We can prevent an opponent from applying their power because it is very difficult to use force against something that is relaxed and forgiving.

(Don’t believe me? Go lift a box spring. Pretty easy right? It’s got a solid structure. Now lift the mattress. Harder, right? It’s still got structure, but less so. Now lift a futon. You don’t have to–if you’re like me, you’re already rolling your eyes. Lifting a futon is a pain, because it has very little form to it. It flops and folds. I hate moving futons.)

(Still don’t believe me? Go lift a toddler (yours, please, or with the permission of the toddler’s parent).  Now think about when you had to lift that same toddler when they did NOT want to go somewhere. They’re kind of like a futon, right?)

After nearly 20 years of studying aikido, I understand how important being relaxed is. It’s just the better way to go. And, on the mat, I tend to be pretty good at it.

It’s harder when I’m not on the mat. For example, when I’m trying to be a good husband to my wife.

See, my wife is pretty stressed. We have three kids, one of whom is on the Autism spectrum. Our oldest child has swim practice and camps and just general pre-teen angst that goes on ALL THE TIME. Our five-year-old can be sweet one minute and hitting his brother the next. Our youngest is prone to whining and antagonizing his older brother until said brother hits him (as I just mentioned). We have two dogs. They shed. EVERYWHERE. I have literally vacuumed the floor only to find that it has made almost no difference whatsoever. We have a garden. We have a house to maintain. Oh, and my wife has her own schedule and challenges. She has injuries from the past that continue to bother her, and injuries from the present that she’s trying to avoid. I just read a blog post about how many mothers are tightly wound, and I found myself thinking: that’s my wife. And you know what? I can’t blame her for being this way. In fact, I’m constantly surprised she hasn’t completely lost it.

So I come home, and I use my highly-trained aikido senses (or I just open the door to the house) to discover that my wife is very stressed out. When I sense this kind of stress, my training from the mat takes over, and I think of how I can relax my way through this, so that not only I remain calm but hopefully my wife can remain calm as well.

Good intentions. Bad idea.

Guys, our wives don’t want us to help them calm down. She IS calm. Our wives need us to do one of two things:

  1. Get stuff done. The dishes. The laundry. Getting the kids out of the way for 10 minutes. Whatever.
  2. Get out of the way. Don’t ask questions. Don’t chitchat. If you don’t have something to do, grab the kids and go somewhere else. Anywhere else. Morocco, perhaps.

In Kokikai, being relaxed is usually synonymous with being calm. But that’s not the only interpretation. An equally valid interpretation is being efficient. I am understanding, more and more, that being a good husband does not mean helping my wife remain calm under fire. My job is to be efficient. To get stuff done quickly and correctly and then get out of the way. It is just like being on the mat: our job is not to have our opponent calm down. It is to move quickly and correctly in such a way that our opponent’s desire to fight is reduced to zero. My wife is most certainly NOT my opponent, but the idea is the same. I cannot, and should not, try to “calm things down.” Instead, I should move quickly, correctly–getting the stuff done that I know needs to get done.

Some folks might resist this idea. “I have worked hard all day! I need a break.” To these people, I say: No. Actually you don’t need a break. Not  only that, you don’t actually want a break. Has any husband ever “taken a break” when their wife is still dealing with all sort of chaos in the house and had it work out in his favor? No.  What you want is a bit of calmness, a bit of peace. You can get some of that by finding it within yourself. You get the rest of it by getting everything done that needs doing around the house–be it parenting, making dinner, whatever. To put it in another way: I don’t get to “take a break” when someone is throwing a punch at me. I get calmness when I’ve moved correctly and deflected the punch into something else.

In short: move first and get things done calmly. Then, and only then, is there a chance for that calmness to move through the rest of the house. That’s what my wife is working towards. Time I try harder more correctly to help.

Running, Aikido, and a Thousand Thoughts

A couple of years ago, I decided to take up distance running in addition to all the other things I do with my time (work, aikido, parenting, and so on). Initially, I started running for the simplest reason: my wife was running. More specifically, she had torn her meniscus, and I cold not understand why she was still trying to run if it caused her pain. So I strapped on a pair of running shoes and headed out, in an effort to experience what she was experiencing, and perhaps understand her mindset better. (And, one major stress fracture later, I do understand–almost too well. But that’s a story for another post…)

I ended up continuing to run because I find running long distances to be very complimentary to aikido. For example, running requires a combination of relaxation without compromising form–a state of being we often seek in our aikido practice. In addition, running long distances has allowed me to better appreciate ki breathing. I am fortunate to live in a part of the country where I can run in very open, natural environments, so I can breathe deeply and fully, knowing the air is relatively clean and pure. There is a great deal I could potentially write about regarding running and aikido–and I hope to do so. But, in this post, I want to focus on something specific: headphones. Or rather, the lack of headphones.

You see, often when I run it is either early in the morning or heading into evening. Rather than head to the gym and log hours on the treadmill (which I am actually fine with), I often will head outside and run the streets of my neighborhood. It didn’t take me long to realize that, if I was going to do this, I had to forego my headphones. There are three primary reasons for this:

  1. By running without headphones, I can pay better attention to my body. I can build a better awareness of how hard I’m working, or how a given pace feels.
  2. Without headphones, I am more aware of my surroundings. I appreciate the setting sun, or the view of the mountains.
  3. Especially at night, people like to drive up behind me as I run and honk, scaring the crap out of me.

That last one–#3–is the reason for this post. There is nothing like having someone drive up behind you when you’re running–on the sidewalk, well away from the street–and honking at you. I don’t know why they do it, but it makes me jump every time. Interestingly, though, I can feel the impact of aikido training at these moments. It’s impossible not to react to the sudden noise, but I know that, thanks to aikido, I revert to calmness much faster. The last few times someone has honked as I ran, I reacted, then immediately fell back into one point and kept running.

I then started to wonder–is it possible not to react at all? In an effort to get to this point, I tried anticipating that any car that was coming up behind me might honk their horn in an effort to startle me. As you can imagine, this was a ridiculous notion–especially when as I am often running on well-traveled streets. I have given up on anticipation, and now am trying to do something different (or at least, different for me). Now, I recognize that any car could honk, but that this is one of a thousand possibilities that could occur. I don’t dismiss any of these possibilities. Rather, I try to let them flow through my mind, like a river.

This might seem counter-productive. After all, in aikido we often value stillness. Yet, a thousand drops of water flow within a river, and a river is not chaotic. It is the river, and each drop of water within it, while potentially distinct, in the end is part of a greater whole.

I know little of meditation. But I have been wondering if, too often, I try to limit my thoughts in order to achieve a sense of calmness. Perhaps, instead, I should treat my every day thoughts much as I do when I run–let the flow through me like a river, and find my calmness in the current.

Accepting Reality

As the chief instructor of Aikido Kokikai South Everett, I am often asked questions regarding how “effective” our style of aikido (and, for that matter, aikido in general) can be. Usually, these questions are thinly-veiled attempts to ask the more direct question: “How good is aikido in a fight?” However, the real answers to this question move beyond self-defense into something far more practical and meaningful.

Of course, after 15 years of being an instructor, I’ve become adept at having fun with this question. “Is aikido good in a fight? What kind of fight? In a gun fight, it’s not so great. In a knife fight? Still not ideal. Why? Are you getting into knife fights? Oh…you mean fist fights? Depends! Are you fighting in a ring? Or on the street? Against one person? Thirty? Why are you fighting so many people? What do you DO all day?” Most students or potential students see that I’m trying to be humorous, and realize that their question is somewhat ridiculous.

After my initial attempt at humor is over (there are usually more attempts later), I then get to the answer that means the most to me: Kokikai Aikido is effective. Not only from a physical standpoint, but from a mental perspective, a philosophical one. One way I choose to look at it is this: With Kokikai Aikido, you learn how to accept reality.

Here’s a mundane example. You are driving home, but you are stuck in traffic. How easy it is to get angry at the traffic, to rail against the fact that you’re not getting home fast enough. I know I’ve felt this way more times than I can count. When I apply what I learn in Kokikai Aikido, I find that I’m much more accepting of my situation. Instead of crying out: “Why is there traffic?” I think: “There is traffic.” No amount of anger will dissipate the traffic that’s between me and my house. I can, however, choose to accept the fact that the traffic is here, and decide what to do about it. Perhaps that means taking a side street. Perhaps it means pulling off at an exit and getting something to eat. Perhaps it means just waiting it out. But whatever action I choose to take is taken more calmly and with more understanding. I may not get home much faster, but I definitely feel better.

Let me give a greater, and more personal example. My wonderful son, who is five, was diagnosed a couple of years ago as having ASD: Autism Spectrum Disorder. Go online, and you can find all sorts of parents of children with autism who blame a variety of causes for their child’s situation. Some blame pollution. Some blame a medical treatment that was or was not given at the right time. And, yes, still others blame vaccinations. I read these blog posts and articles, and rarely do I find someone intelligently and calmly addressing an issue in a meaningful way. Instead, I see people who are scared, angry, and frightened. They are unwilling to accept their reality, and so choose to fight against it. Since there is no way to fight against reality, they are forced to revert to expressing their fears in the hopes that they can find or convince others to be afraid too.

In my case, I have been fortunate. The principles I’ve studied in Kokikai Aikido have helped me accept my son’s diagnosis. This does not mean that I have given up on him–far, FAR from it. His mother and I, along with his older sister and younger brother, work with a team of educators and therapists to help him be happy and reach his best potential. (For those curious, he’s doing very well, and is scheduled to go to a public school kindergarten program!) What I do NOT do is spend my hours and days trying to find something or someone to blame. Even if I found someone to blame, it would not change my son’s situation–so why bother? Instead, I choose to accept reality, and work within it to provide him the love, education, and happiness he so richly deserves. True, there are hard days and frustrating days, but these are rare. More often than not, there are simply days: filled with good times and challenging times, just like any other parent and child might experience.

When people ask me if Kokikai Aikido is effective, of course I can answer honestly that it will help keep them physically safe. But I am also quick to tell them that it does much, much more. It teaches you to see the world around you more clearly today than yesterday, and more clearly tomorrow than today. When you see the world around you clearly, without fear, you can act calmly, instead of reacting rashly. You can accept reality and, as a result, navigate your way through life in ways more effective than you ever thought possible.

Mountains and Rivers

Koichi Tohei, one of the pivotal figures in aikido, is quoted as saying:

“The mountain does not laugh at the river because it is lowly, nor does the river speak ill of the mountain because it can not move.”

I often keep this quote in mind when people start comparing martial arts. And people do enjoy comparing martial arts against each other! I’ve lost count of the number of Facebook discussions, email threads, and (sometimes heated) in-person conversations I’ve come across in which the pros and cons of two martial arts are compared.

In truth, comparing martial arts in order to determine which one is “better” makes no sense. To carry Tohei sensei’s statement further: when you go hiking, do you comment on how the mountain is more beautiful to look at than the river? Of course not. If you must compare martial arts, compare them based on their basic assumptions of conflict, and how their strategies and tactics address those assumptions. In aikido, for example, it’s often assumed that there are multiple potential attackers (even if you’re only dealing with one that you know of). We also tend to assume that the conflict is occurring in a relatively civilized location–a bar, a street corner, and so on. This is a different set of assumptions than, say, Krav Maga. Does this mean one art is better than the other? No. They are simply different. And, with luck, we can learn more about ourselves by appreciating these differences.

Tohei’s statement resonates with me on another level, however. Just as it’s incorrect to compare two martial arts, I often think it’s incorrect to compare two people in the same martial art. This idea became very apparent to me when I was the dojo the other day. As I taught class and worked with students, I realized that each person moved in different ways. Some people in the dojo are very large and very strong. Others are small and light. When we train, we should recognize and respect the power of our opponent. We can’t make someone strong and heavy instantly become light, nor can we do the reverse. Even more important, we should respect the power of ourselves. For example, sometimes, when I have trouble taking someone’s balance, I try to match their power. This can work if the person is similar to me in terms of size and movement. But it rarely works when someone is bigger, stronger, faster, or whatever. What works better is to recognize my opponent’s power, and still respect my own.

After all, the river does not try to become the mountain, and the mountain does not try to be the river. They simply meet in harmony.