Project Description - CMPUT301W23T20/QR-GO GitHub Wiki
Warning: This is subject to change!
You are to design and implement a simple, attractive, and easy-to-use Android application to satisfy the following goals. Your design must be flexible enough to allow developers to extend or migrate it.
We want a mobile application that allows us to hunt for the coolest QR codes that score the most points. Players will run around scanning QR codes, barcodes, etc. trying to find barcodes and QR codes that give them the most points.
QR codes and barcodes (scannable codes) will be hashed and the hashes they produce will be analyzed and scored. A QR code that has certain properties like repeated nibbles or bytes (hex digits) will have a higher score than a QR code that does not. We have a proposed scoring system, but the implementers are free to use a different scoring system.
We want users to compete with each other for the highest scoring QR codes, the most QR codes, the highest sum of QR codes, or highest scoring QR codes in a region.
When a player scans a QR code they will take a photo of what or where the QR code is and also record the geolocation of the QR code.
Players can see on a map local QR codes that other players have scanned.
Scenario: I open my QRHunter app. I see a QR code in my wallet. I indicate I want to add a new QR code and I use the phone camera to add the QR code. The QR code is scored and I’m told that my QR score is 30. The system prompts me for a photo of the object I scanned. I decline since this was an ID card. I also decline geolocation because it is in my wallet. The system adds the 30 points to my total score and records a hash of the QR code. I then see some sticker on a pole. I scan it and am told it is worth 1000 points! I record the geolocation and take a photo of the pole and save it to my account. 1000 points wow. Then I see that other users have found this pole as well. So I open the map for nearby QR codes and I see something worth 10000 is 100 meters away so I’m going to head on over there!
Needs in (Partial) User Story Form Actors:
Player: a person who plays the game
Owner: the entity that owns the infrastructure that the game runs on.
Glossary:
QR Code: a scannable code, either a barcode, a QR code, or other code scannable by Zebra crossing libraries or google QR code scanning libraries.
User needs are expressed in the form of partial user stories:
As a , I want .
These descriptions may change to correct omissions and clarify noticed issues. New requirements will be introduced for the final project part.
Player
US 01.01.01
As a player, I want to add new QR codes to my account.
US 01.02.01
As a player, I want to see what QR codes I have added to my account.
US 01.03.01
As a player, I want to remove QR codes from my account.
US 01.04.01
As a player, I want to see my highest and lowest scoring QR codes.
US 01.05.01
As a player, I want to see the sum of scores of QR codes that I have scanned.
US 01.06.01
As a player, I want to see the total number of QR codes that I have scanned.
US 01.07.01
As a player, I want to see other player’s profiles
Game QR Codes
US 02.01.01
As a player, I want to be able to scan QR codes and record a photo of the location or object, and the geolocation of the location or object.
US 02.02.01
As a player, I want to be able to comment on QR codes.
US 02.03.01 As a player, I want to be able to browse QR codes that other players have scanned.
US 02.04.01
As a player, I want to see that other players have scanned the same QR code.
US 02.05.01
As a player, I want QR codes to have a unique human readable name.
US 02.06.01
As a player, I want to see a visual representation of a QR code relatively unique to that QR code.
Player profile
US 04.01.01
As a player, I want a profile with a unique username and my contact information.
US 04.02.01
As a player, I do not want to log into my application using a username and password as my device can identify me.
Searching
US 05.01.01
As a player, I want to search for other players by username.
US 05.02.01
As a player, I want to search for nearby QR codes by using geolocation.
Location
US 06.01.01
As a player, I want to see a map of geo-locations of nearby QR codes.
Scoring
US 07.01.01
As a player, I want to see game-wide high scores of all players.
US 07.02.01
As a player, I want an estimate of my ranking for the highest scoring unique QR code.
Privacy
US 08.01.01
As a player, I don’t want the actual code recorded. E.g., so I can scan and score my vaccine passport.
US 08.02.01
As a player, I want to be able to decline recording geolocation for privacy reasons.
Owner
US 09.01.01
As an owner, I don’t want to store big images online.
Proposed Scoring System:
First, we calculate a SHA-256 hash of the QR code contents.
Example:
QR code contents: BFG5DGW54
Calculating SHA-256 hash:
@slate:~$ echo BFG5DGW54 | sha256sum 696ce4dbd7bb57cbfe58b64f530f428b74999cb37e2ee60980490cd9552de3a6 -
Then, based on the hexadecimal representation of the sha256, the score is calculated in the following way:
a "0" is 1 point
Many 0 in a row are multiplied by 20^(n-1) whereby n is the number of repeats
00 - 20^1 - 20
000 - 20^2 - 400
0000 - 20^3 - 8000
Same for other numbers
11 - 1
111 - 1
1111 - 1
22 - 2
222 - 4
2222 - 8
99 - 9
999 - 81
aa - 10
aaa - 100
ff - 15
fff - 225
So the best QR code would be made of all 0s or higher digits
For the QR code above
696ce4dbd7bb57cbfe58b64f530f428b74999cb37e2ee60980490cd9552de3a6
Let’s find the repeated digits
echo BFG5DGW54 | sha256sum | perl -lpe 'print "$1$2" while /([0-9a-f])(\1+)/g'
bb 999 ee 55
And calculate the score
bb - 11
999 - 9^2 - 81
ee - 14
55 - 5
Score: 11 + 81 + 14 + 5 = 111
Example Name System: US 02.05.01 You can make up any naming system you want. Here's an example with dictionaries.
Given the first 6 bits of a hash we can make up a name:
bit 0: cool, hot
bit 1: Fro, Glo
bit 2: Mo, Lo
bit 3: Mega, Ultra
bit 4: Spectral, Sonic
bit 5: Crab, Shark
So given 000000b
cool FroMoMegaSpectralCrab
So given 101011b
hot FroLoMegaSonicShark
You can use larger dictionaries, but given the same hash you should come up with the same name.
Example Visual System: US 02.06.01
You can make up any naming system you want. Here's an example with dictionaries in the spirit of Pokemon.
Given the first 6 bits of a hash we can make up a name:
bit 0: draw closed eyes, draw bright eyes
bit 1: draw mean eyebrows, draw no eyebrows
bit 2: draw round face, draw square face
bit 3: draw big nose, draw no nose
bit 4: draw smile, draw frown
bit 5: draw ears, draw no ears
So given 000000b
draw closed eyes, draw mean eyebrows, draw round face, draw big nose, draw smile, draw ears
/
| _ _ |/
@| || |@
/| ,`` ,|
| |
| --
|
____/
You can use larger dictionaries, but given the same hash you should come up with the same visualization.