This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var alexa = require('alexa-app'); | |
| // Define an alexa-app | |
| var app = new alexa.app('dragonhunt'); | |
| var dragonTypes = [ 'fire', 'ice', 'undead', 'skeleton', 'golden' ]; | |
| app.launch(function(req,res) { | |
| // Generate a random dragon. | |
| var randomType = Math.floor((Math.random() * 5)); // 0 - 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var chatskills = require('chatskills'); | |
| var readlineSync = require('readline-sync'); | |
| // Define an alexa-app | |
| var app = chatskills.app('dragonhunt'); | |
| var dragonTypes = [ 'fire', 'ice', 'undead', 'skeleton', 'golden' ]; | |
| app.launch(function(req,res) { | |
| // Generate a random dragon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var alexa = require('alexa-app'); | |
| // Create a skill. | |
| var hello = new alexa.app('hello'); | |
| // Launch method to run at startup. | |
| hello.launch(function(req,res) { | |
| res.say("Ask me to say hi!"); | |
| // Keep session open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var chatskills = require('chatskills'); | |
| var readlineSync = require('readline-sync'); | |
| // Create a skill. | |
| var hello = chatskills.app('hello'); | |
| // Launch method to run at startup. | |
| hello.launch(function(req,res) { | |
| res.say("Ask me to say hi!"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. popup.html - Right-click the extension icon in the toolbar and select "Inspect popup". | |
| 2. background.html - Right-click the extension icon and select "Manage extensions". | |
| Find your extension in the list and click "background page". | |
| 3. content scripts - Content scripts execute within the context of the web page. | |
| To debug them, use the same technique as debugging regular javascript on a page. | |
| Right-click on a web page and select "Inspect". | |
| console.log() and console.debug() statements will print to the debugger console. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var readlineSync = require('readline-sync'); | |
| var aiml = require('aiml-high'); | |
| var interpreter = new aiml(); | |
| interpreter.loadFiles(['./joke.aiml']); | |
| // Console client. | |
| var text = ' '; | |
| while (text.length > 0 && text != 'quit') { | |
| text = readlineSync.question('> '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # [2016-08-08] Challenge #278 [Easy/Med] Weave insert Part 1 | |
| # https://www.reddit.com/r/dailyprogrammer/comments/4wqzph/20160808_challenge_278_easymed_weave_insert_part_1/ | |
| # Demo: http://www.r-fiddle.org/#/fiddle?id=KPCdSZrV&version=1 | |
| # | |
| # Kory Becker 8/13/2016 | |
| # http://primaryobjects.com | |
| # | |
| ins <- function(option, arr1, arr2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var alexa = require('alexa-app'); | |
| // Allow this module to be reloaded by hotswap when changed | |
| module.change_code = 1; | |
| var app = new alexa.app('helloWorld'); | |
| app.launch(function(req, res) { | |
| var prompt = 'Hello there, what is your name?'; | |
| res.say(prompt).reprompt(prompt).shouldEndSession(false); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Given a list_of_ints, find the highest_product you can get from three of the integers. | |
| The input list_of_ints will always have at least three integers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You have an array of integers, and for each index you want to find the product of every integer except the integer at that index. | |
| Write a function getProductsOfAllIntsExceptAtIndex() that takes an array of integers and returns an array of the products. | |
| For example, given: | |
| [1, 7, 3, 4] | |
| your function would return: | |
| [84, 12, 28, 21] |