Show more

My card game Siva Afi: The Fireknife Dance of Samoa has cards for the River of Fire technique, where you spin the knife fast enough to fling a line of fuel onto the ground.

The realtor who left everybody a business card and a box of sparklers is going to wake up in a cold sweat in the middle of the night when she remembers that all fireworks are illegal in the city.

(Yes, sparklers are among the least dangerous fireworks and the landscape happens to be significantly less crispy than this time last year, but the joke stands.)

<Holds up finger to discouraged student>

You mean you can't move objects with your mind *yet*.

Normal languages like Java and Python let you make arrays of arrays and lists of lists. Composition is one of the great ideas of computer science.

, on the other hand, has special names and syntax for each level.

All same type? One dimension is a vector, two is a matrix, three is an array.

> 1:3
[1] 1 2 3
> matrix(1:9, nrow=3)
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
> array(1:27, dim=c(3, 3, 3))
, , 1

[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9

, , 2

[,1] [,2] [,3]
[1,] 10 13 16
[2,] 11 14 17
[3,] 12 15 18

, , 3

[,1] [,2] [,3]
[1,] 19 22 25
[2,] 20 23 26
[3,] 21 24 27

Lists allow for different types within the same structure (although I don't use them in the example below). The display syntax does not scream consistency or concision:

> a = list(x=1, y=2)
> a
$x
[1] 1

$y
[1] 2

> list(a, a)
[[1]]
[[1]]$x
[1] 1

[[1]]$y
[1] 2

[[2]]
[[2]]$x
[1] 1

[[2]]$y
[1] 2

> list(list(a, a), list(a, a))
[[1]]
[[1]][[1]]
[[1]][[1]]$x
[1] 1

[[1]][[1]]$y
[1] 2

[[1]][[2]]
[[1]][[2]]$x
[1] 1

[[1]][[2]]$y
[1] 2

[[2]]
[[2]][[1]]
[[2]][[1]]$x
[1] 1

[[2]][[1]]$y
[1] 2

[[2]][[2]]
[[2]][[2]]$x
[1] 1

[[2]][[2]]$y
[1] 2

(Yes, that last monstrosity is a display of a three dimensional list containing *eight numbers*.)

It's like reading old math texts, where statements are in paragraphs instead of symbols and there is special terminology for rhombuses and surjections and "summing to unity". How about we just cut to the chase and use Roman numerals?

@data_science

Discussing concatenating lists in , The Art of R Programming notes parenthetically that “It’s odd that setting recursive to TRUE gives a nonrecursive list.”

YES THAT IS ODD.

@data_science

If you replace an element of an list with NULL, it shortens the list.

Well, sometimes.

> a = list(1, 2, 3, 4, 5)
> b = list(8, NULL, 10)
> length(a)
[1] 5
> a[2:4] = b
> length(a)
[1] 5
> a
[[1]]
[1] 1

[[2]]
[1] 8

[[3]]
NULL

[[4]]
[1] 10

[[5]]
[1] 5

> a[3] = NULL
> length(a)
[1] 4

@data_science

I have the same objection to that I do to heavy historical tabletop wargames: too many special case exceptions.

> m = matrix(1:6, nrow=3)
> m
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
> a = c(1, 2)
> b = c(1)
> dim(m[a,])
[1] 2 2
> dim(m[b,])
NULL
> dim(m[b,, drop=FALSE])
[1] 1 2

@data_science

The D river (which we visited last month) lost its claim as the world's shortest river in 1989.

en.wikipedia.org/wiki/D_River

Stacklands had, for me, the same arc (on a smaller scale) as FTL:

1. This is sort of interesting, but the graphics are underwhelming.
2. This is too hard.
3. <Late at night> Wait, but what if I ...
4. Oh, I can give orders while the game is paused? This changes everything!
5. I got a sense of completion from beating the main objective, but the bonus objective(s) would be too tedious.

It's clever. Definitely got my $4 worth.

Stacklands had, for me, the same arc (on a smaller scale) as FTL:

  1. This is sort of interesting, but the graphics are underwhelming.
  2. This is too hard.
  3. Wait, but what if I ...
  4. Oh, I can give orders while the game is paused? This changes everything!
  5. I got a sense of completion from beating the main objective, but the bonus objective(s) would be too tedious.

It’s clever. Definitely got my $4 worth.

Show more
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.