Today celebrates Mandela Day, honoring the late activist and eventual head of state Nelson Mandela.

Nelson Mandela in Johannesburg, Gauteng, on 13 May 2008

I can’t really top that, so I guess we just talk about programming.

Mystic T-Square

GitHub - jcolag/mystic-t-squareA possible game. Contribute to jcolag/mystic-t-square development by creating an account on GitHub.

If you’d like to skip the boring parts of this discussion of features, you can play Mystic T-Square to your heart’s content, instead. As a word of warning, though, it has features that still need testing and so haven’t yet gone public. Put another way, the code there comes from my development version, not the repository.

I added a “loading” modal panel until the page has made its required network request(s), grabbing the spinner from the CC0-licensed options from Loading.io; I couldn’t exactly ignore the three-by-three grid, after all, given the game. I tweaked the CSS to better match the page’s styling.

And for the second project in a row, AutoAnimate has failed to accomplish anything useful. It loads onto the page and attaches (or whatever the library calls the process) to the grid on page load, and then—much like my issues with Salavi—doesn’t seem to actually animate things. Clearly, I don’t understand the documentation’s explanation of how to make it work.

Most importantly, though, by now, you should have the ability to play the entire game. The remaining clue from a couple of weeks ago said this.

You might recognize the name mystic square, in relation to puzzles and games.

While it has other uses, I meant the term “mystic square” to refer to a variation of the 15 puzzle. This, technically, qualifies as an “8 puzzle,” where the Tic-Tac-Toe game plays out on sliding blocks. You might capture a corner, but your opponent can slide that corner square away.

For now, the question-answerer and the block-slider take turns, both manual tasks.

Tying back to the animation issue, one bit of information that some people might find interesting in the development, clicking a non-slidable block shakes it to acknowledge that you clicked, but won’t do anything about it. I used Animate.css for that, since it has a straightforward approach. The good news? It takes almost no code; I’d reuse the function, if I needed to animate more.

square.addEventListener('animationend', forgetAnimation);
square.classList.add('animate__animated', 'animate__headShake');

function forgetAnimation(event) {
  const target = event.target;
  target.removeEventListener('animationend', forgetAnimation);
  target.classList.remove('animate__animated', 'animate__headShake');
}

However, I don’t like that the library comes under the terms of the Hippocratic License. If you’d rather skip to the plans for this week—not much else happened last week—than reading my complaining about a license, click right through…

A Long Detour into License-Land

For those of you still with me…

The Hippocratic license, as I’ve mentioned, doesn’t make much sense to me, since people who don’t care about human rights also generally don’t care about your Intellectual Property rights. But also, digging deeper, some treaties required for compliance have (among other things) a deep capitalistic and (pardon the term) “normative” bias: Failing to charge for the game or not offer to pay for the library—or, rather, the labor that went into creating them—which seems inherent to the entire idea of sharing, may run afoul of the license, as I read it.

I don’t mean that as a joke or exaggeration. People wrote these underlying documents in the 1960s, with a maybe-subconscious eye towards reinforcing patriarchy—even while acknowledging that we should pay women equally—and capitalism. They mention multiple times that everyone must receive a fair wage for their labor.

Fair wages and equal remuneration for work of equal value without distinction of any kind, in particular women being guaranteed conditions of work not inferior to those enjoyed by men, with equal pay for equal work.

This example seems like it requires an economy based on money and labor. If you use Free Software without donating to each project, based on how much effort went into the project based on the hourly wage of a typical developer, then you haven’t upheld equal pay for work of equal value, which seems to openly violate Article 7 of the ICESCR.

However, it also demands protection from communal economic activity.

All peoples may, for their own ends, freely dispose of their natural wealth and resources without prejudice to any obligations arising out of international economic co-operation, based upon the principle of mutual benefit, and international law.

To me, this says that, if you support taxpayer-funded government services or international cooperation, and possibly if you work on and distribute software in a communal fashion, then you have a prejudice to cooperative obligations contrary to Article 11, and thus can’t follow the license.

It gets worse, though. We also have weird gems about the status of family…

The family is the natural and fundamental group unit of society and is entitled to protection by society and the State.

…and education.

