This file contains 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
import 'package:exam1_emoji_matching/emoji_matching_game.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
late MatchingGame game3; | |
late MatchingGame game5; | |
late MatchingGame game10; | |
setUp(() { | |
game3 = MatchingGame(3); | |
game10 = MatchingGame(10); |
This file contains 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
import "package:test/test.dart"; | |
import "tic_tac_toe_game.dart"; | |
void main() { | |
late TicTacToeGame game; | |
setUp(() { | |
game = TicTacToeGame(); | |
}); | |
test("Initial Game", () { | |
expect(game.state, equals(TicTacToeState.xTurn)); |
This file contains 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
! function (e) { | |
var n = function (e) { | |
var n = e.split(".")[1]; | |
if (n = JSON.parse(atob(n)), n.d) n = n.d; | |
else { | |
var r = n.uid; | |
n = n.claims, n.uid = r | |
} | |
return { | |
token: e, |
This file contains 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
""" | |
rosegraphics.py - a simple Graphics library for Python. | |
Its key feature is: | |
-- USING this library provides a simple introduction to USING objects. | |
Other key features include: | |
-- It has a rich set of classes, methods and instance variables. | |
In addition to classes like Circles that are natural for students, | |
it has other kinds of classes like RoseWindow and SimpleTurtle |
This file contains 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
""" | |
rosegraphics.py - a simple Graphics library for Python. | |
Its key feature is: | |
-- USING this library provides a simple introduction to USING objects. | |
Other key features include: | |
-- It has a rich set of classes, methods and instance variables. | |
In addition to classes like Circles that are natural for students, | |
it has other kinds of classes like RoseWindow and SimpleTurtle |
This file contains 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
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:flutter/material.dart'; | |
class FirestoreModelUtils { | |
// A few date time helpers that really don't belong here, but it's easy: | |
static DateTime fromTimestampToDateTime(Timestamp value) => value.toDate(); | |
static Timestamp fromDateTimeToTimestamp(DateTime value) => | |
Timestamp.fromDate(value); | |
static TimeOfDay fromDateTimeToTimeOfDay(DateTime value) { | |
DateTime epochDate = DateTime(1970, 1, 1, 0, 0); |
This file contains 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
// One possible solution | |
enum TicTacToeMark { none, x, o } | |
enum TicTacToeState { xTurn, oTurn, xWon, oWon, tie } | |
class TicTacToeGame { | |
var board = List<TicTacToeMark>.filled(9, TicTacToeMark.none); | |
var state = TicTacToeState.xTurn; | |
void pressedSquare(int index) { |
This file contains 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
// These methods could be added to your existing class. | |
/** | |
* Read button - Gets the state of the fake pushbutton (0 or 1) | |
* method: GET | |
* path: /api/readbutton | |
* expected request body: none | |
* side effects: none (the pushbutton is always random) | |
* response: {"button": 0} or {"button": 1} | |
*/ |
This file contains 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 rhit = rhit || {}; | |
rhit.PiSimulatorController = class { | |
constructor() { | |
// No separate model object. Just do it within the controller. | |
this.button = 1; | |
this.leds = {red: 0, yellow: 1, green: 0}; | |
this.servos = [-45, 0, 90]; |
This file contains 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
body { | |
background: #DDDDDD; | |
} | |
.navbar { | |
background-color: #800000; | |
color: white; | |
} | |
.page-container { |
NewerOlder