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
| import Foundation | |
| struct QuizBrain { | |
| var questionNumber = 0 | |
| var score = 0 | |
| let quiz = [ | |
| Question(q: "A slug's blood is green.", a: "True"), | |
| Question(q: "Approximately one quarter of human bones are in the feet.", a: "True"), |
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
| List<int> winningNumbers = [12, 6, 34, 22, 41, 9]; | |
| void main() { | |
| List<int> ticket1 = [45, 2, 9, 18, 12, 33]; | |
| List<int> ticket2 = [41, 17, 26, 32, 7, 35]; | |
| checkNumbers(ticket1); |
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
| import 'dart:io'; | |
| void main() { | |
| performTasks(); | |
| } | |
| void performTasks() { | |
| task1(); | |
| task2(); | |
| task3(); |
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
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| return runApp( | |
| MaterialApp( | |
| home: Scaffold( | |
| backgroundColor: Colors.red, | |
| appBar: AppBar( | |
| title: Text('Dicee'), |
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
| import 'package:flutter/material.dart'; | |
| import 'question_bank.dart'; | |
| QuestionBank questionBank = QuestionBank(); | |
| void main() => runApp(Quizzler()); | |
| class Quizzler extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
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
| import 'dart:math'; | |
| void main() { | |
| //loveCalculator1(); | |
| //loveCalculator2(); | |
| } |
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
| void main() { | |
| List<String> myList = [ | |
| 'Angela', | |
| 'James', | |
| 'Katie', | |
| 'Jack', | |
| ]; | |
| } |
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
| //Challenge: Without changing the main() function, can you make this code work and get the result printed in the console? | |
| void main() { | |
| int step1Result = add(n1: 5, n2: 9); | |
| int step2Result = multiply(step1Result, 5); | |
| double finalResult = step2Result / 3; | |
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
| import 'package:flutter/material.dart'; | |
| import 'package:audioplayers/audio_cache.dart'; | |
| const sounds = [ | |
| 'note1.wav', | |
| 'note2.wav', | |
| 'note3.wav', | |
| 'note4.wav', | |
| 'note5.wav', | |
| 'note6.wav', |
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
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: BallPage(), | |
| ), | |
| ); | |
| class BallPage extends StatelessWidget { |