The States Parties to the present Covenant undertake to have respect for the liberty of parents and, when applicable, legal guardians to ensure the religious and moral education of their children in conformity with their own convictions.

They clearly wrote these without acknowledgement of domestic abuse or, oh, I don’t know, maybe a massive right-wing backlash against the idea of schools teaching children about unhappy slaves or the existence of gay people. If you opposed the so-called Don’t Say Gay (and similar) bills/laws or the fight against critical race theory, then you would defy Article 18 of the ICCPR, and therefore violate the license, because those laws say that they want parents and legal guardians to choose the moral education of children.

Even most fundamentally, the “unobjectionable” Universal Declaration of Human Rights takes positions that I know for a fact that many of the license’s supporters oppose.

Everyone has the right to seek and to enjoy in other countries asylum from persecution.

This right may not be invoked in the case of prosecutions genuinely arising from non-political crimes or from acts contrary to the purposes and principles of the United Nations.

Great work on the first part, A+. However, all the refugees fleeing wars, climate destruction, gang violence, or even identity-based persecution, the UDHR says that they should not qualify for asylum. It doesn’t take a neutral view on them, notice, or even ignore them, but actively forbids others from seeking asylum. If you support asylum for anybody whose government has not detained them for opposing government policies, then you probably took a stand against Article 14. Someone who tries and fails to overthrow a democratically elected government, by these rules, has a stronger claim to asylum than someone trying to get away from environmental devastation arising from policies after a successful coup.

Based on the phrasing of the license and its “mandatory documents,” it seems entirely reasonable to ask if—for a quick example—my refusal to elevate parents to some sort of infallible priesthood excludes me from using anything released under the terms of the license. It seems even more reasonable to question whether a license that bases its existence in documents that have no interest in art or the public good has any business trying to intermediate between hobbyists sharing our projects. And I might also ask whether such a license can plausibly “do no harm.”

Licenses, after all, don’t work like job postings. You can’t look it over and decide that you have more than half the requirements, and that should satisfy people. The “restrictions” in a license represent the price that you pay for permission. If you can’t abide by all the restrictions, then you don’t have permission.

I should note that I could have missed something important. I can’t help notice that the text written on The Hippocratic License page, labeled as The Hippocratic License 3.0—the page where I got the list of international guidelines to review—doesn’t read like a license. Rather, it reads like a sales pitch for a license. However, everyone who uses the license links here, rather than to actual license text, and that page has no link to official license text, so I have to assume that this page describes the legal bond. But also, even if that assumption doesn’t hold true, I picked glaring examples in the United Nations documents for clarity, to show that these requirements come from the underlying principles that also produced the “good” requirements, meaning that an ethical actor should have concerns that even the most benign-sounding requirement might carry some unfortunate baggage with it.

I won’t even get into the “customizations” that only allow for certain political stances, political stances that specifically make the nightly news, and happen mostly “over there” for most Americans and Europeans. For example, I won’t, but a really mean person would point out that the license allows you to forbid software’s use by companies operating on land taken from Uyghurs and Palestinians, but not on land taken from Native Americans; those seem entirely equal in an ethical sense, except in whom they would exclude.

I apologize for the lengthy digression, but since I used the library, I didn’t want anybody to see that as an endorsement of the license, and I want interested readers to know what I got myself into and why. In any case, the Mystic T-Square code accesses the library through a CDN, so I at least won’t find myself distributing it. But I’d also view the library as a placeholder until something more interesting appears, and I will absolutely pull it out if the developers would prefer that I only use it if I fully agree with their stated principles, or would gladly welcome an audit of how well I conform to their standards and where/why I fall short. I’d even happily publish the results of the latter.

Regardless, always read licenses before accepting them. Heck, always read licenses before publishing them, because as I said, I know that the people involved would oppose a lot of what they require, if they actually knew what they demanded.

Next

This week, I’ll probably add some small niceties to Mystic T-Square, and also see if I can think of a simple algorithm to play the role of the second (tile-shifting) player.

I should also comment the code. What started as a couple of quick ideas now covers almost five hundred lines of JavaScript code, plus all the HTML and CSS.


Credits: The header image is Nelson Mandela by South Africa The Good News, made available under the terms of the Creative Commons Attribution 2.0 Generic license.