Skip to content

Commit 38cb762

Browse files
Change difficulty when hashes per sec > difficulty
1 parent 1528262 commit 38cb762

File tree

6 files changed

+29
-2
lines changed

6 files changed

+29
-2
lines changed

.github/makecode/blocks.png

7.76 KB
Loading

.github/makecode/blocksdiff.png

-611 KB
Loading

images.g.jres

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
"mimeType": "image/x-mkcd-f4",
5050
"displayName": "buy_asic_button"
5151
},
52+
"image11": {
53+
"data": "hwQIAAgAAAAAUABQAFAFVQBVVVVVVVUFVVVVBQBVVVUAUAVVAFAAUA==",
54+
"mimeType": "image/x-mkcd-f4",
55+
"displayName": "star"
56+
},
5257
"anim1": {
5358
"namespace": "myAnimations",
5459
"id": "anim1",

images.g.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ f 1 1 1 1 1 1 1 1 1 1 1 1 1 1 f
155155
f 1 1 1 1 1 1 1 1 1 1 1 1 1 1 f
156156
f 1 1 1 1 1 1 1 1 1 1 1 1 1 1 f
157157
f f f f f f f f f f f f f f f f
158+
`;
159+
case "image11":
160+
case "star":return img`
161+
. . . 5 5 . . .
162+
. . . 5 5 . . .
163+
. . 5 5 5 5 . .
164+
5 5 5 5 5 5 5 5
165+
. 5 5 5 5 5 5 .
166+
. . 5 5 5 5 . .
167+
. 5 5 5 5 5 5 .
168+
5 5 5 . . 5 5 5
158169
`;
159170
}
160171
return null;

main.blocks

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

main.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,3 +555,14 @@ forever(function () {
555555
raw_tick_count += 1
556556
})
557557
})
558+
forever(function () {
559+
if (Math.floor(average_hash_per_sec) >= max_height) {
560+
while (Math.floor(average_hash_per_sec) >= max_height) {
561+
max_height = Math.floor(max_height * 1.5)
562+
score_change = Math.ceil(score_change * 1.5)
563+
}
564+
Notification.waitForNotificationFinish()
565+
Notification.notify("Difficulty has been set to " + max_height + "!" + " (Reward is $" + score_change + ")", assets.image`star`)
566+
}
567+
pause(1000)
568+
})

0 commit comments

Comments
 (0)