# What's the dog doin?

What's the dog doin? (Wtdd? for short) is an esoteric programming language created by User:GreenThePear in June 2021 made to be written entirely by variations of the phrase used in it's name. It was inspired by Airline food.

It works on an infinite zero-based array with it's own number writing system and expression syntax. All of it's values start at zero which in practicality means that an undeclared variable will be interpreted as such.

## Commands

As shown in the table `[x]` is always used to index and, potentially - depending on the command, return the value in the array. `[y]` used in the second command is a raw value that, well, also can be returned from the array. See Expressions for further explanation.

Command Description
`What[x] doin?` Sets the value at `[x]` to user input.
`What[x], but what[y] doin?` Sets the value at `[x]` to `[y]`.
`Bro what[x] doin?` Prints value at `[x]`.
`Ayo what[x] doin?` Prints value at `[x]` in ascii.
`What[x] doin, tho?` If value at `[x]` equals zero go to the corresponding `What [x] doin, doe?`, else keep going.
`What[x] doin, doe?` If value at `[x]` equals zero keep going, else go to the corresponding `What [x] doin, tho?`.

## Number system

The What the dog doin? Number System (Wtdd?NS for short) is the only acceptable way of expressing numbers in the language including user input. It is restricted to integers and is essentially base 3 but the digits are replaced with the following strings:

Digit in base 3 Strings in Wtdd?NS
`0` `the`
`1` `that`
`2` `this`

These are separated with spaces so counting starting at 0 looks like this:

`the, that, this, that the, that that, that this, this the, this that, this this, that the the`

And so on. Thus the number 2147483647 in Wtdd?NS is:

`that this that that this that this this this that this that that the this the this that the that`

## Expressions

A variable in an expression has the following structure:

`[starting operator][number]["dog"]`

The starting operator can either be `'s ` (which must be used as ` is ` if in code it does not appear right after a `What`/`what`) or ` do `. The former means it's a raw value and the latter is used to return the value of the array at index `[number]`. To clarify, in Python 3 the array being a list named `arr`, the starting operators work like this:

Expression in Wtdd? Python 3 equivalent Example function in Wtdd? Python 3 equivalent
`'s number dog` or `is number dog` `number` `Bro what's number dog doin?` `print(arr[number])`
`do number dog` `arr[number]` `Bro what do number dog doin?` `print(arr[arr[number]])`

The `[number]` must be written in Wtdd?NS. Expressions can be created with multiple variables using arithmetic operators, which abide by the mathematical order of operations, and in What the dog doin? are as follows:

Operator Name Conventional symbol
`um` addition `+`
`umm` subtraction `-`
`uh` multiplication `*`
`uhh` floor division `//`
`be` open parenthesis `(`
`gon` close parenthesis `)`

The parentheses are optional and `be` can be used right after the `[starting operator]` and `gon` right before `["dog"]` to get the `[number]` using an expression, which means that they can be nested indefinitely. So, for example, if one wants to increase the value of the first variable in the array by one they can write:

`What's the dog, but what do the dog um is that dog doin?`

Another example - this in Python 3 would equal to `arr[arr[0]+2] = arr[10*arr[arr[1]+5]]`:

```What do the dog um is this dog, but what do be is that the that dog uh do be that dog um is that this dog gon dog doin?```

## Examples

```What's the dog, but what's that that that dog doin?
What's that dog, but what's this this the the dog doin?
What's this dog, but what's that the this the this dog doin?
What's that the dog, but what's that that the the the dog doin?
What's that that dog, but what's that that the the the dog doin?
What's that this dog, but what's that that the that the dog doin?
What's this the dog, but what's that that this this dog doin?
What's this that dog, but what's that the that this dog doin?
What's this this dog, but what's that that the that the dog doin?
What's that the the dog, but what's that that the that the dog doin?
What's that the that dog, but what's that that the this the dog doin?
What's that the this dog, but what's that that the the the dog doin?
What's that that the dog, but what's that the this the that dog doin?
What's that that that dog, but what's that the this the dog doin?
What's the dog doin, tho?
Ayo what do the dog doin?
What's the dog, but what do the dog umm is that dog doin?
What's the dog doin, doe?
```
```What's the dog doin?
What's the dog doin, tho?
Bro what's the dog doin?
What's the dog doin, doe?
Bro what's the dog doin?
```

Likely not the best way to implement it but!

```What's the dog doin?
What's that dog, but what do the dog umm is that dog doin?
What's the dog doin, tho?
What's the dog, but what do the dog uh do that dog doin?
What's that dog, but what do that dog umm is that dog doin?
What's the dog doin, doe?
Bro what's the dog doin?
```