Skip to content

Instantly share code, notes, and snippets.

@JCaraballo113
Created February 14, 2017 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JCaraballo113/105f7fe7dcb5ee23b295e196da1c281d to your computer and use it in GitHub Desktop.
Save JCaraballo113/105f7fe7dcb5ee23b295e196da1c281d to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { View, Text, TextInput } from 'react-native';
import {Button, Card, CardSection } from './common';
export default class CardDeck extends Component {
constructor(props) {
super(props);
this.state = {
remainingCards: 52,
numberOfAces: 4,
numberOfJacks: 4,
numberOfClubs: 4,
}
}
drawNextCard() {
// Draw your next card
}
discardNumCards(cardsToDiscard) {
this.setState({
...this.state,
remainingCards: this.state.remainingCards - cardsToDiscard
});
}
shuffleDeck() {
// Shuffle deck
}
render() {
return (
<View>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment