This gist covers the changes to loot tables introduced in 18w43a, the first 1.14 snapshot. Check out this more in-depth loot table guide.
Last updated: 18w49a
--- STEAMODDED HEADER | |
--- MOD_NAME: Seed Challenges | |
--- MOD_ID: seed_challenges | |
--- MOD_AUTHOR: [thirk] | |
--- MOD_DESCRIPTION: Allows seeding challenge runs. | |
---------------------------------------------- | |
------------MOD CODE ------------------------- | |
function G.UIDEF.challenge_list(from_game_over) | |
G.CHALLENGE_PAGE_SIZE = 10 |
--- STEAMODDED HEADER | |
--- MOD_NAME: Seed Persistence | |
--- MOD_ID: seed_persistence | |
--- MOD_AUTHOR: [thirk] | |
--- MOD_DESCRIPTION: Persist seeds between quick restarts. | |
---------------------------------------------- | |
------------MOD CODE ------------------------- | |
local start_run = Game.start_run | |
local start_setup_run = G.FUNCS.start_setup_run | |
local saved_seed = nil |
let hashOfPubKey = std::hash::keccak256(pub_key); | |
let mut result : Field = 0; | |
let mut v : Field = 1; | |
for i in 0..20 { | |
let index = (20 - i); | |
result += hashOfPubKey[index + 11] as Field * v; | |
v *= 256; | |
} |
/* | |
Goldbach's conjecture tested by a 47-state Turing machine | |
Author: Jared Showalter | |
If "a" and "i" were unbounded, this program would halt iff Goldbach's | |
conjecture is false. Furthermore, the program structurally | |
corresponds to a Turing machine with two symbols, one tape, and a | |
small number of states. The array "a" corresponds to the tape (each |
-- A cool autocomplete demo | |
-- @author Validark | |
-- Strings are stored in a lexigraphically sorted array, which can be binary searched for the first and last element which matches a query | |
-- Please note the "groupings" functionality is an unvalidated afterthought which may or may not work properly, but overall this code has some nice gems: | |
-- I was originally thinking that https://github.com/evaera/Cmdr could use this to get O(log n) autocompletes (old algo uses O(n)) | |
-- However, Cmdr is designed in such a way that it creates a new autocomplete function on-demand each time, | |
-- which means we'd have to sort (or at least verify the sortedness) of the most recent data each time (for changing data at least, like a Player list). | |
-- Sorting at run-time takes O(n*log n) time, making it hard to compete with the old algorithm where the pre-processing step just gets the data in the right format |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.17; | |
import "forge-std/Test.sol"; | |
contract TestDeleteMappingInStruct is Test { | |
/// @param enabled Whether the token is enabled or not | |
/// @param balances Mapping of user address to balance | |
struct Token { | |
bool enabled; |
#!/usr/bin/env node | |
console.log("I was executed from a gist inside the terminal with npx!"); |
This gist covers the changes to loot tables introduced in 18w43a, the first 1.14 snapshot. Check out this more in-depth loot table guide.
Last updated: 18w49a
### Keybase proof | |
I hereby claim: | |
* I am n4ru on github. | |
* I am n4ru (https://keybase.io/n4ru) on keybase. | |
* I have a public key ASCnHUXVHkB96Fu8rpKZjJITBus4dHavhMyi2-jUrQ5YnAo | |
To claim this, I am signing this object: |