Skip to content

aravart/speech-games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


GUIDE FOR SPEECHGAMES

Updated 3/6/2017


___________________________________________________________________________________________________ ## ABOUT
This is a guide for completing the levels at http://aravart.github.io/speech-games.
Google Blockly is a system for learning how to program through the visualization of 'blocks' that represent common coding constructs. Speech Games is a series of levels that teach programming using Google Blockly with a twist: everything can be controlled by speech input.

___________________________________________________________________________________________________ ## QUICK BASICS

The task of the user is to complete the levels through adding blocks onto the workspace and arranging them in a manner that completes the task. Below is the basic syntax.

Commands: get, connect, delete, change, run

Easy command for each command type

"get a move block"
"connect block 1 under block 2"
"delete block 1"
"change 90 in block 1 to 120"
"run the program"

___________________________________________________________________________________________________ ## IN DEPTH GUIDE
The grammar understands a little bit more than what’s above. Here are some more ways to specify each command. The portion inside (and not including) the quotation marks can be input. Additional comments are in parentheses after the quotation marks.

NOTATION

{type} means a block type listed in the toolbox on the left like "if," "repeat," etc.
{id} means an ID such as "1," "2," etc.
{value} means any one word or number (string ends at the first space after the string begins).
{where} means under or inside.

GET: Get a specific block type

"get a {type} block"
Example:
"get a move block"

CONNECT: Connect a block

"connect block {id} {where} block {id2}"
Example:
"connect block 1 under block 2"
"connect block 1 inside of block 2"

DELETE: Delete a block

"delete block {id}"
Example:
"delete block 1"

CHANGE: Change a block's properties (but not type)

"change {value} in block {id} to {value}"
Examples
"change 90 in block 1 to 120"

RUN: Run the program defined by the blocks in the canvas

"run the program"




EXAMPLE OBJECTS

These are examples of the objects passed from the parser down to the interpreter for the most complex (most specifications) command of each command type.

CONNECT: "connect block 1 under block 2":

{
    "action": "connect",
    "block": 1,
    "where": {
       "blockId": 2,
       "position": "under"
    },
}

GET: "get a move block":

{
    "action": "get",
    "type": "move"
}

DELETE: "delete block 1":

{
    "action": "delete",
    "blockId": 1
}

CHANGE: "change 90 in block 1 to 120":

{
    "action": "change",
    "orig": 90,
    "new": 120,
    "block": 1
}

RUN: "run the program":

{
    "action": "run"
}