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
componentDidMount = () => { | |
this.animationLooper(); | |
} | |
animationLooper = () => { | |
this.setState({ | |
imageCounter: this.state.imageCounter + 1 | |
}); | |
setTimeout( | |
this.animationLooper.bind(this), |
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
<Expo.MapView.Marker | |
key={this.props.key} | |
image={this.state.sprites[this.state.imageCounter % 3]} | |
coordinate={{ | |
latitude: this.props.location.loc[0], | |
longitude: this.props.location.loc[1], | |
}} | |
/> |
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
case 'WRITE_DISTANCE_RESULTS': | |
return locations.map((location) => { | |
if (location.ID === action.ID) { | |
let distances = [action.distance].concat(location.distances); | |
distances = distances.slice(0, action.locationArrayMaxLength); | |
let distanceAverage = distances.reduce(function (sum, value) { | |
return sum + value; | |
}, 0) / distances.length; | |
return Object.assign({}, | |
location, |
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
componentWillMount() { | |
... | |
// periodically check device location and write the results to | |
// the location markers | |
setInterval( | |
this.performLocationChecking.bind(this), | |
1000); | |
} | |
performLocationChecking() { |
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 MapScreen extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
showNamePrompt: false, | |
location: undefined, | |
name: undefined | |
}; | |
} |
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 perms = []; | |
function permAlone(str) { | |
var strArr = str.split(""); | |
//console.log(strArr); | |
// empty the answer array each time this function is called | |
perms = []; | |
permutator(strArr.length, strArr); | |
console.log(str + " - num perms: " + perms.length); | |
// console.log(perms.join(", ")); |
NewerOlder