Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
done
Can't edit top post now, the structure guidelines are here: https://docs.codewars.com/authoring/guidelines/description#structure
This comment is hidden because it contains spoiler information about the solution
noItemsJustMoreTimesDeclared
andsomeNoValuesAsWellAsSomeHaveValuesAssigned
are expecting incorrect resultsSome possible improvements
More comments in spoilered comment below:
The way
AtomicU32
is used here doesn't make sense. Usingstatic mut
in multiple threads without other synchronization is straight up undefined behavior, andget_mut
completely defeats the purpose of atomics in the first place.static TESTCHECK: AtomicU32 = ...
andfetch_add
is probably what was intended. See: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU32.html#method.fetch_addAnyone reading, feel free to continue discussing, but since this has nothing to do with improving the kata I'm marking this as resolved.
I suppose a slightly more detailed explanation is in order. Neither of the two changes the resulting binary at all; it's purely an aesthetic concern.
For the
and
/andi
one, yes the assembler is being permissive here.For the
li
one...The compressed instruction extension has 16-bit versions of
c.mv
andc.li
. However, the source ofc.mv
cannot bex0
/zero
. The assembler here helpfully transformsmv a0, 0
intoaddi a0, zero, 0
then intoc.li a0, 0
, but I'd wantli
here to remind us that this is closer to how the instruction gets encoded.Nothing really I'd say is wrong here, but some nitpicks:
and t0, a0, 3
andand t0, t0, 3
:and -> andi
mv a0, zero -> li a0, 0
(twice)This comment is hidden because it contains spoiler information about the solution
TODO:
getrandom(2)
See test cases for https://www.codewars.com/kata/636b75101b60ba002e3953e2
TODO:
getrandom(2)
See test cases for https://www.codewars.com/kata/636b75101b60ba002e3953e2
TODO:
getrandom(2)
See test cases for https://www.codewars.com/kata/636b75101b60ba002e3953e2
TODO:
getrandom(2)
See test cases for https://www.codewars.com/kata/636b75101b60ba002e3953e2
TODO:
See test cases for https://www.codewars.com/kata/636b75101b60ba002e3953e2
I've found a standard way to represent (real) floating point values exactly — hex float literals. Can you go over this fork and see if it's satisfactory?
https://www.codewars.com/kumite/6512e3e65bf8500b9aa77a33?sel=6512e3e65bf8500b9aa77a33
Loading more items...