Skip to content

Instantly share code, notes, and snippets.

@chrisgco
chrisgco / oy.java
Last active December 16, 2016 04:15
public boolean solve(int col){
if (col == mySize) return true;
// try each row until all are tried
for(int r=0; r < mySize; r++){
if (myBoard.safeToPlace(r,col)){
myBoard.setQueen(r, col, true);
if (solve(col + 1)) {
return true;
}
myBoard.setQueen(r, col, false);
@chrisgco
chrisgco / handler.js
Last active May 16, 2016 23:40
Alexa Site Intent Handler
"ChangeAlignmentIntent": function(intent, session, response) {
SquareSpace.handleAlignment(intent, session).then(function() {
return response.tell('Ok, I\'ve made the change');
}).catch(function(err){
return response.tell('I apologize ' + session.user.first_name + ', I had trouble making that change. Please try again');
});
},
@chrisgco
chrisgco / utterances.txt
Created May 16, 2016 23:35
Alexa Site Utterances
ChangeAlignmentIntent {alignment} align everything on the page
ChangeAlignmentIntent {alignment} align everything
ChangeAlignmentIntent {alignment} everything on the page
ChangeAlignmentIntent {alignment} everything
ChangeAlignmentIntent move everything equal to the {alignment}
ChangeAlignmentIntent move everything to the {alignment}
ChangeAlignmentIntent change the alignment equal to {alignment}
ChangeAlignmentIntent change the alignment to {alignment}
ChangeAlignmentIntent change alignment equal to {alignment}
ChangeAlignmentIntent change alignment to {alignment}
@chrisgco
chrisgco / intents.json
Last active May 16, 2016 23:57
Alexa Site
{
"intents": [
{
"intent": "ChangeAlignmentIntent",
"slots": [
{
"name": "alignment",
"type": "ALIGNMENT_TYPE"
}
]