Skip to content

Commit

Permalink
Adds types to semantics level 12 and 13 (hedyorg#1733)
Browse files Browse the repository at this point in the history
* natural language semantics, level 2 en 3 added, level 1 little correction

* rebase stuff

* adds types to semantics level 12 and 13

Co-authored-by: Felienne <[email protected]>
  • Loading branch information
juliabolt and Felienne authored Jan 20, 2022
1 parent ffbac89 commit 1d96172
Showing 1 changed file with 120 additions and 24 deletions.
144 changes: 120 additions & 24 deletions SEMANTICS.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2366,20 +2366,64 @@ Level 11 supports:

## Level 12

### Commands
### Commands and types

Level 12 supports:
* `print`
* `ask`
* `is`
* `sleep`
* `at random`
* `add to`
* `remove from`
* `if`
* `if else`
* `repeat`
* `for`

<table>
<thead>
<tr>
<th>Command</th>
<th>Types</th>
</tr>
</thead>
<tbody>
<tr>
<td>print</td>
<td>integer | string | float</td>
</tr>
<tr>
<td>ask</td>
<td>integer | string | float</td>
</tr>
<tr>
<td>is | =</td>
<td>string (before `is`) + any (after `is`)</td>
</tr>
<tr>
<td>sleep</td>
<td>empty | integer</td>
</tr>
<tr>
<td>at random</td>
<td>list</td>
</tr>
<tr>
<td>add to</td>
<td>list</td>
</tr>
<tr>
<td>remove from</td>
<td>list</td>
</tr>
<tr>
<td>if</td>
<td>boolean</td>
</tr>
<tr>
<td>if else</td>
<td>boolean</td>
</tr>
<tr>
<td>repeat</td>
<td>integer + 'times'</td>
</tr>
<tr>
<td>for</td>
<td>string + 'in' + list | string + 'in' + 'range' + integer + 'to' + integer</td>
</tr>
</tbody>
</table>

#### Correct Programs

Expand Down Expand Up @@ -2551,20 +2595,72 @@ Level 12 supports:

## Level 13

### Commands
### Commands and types

Level 13 supports:
* `print`
* `ask`
* `is`
* `sleep`
* `at random`
* `add to`
* `remove from`
* `if`
* `if else`
* `repeat`
* `for`

<table>
<thead>
<tr>
<th>Command</th>
<th>Types</th>
</tr>
</thead>
<tbody>
<tr>
<td>print</td>
<td>integer | string | float</td>
</tr>
<tr>
<td>ask</td>
<td>integer | string | float</td>
</tr>
<tr>
<td>is | =</td>
<td>string (before `is`) + any (after `is`)</td>
</tr>
<tr>
<td>sleep</td>
<td>empty | integer</td>
</tr>
<tr>
<td>at random</td>
<td>list</td>
</tr>
<tr>
<td>add to</td>
<td>list</td>
</tr>
<tr>
<td>remove from</td>
<td>list</td>
</tr>
<tr>
<td>if</td>
<td>boolean</td>
</tr>
<tr>
<td>if else</td>
<td>boolean</td>
</tr>
<tr>
<td>repeat</td>
<td>integer + 'times'</td>
</tr>
<tr>
<td>for</td>
<td>string + 'in' + list | string + 'in' + 'range' + integer + 'to' + integer</td>
</tr>
<tr>
<td>and</td>
<td>boolean (before `and`) + boolean (after `and`)</td>
</tr>
<tr>
<td>or</td>
<td>boolean (before `or`) + boolean (after `or`)</td>
</tr>
</tbody>
</table>

#### Correct Programs

Expand Down

0 comments on commit 1d96172

Please sign in to comment.