Skip to content

Instantly share code, notes, and snippets.

@nooralibutt
Created December 28, 2020 08:11
Show Gist options
  • Save nooralibutt/3353875703b2bf69408db134c0b1069d to your computer and use it in GitHub Desktop.
Save nooralibutt/3353875703b2bf69408db134c0b1069d to your computer and use it in GitHub Desktop.
How to enter hackbot data
void main() {
print(emailSeasonData());
}
Season emailSeasonData() {
List<Level> levelList = [];
List<LevelCard> levelCardList = [];
// ----------------------CODE BEGIN HERE---------------------- //
// -------------- Demo BEGIN LEVEL -------------- //
levelCardList = [];
levelCardList.add(LevelCard(
title: '',
description: '',
imgSrc: '',
hasPassword: true,
));
levelCardList.add(LevelCard(
title: '',
description: '',
imgSrc: '',
hasPassword: true,
));
levelCardList.add(LevelCard(
title: 'Tips',
description: 'Hack the wifi password.',
imgSrc: 'tips',
));
levelList.add(Level(
cards: levelCardList,
keyboardLetters: '',
password: '',
difficulty: LevelDifficulty.easy,
visibleBoxes: [],
));
// -------------- DEMO END LEVEL -------------- //
// -------------- BEGIN LEVEL 1 -------------- //
levelCardList = [];
levelCardList.add(LevelCard(
title: 'Identity',
description:
'Name: **SHAN POLLOCK**\n\nDate of birth: **12/03/1992**\n\nOccupation: **BUSINESSMAN**',
imgSrc: 'identity',
hasPassword: false,
));
levelCardList.add(LevelCard(
title: 'Father',
description:
'The subject lost his father on **09/11** and considers that fateful day a real turn of events in his life.',
imgSrc: 'partner',
hasPassword: true,
));
levelCardList.add(LevelCard(
title: 'Tips',
description: 'Hack the phone pin.',
imgSrc: 'tips',
));
levelList.add(Level(
cards: levelCardList,
keyboardLetters: '12345678901#',
password: '0911',
difficulty: LevelDifficulty.easy,
visibleBoxes: [],
));
// -------------- END LEVEL 1 -------------- //
// -------------- BEGIN LEVEL 2 -------------- //
levelCardList = [];
levelCardList.add(LevelCard(
title: 'Identity',
description:
'Name: **ABDUL AZIZ**\n\nDate of birth: **09/09/1987**\n\nOccupation: **POLICEMAN**',
imgSrc: 'identity',
hasPassword: false,
));
levelCardList.add(LevelCard(
title: 'Favorite Singer',
description:
'The subject is a huge fan of Nusrat Fateh Ali Khan and fondly calls the maestro **NFAK**.',
imgSrc: 'music',
hasPassword: true,
));
levelCardList.add(LevelCard(
title: 'Tips',
description: 'Hack the phone pin(pin consists of numbers of T9 keypad).',
imgSrc: 'tips',
));
levelList.add(Level(
cards: levelCardList,
keyboardLetters: '1234567890*#',
password: '5324',
difficulty: LevelDifficulty.easy,
visibleBoxes: [],
));
// -------------- END LEVEL 2 -------------- //
// ----------------------CODE END HERE---------------------- //
return Season(
title: 'Phone pins',
description:
'Hack the smartphones onscreen pin code through sampling user information from identity, stories & riddles',
imgSrc: 'assets/images/game/phone.png',
levelList: levelList,
);
}
class Season {
final String title;
final String description;
final String imgSrc;
List<Level> levelList;
Season({
this.title,
this.description,
this.imgSrc,
List<Level> levelList,
}) {
levelList.asMap().forEach((index, element) {
element.number = index + 1;
element.seasonName = this.title;
});
this.levelList = levelList;
}
@override
String toString() {
String str = '\n Season Name: ' + title + '\n';
levelList.asMap().forEach((index, l) {
str += '\n\tLevel ${index + 1}\n';
str += '\t\t' + l.cards.join(', ');
});
return str;
}
}
enum LevelDifficulty { easy, medium, hard }
class Level {
final List<LevelCard> cards;
final String password;
final List<int> visibleBoxes;
final String keyboardLetters;
final LevelDifficulty difficulty;
int number;
String seasonName;
Level({
this.cards,
this.password,
this.visibleBoxes,
this.keyboardLetters,
this.difficulty = LevelDifficulty.easy,
});
@override
String toString() => cards.join('\n\t');
}
class LevelCard {
final String title;
final String description;
final String imgSrc;
final bool hasPassword;
const LevelCard({
this.title = 'Identity',
this.description,
this.imgSrc = 'identity',
this.hasPassword = false,
});
@override
String toString() => title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment