Skip to content

Instantly share code, notes, and snippets.

View harshpyati's full-sized avatar
🎯
Focusing

Harsh Pyati harshpyati

🎯
Focusing
  • Bengaluru
View GitHub Profile
@harshpyati
harshpyati / oop.dart
Created January 17, 2019 18:32
A program demonstrating a game of Cards written using Dart only using its OOP features.
class Deck{
List<Card> cards = new List<Card>();
Deck(){
var ranks = ['Ace','Two','Three','Four','Five'];
var suits = ['Diamonds','Hearts','Clubs','Spades'];
for(var suit in suits){
for(var rank in ranks){
var card = new Card(rank:rank,
@harshpyati
harshpyati / index.dart
Created January 16, 2019 14:41
A Gist showing the OOP features of Dart Language
class Person{
String firstName;
int age;
Person(this.firstName,this.age);
printName(){
print(firstName);
}