Join us on Discord!
You can help CodeWalrus stay online by donating here.

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Snektron

Quote from: c4ooo on August 17, 2017, 02:15:48 PM
Quote from: Juju on August 17, 2017, 05:22:51 AM
Depending of the language you use, it is possible to check if your integer is an integer. As in, you can cast your float into an int, if it didn't lost information it's an integer.
Yep. In a float, the first byte is almost always a signed exponent, so as long as it is >=0 its an integer (unless I got something mixed up). This should be useful if someone does the challenge in assembly.

thats not true, because the mantissa (other part of the float) is a fraction part: (1/16 + 1/8)*2^3 is 1.5, but it still has a positive exponent.
Instead you could check if the mantissa is clone enough to zero: if its smaller than 0.00001 for example is probably an integer. I think most is_integer() functions will work this way.

My solution actually uses this:
#define mainImage(O, U)O+=sign(fract(length(U-.5)))
O is the output color, U is the input coodinate plus 0.5. length() is just sqrt(U.x*U.x + U.y*U.y).
fract takes the fraction part of the float (the mantissa). Sign(x) returns -1 if x < 0, 0 if x == 0 and 1 if x >0. I think the sign function internally also compares x to some small value.
you havent updated the standings yet, juju

#define mainImage(O, U)O+=sign(fract(length(U-.5)))

50 chars / 51 bytes
view live on ShaderToy
its bigger than 64x96 though so you'll just have to resize your browser.
Other / Re: Your post/coding Milestones!
August 16, 2017, 11:07:23 AM
hes onto me :ninja:
Really starting to shape up! nice work ;)
Does the project builder support non-ez80 / non-ti targets too? just wondering.

Also, an idea might be integration to some kind of versioning like overleaf does. (You can edit LaTeX and host the project on github.)
I actually got everything from the SDK to work, even the tool that converted a folder structure into a knightos filesystem. It took a damn amount of research to find out how to tell if a folder is a symlink in windows <_<. I dont think i ever pushed it though...
Quote from: Streetwalrus on June 28, 2017, 08:59:00 PM
Quote from: _iPhoenix_ on June 28, 2017, 04:44:17 PM
I use GIMP, it's very nice, overly powerful, super redundant, and just plain overcomplicated (for what I use it for, at least) in an awesome way.
I second this. GIMP is WAY beyond overkill for simple sprites but I still like using it.
I dont. Its learning curve is way too high to use it for small edits to images i usually make.
I like digital copies more because
1) i can get games instantly
2) i can pirate games
3) some games aren't even sold physically
4) how do they even get 40 GB games on disks nowadays? im not really in the mood for using 8 installation disks
5) also i feel like they tend to be cheaper.
That backend finally works? Sweet...
Reminds me of the stuff i did during school. My calculator would often get confiscated by my physics teacher, which resulted in me talking with other students instead of minding my own calculator business. Not a smart move on her part ;D
Wans't there a walrii 3d model? that seems like a good main character  ;)
Quote from: DJ Omnimaga on May 03, 2017, 04:40:20 AM

In addition to that, I've kind of transitioned to a new social life over the years and the transition shall be complete in a not so distant future

Will you come out of your cocoon and emerge as a majestic butterfly?
There should be some whay that points automatically replenish. Also maybe some way to encourage giving points? (its not like the karma system is really used which is basically the same thing)
if you still run 32-bit you must have not upgraded since 2007
Using wabbitemu's debugger i found this disassembly:

ld a, l
ld a,h
ld hl, 0x88B0

Powered by EzPortal