Расскрасим всё поле в два цвета: черный и белый
▒ ▒ ▒ ▒
▒ ▒ ▒ ▒
▒ ▒ ▒ ▒
▒ ▒ ▒ ▒
▒ ▒ ▒ ▒
▒ ▒ ▒ ▒
loop: | |
vsetvli t0, zero, e8, m8, ta, ma # set vl to VLMAX | |
vle8ff.v v8, (a0) # vleff only reads up until the page that is not mapped/demand-paged in. | |
# regular vle8 is unsuitable, because it can give a segfault | |
vmseq.vi v0, v8, 0 # flag null terminator | |
vfirst.m t1, v0 # find first null terminator | |
bgez t1, save_tail # finish if found | |
vse8.v v8, (a1) # store vl bytes (vl can be less than VLMAX) |
var len = 12 | |
var res = await fetch(`https://www.random.org/integers?num=${len}&min=32&max=126&format=plain&base=10&col=1`) | |
var text = await res.text() | |
console.log(String.fromCharCode(...text.trimEnd().split('\n'))) |
There is a flaw in FindGame
request (made by [Assembly-CSharp-firstpass] bgs.GamesApi.FindGame
method).
It’s possible to send FindGame
request with gameAccountId
set to someone’s else game account.
This causes given account to connect to the game that we've you requested.
And if that account is already connected to some other game, it will disconnect from it.
Disconnect is not permanent. Player can reconnect. But if we're disconnecting him every couple of seconds he has no chance.
We can't request a ranked game for given game account because it requires deckId
and we don't know deck ids.
We can't do FindGame
request if we're already in the match.
gameAccountId
:template<class Arg, class Result, class Fn> | |
struct discrete_function { | |
discrete_function (Fn fn, Arg start, Arg end) : fn_(fn), start_(start), end_(end) { } | |
struct iterator : public std::iterator<std::random_access_iterator_tag, Result, Arg> { | |
friend discrete_function; | |
bool operator == (const iterator &other) const { return arg_ == other.arg_; } | |
bool operator != (const iterator &other) const { return arg_ != other.arg_; } | |
bool operator < (const iterator &other) const { return arg_ < other.arg_; } | |
bool operator > (const iterator &other) const { return arg_ > other.arg_; } |
template<typename ForwardIterator> | |
ForwardIterator ternarySearch(ForwardIterator first, ForwardIterator last) { | |
auto count = std::distance(first, last); | |
while (count > 2) { | |
ForwardIterator m1 = first; | |
auto step = count/3; | |
std::advance(m1, step); | |
ForwardIterator m2 = m1; | |
std::advance(m2, step); | |
if (*m1 < *m2) { |