-
Javascript Basics (ES6 and above).
- Official Documentation (Best place to go): https://developer.mozilla.org/en-US/docs/Web/JavaScript
- Videos : https://scrimba.com/g/gintrotoes6
- Fuller third party reference: https://www.tutorialspoint.com/es6/index.htm
-
React Basics (What it is, what a component is)
- Probably the best all round course
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
// @flow | |
import React from 'react'; | |
import SyntaxHighlighter from 'react-syntax-highlighter/prism'; | |
import { dark } from 'react-syntax-highlighter/styles/prism'; | |
import { renderToStaticMarkup } from 'react-dom/server'; | |
import pretty from 'pretty'; | |
import jsxToString from 'jsx-to-string'; | |
type Props = { children: any, showReact?: boolean, showHTML?: boolean, showIcon?: boolean }; | |
type State = { active: number }; |
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
// this is the new behaviour. You set a global varaible inside the lineFollower task and then use it inside an arbiter. | |
// forage variables are show to give an idea of how it works. | |
int forage_left, forage_right, follow_left, follow_right; | |
task arbiter(){ | |
if( follow_left || follow_right) { | |
setMotorSpeed(left, follow_left); | |
setMotorSpeed(right, follow_right); | |
} else if (forage_left || forage_right) { |
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
/* We use the most important first in the if statement. If follow_left and follow_right are not 0, then we use the follow | |
otherwise we check the next one, which is forage */ | |
task arbiter() { | |
if ( follow_left || follow_right) { | |
move(follow_left, follow_right); | |
} else if ( forage_left || forage_right) { | |
move(forage_left, forage_right); | |
} | |
} |
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
class kinect(): | |
def __init__(self): | |
#initialize the class | |
def searchForRed(self): | |
#search for color with RGB values passed in | |
if found : | |
return true | |
else: | |
return 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
class kinect(): | |
def __init__(self): | |
#initialize the class | |
self.foundColor = NULL | |
def getColor(self): | |
if self.searchForColor(255, 0, 0): #look for red | |
self.foundColor = 'red' | |
elif self.searchForColor(0, 255, 0): #look for green |
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
const int A | |
void setConstant(int x){ | |
A = x; | |
} |