You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server
Administration Center

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.

Messages - Snektron

#1
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.
#2
you havent updated the standings yet, juju
#3

#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.
#4
Other / Re: Your post/coding Milestones!
August 16, 2017, 11:07:23 AM
hes onto me :ninja:
#5
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...
#6
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.
#7
Wans't there a walrii 3d model? that seems like a good main character  ;)
#8
if you still run 32-bit you must have not upgraded since 2007
#9
Non euclidean, but yes
#10
PC, Mac & Vintage Computers / Re: Programming Ideas
March 25, 2017, 02:47:46 PM
I don't know if you can at the moment, what with the 2048 bit rsa key and all. Not sure if that only applies to apps though.
#11
I made a nice raycaster a while back: https://github.com/QuantumInfinity/AntiCaster It needs some updating though, since i could optimize out a square root.
Also i should change to a better build system than eclipse project builder... IF i ever get around to it. Anyway maybe you could learn something from the source, though its probably quite complicated and
not very well commented (read: not at all).
#12
Randomness / Re: Forum Game: Counter!
March 23, 2017, 09:14:17 PM
Hang on, what happens if you don't post anything related to your posts number? (Also: you broke your own rules by posting more than twice this week ;))
#13
Randomness / Re: Forum Game: Counter!
March 23, 2017, 08:51:57 PM
Well it didn't take long for you guys to lose track of the count.
Also i am 10 because i have a 10 inch c
#14
I thought konami was doomed since they stopped making that silent hill game.
#15
Really cool! I wonder if someday there'll be a 3D plotter that uses this. It seems the perfect base.
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal