« first day (422 days earlier)      last day (669 days later) » 

12:03 AM
@ThePhD Can you get the main.cpp file to compile?
 
user3010322
@Rapptz I don't see the repository.
 
user3010322
Oh well, I can just punch in the URL directly.
 
user3010322
Compiles until I get errors for SFML.
 
user3010322
Guess I'd better figure out where to put SFML.
 
1:03 AM
:v
 
user3010322
@Rapptz Don't look at me like that!
 
smh
 
user3010322
Huff.
 
user3010322
If you want to start on the game, you can. I'm already fishing through SFML and trying to get set.
 
I see.
I'm making pasta.
 
1:12 AM
so.. I was thinking... this might be a neat syntax for arrays
int[3] arr1 = { 0, 2, 4 };
int[]* arr2 = new int[3];
int[]& arrref = arr1;
but idk how i would handle stack arrays whose size is infered from the init list
int[auto] arr = { 0, 1, 2, 3 }; feels dumb
 
int[] arr1 = { 0, 2, 4 }; is currently unambiguous.
 
oh right, i didnt think about that
cool :)
having arrays that dont decay to points should also remove the need for delete[]
 
delete[] is there for other reasons.
 
I recall reading that delete[] was added because trivial types stored information differently so you had to differentiate.
It's probably wrong though considering I can't find it
 
1:19 AM
i always assumed delete[] was there because if you called it on a pointer it could be ambiguous whether youre trying to delete the first thing in the array or the whole array
 
it's undefined behaviour to use delete x; when x is an array
so I'm guessing they went through the trouble of two operators for a reason
 
user3010322
Yes. One is meant to delete arrays and the other isn't. <_>
 
user3010322
But delete only took a pointer.
 
user3010322
Because [Silly Reasons Here].
 
well considering the implementation seems... aware that x is an array...
I'm not sure that's a good reason
 
user3010322
1:22 AM
The implementation doesn't have to know.
 
user3010322
delete x where x is an array can just delete the first element like it really is a pointer.
 
user3010322
And then leave the rest untouched and dangling in memory.
 
user3010322
Implementations build in checking because life is hard.
 
in my language arrays do not decay to pointer so this is not a problem
if delete gets int[]* it deletes the whole shebang
 
91
Q: How does delete[] know it's an array? (C++)

GRBAlright, I think we all agree that what happens with the following code is undefined, depending on what is passed void deleteForMe(int* pointer) { delete[] pointer; } The pointer could be all sorts of different things, and so performing an unconditional delete[] on it is undefined. Howeve...

 
user3010322
1:23 AM
Yay, type-safety!
 
also youll be able to get the arrays length
because fuck containers that dont know how many elements they have =/
@ThePhD I'm also doing that for clarity. I mean, how many times have you seen a question on SO where OP thought pointers and arrays were ~~the same thing~~
 
user3010322
type-safety best safety
 
@ThePhD tbh my biggest issue is with starting
I'm not very good at it
 
1:39 AM
I should do pushups, but... idk, i dont feel like it today =/
 
2:37 AM
I'm bored.
Today was so unproductive.
I don't think I did anything at all.
Such a waste of oxygen.
 
user3010322
We decided on tech and got the repo set up. :3
 
smacks
Nothing I say.
:v
 
user3010322
I think that's something. c:
 
user3010322
Meanwhile, I'm trying to figure out why my barycentric coordinates are so TERRIBLE JESUS CHRIST.
 
I have a script that generates repositories.
I literally typed make_ninja args
:v
 
user3010322
2:40 AM
Lol.
 
TeamCity is giving me trouble.
look at this
how do I fix it so it actually builds
I looked it up online and they were like "hurr durr make a VCS trigger"
well I have one already
This might be the most bored I've ever been in my life.
If I die, it's because of over-boredom.
 
if this was a guy that's be pretty much me right now =/
 
That guy is a SJW.
 
i meant the first 3 panels
 
I meant his comics in general. Not this one per se.
 
2:52 AM
oh
 
They get posted on TiA and 4chan and ridiculed every time.
 
3:09 AM
 
3:20 AM
That person makes a lot of perverted gamer comics.
:p
 
yes
 
I only know these comics because people shitpost them on 4chan.
 
3:31 AM
Still bored ._.
> ericniebler pushed to master at ericniebler/range-v3
Eric Niebler f246c08
oops
nice commit message
 
3:54 AM
RIP me
Died of boredm
19XX - 2014
 
user3010322
Lol
 
user3010322
Why don't you start on the game? :3
 
3 hours ago, by Rapptz
@ThePhD tbh my biggest issue is with starting
 
user3010322
4:10 AM
@Rapptz Guess I'll have to start us off, then.
 
user3010322
Hm.
 
4:31 AM
So start us off sempai.
 
user3010322
Hold on.
 
user3010322
Trying to figure out why I'm not getting the right contact point. :c
 
I see.
 
user3010322
Ugh
 
user3010322
Jesus fuckin' christ it's just
 
user3010322
4:37 AM
It's just so broken, oh whatever.
 
?
 
user3010322
I don't know.
 
user3010322
It doesn't matter. I'll fix it later...
 
user3010322
4:11 PM
@Rapptz Hey, I've been spending a lot of time brainstorming.
 
user3010322
About like, themes for the game and stuff.
 
user3010322
And I wanted to try making a game that actually emulates different kinds of programming practices.
 
user3010322
And programming techniques
 
user3010322
and language features and stuff.
 
user3010322
So, for example...
 
user3010322
4:18 PM
You're standing on one platform.
 
user3010322
There's a really large abyss in front of you.
 
user3010322
With spikes at the bottom.
 
user3010322
And lava at the bottom.
 
user3010322
(Spikes first, then runs off into burning lava).
 
user3010322
At the other side of all this is a steep cliff with a door/portal/whatever that leads you to the other side.
 
user3010322
4:23 PM
Where you need to go*
 
user3010322
And, the way it works is that you jump from your side of the cliff down, towards the spikes
 
user3010322
you're plummeting, plummeting, etc. etc. until you begin a try { } block
 
user3010322
Now, when you hit the spikes, your death is caused by the spikes so you get a SpikeException (or w/e)
 
user3010322
But since you have a try {} block, and since you've progressed far enough through the adventure to get the catch ( SpikeException ) handler, you can survive one SpikeException and respawn back where you initially laid the try{} block instantaneously. It will also refresh certain things like your jumps.
 
user3010322
As you go through your adventure, you can collect various exceptions that will immune you to certain environmental hazards, and if you go far enough you'll get the catch-all block (catch ( ... ) {}) that can handle any kind of death, so long as you try{}
 
user3010322
4:28 PM
It's a different kind of unlock-the-area and traversal mechanism.
 
user3010322
It shouldn't preclude the other things, but I think it's a nice idea.
 
6:45 PM
@ThePhD Why would you throw an exception for that?
 
user3010322
@Rapptz That's just a visualization of the programming concept.
 
user3010322
We're not actually throwing an exception.
 
user3010322
It's just a chaining mechanism.
 
I see
 
user3010322
So if you specifically use the try{} at hte right point
 
user3010322
6:52 PM
you can use it to spawn back at the try{} point and then use your refreshed jumps to go further than before.
 
user3010322
Or higher or lower etc etc.
 
user3010322
Does that make sense?
 
Not really, no.
I get the fundamental concept
but try-catch is weird
 
user3010322
I just wanted it to be similar to programming concepts.
 
user3010322
But there's other ways to name the thing.
 
user3010322
7:03 PM
Well, it doesn't matter what hte concept is called because we still need to get started!
 
user3010322
Yaaay!
 
yay
Sorta unrelated but
What do you think of this
Everything is already under a sub-namespace :v
that's just how it is!
 
user3010322
BREAK THE CONVENTIONS.
 
user3010322
SHAKE THE MOOOOOULD
 
So what's next?
 
user3010322
7:16 PM
Well.
 
user3010322
We need to make a thing where we have a box that can move over stuff
 
btw
Do you want to use Sky?
 
user3010322
For the UI?
 
Sky doesn't have UI.
 
user3010322
Oooh. I had conflated my repos.
 
user3010322
7:20 PM
So just use Sky in concert with SFML. Yeah, sounds like fun.
 
ahahahaha xD
 
template<typename T>
constexpr T pi() noexcept {
    return 3;
}
:v
 
user3010322
Where... the hell is that?
 
My code
 
user3010322
:v
 
7:24 PM
it's specialised for floating point types
so that looks weird out of context
 
user3010322
Works for everything, no specializations required?
 
Ab workout done for today
 
@ThePhD Hmm..
> 0X1.921FB54442D18P+1 - 0X1.921FB54442D18P+1
It seems you are correct.
 
user3010322
@Rapptz What does that even mean.
 
7:35 PM
hex representation of a double
P+1 is exponent
basically I'm just passing printf("%A %A", manual, yours);
 
user3010322
Yay.
 
still doesn't feel right though
 
7:54 PM
Well I did some Extensive Testing™
Seems there's no loss of precision at all.
Even if you travel round a bout.
 
user3010322
Show me!
 
I just did it on Coliru :v I have no link to show you except my scrap
 
user3010322
Oh.
 
8:16 PM
@ThePhD let's get start sempai
 
user3010322
How are we going to pull Sky in?
 
submodule
 
 
1 hour later…
9:39 PM
template<typename T>
constexpr T area(T radius) {
    return math::pi<T>() * radius * radius;
}

int main() {
    static_assert(area<double>(4) == 50.26548245743669, "...");
}
why is it so accurate :v
what is this black magic
 
user3010322
constexpr
 
what does constexpr have to do with it?
if I assign it to a regular double it still has the same accuracy :v
 
user3010322
I meant in general.
 
user3010322
The compiler can carry the precision all the way through. And when it does ==, it will do the comparison by making both doubles.
 
magic
So are we starting? :v
 
user3010322
9:46 PM
Yes.
 
user3010322
But!
 
user3010322
Before we do, I want to create a fixed-precision digit type.
 
that has been on my todo list for like 2 years
there's a reason it's still there :v
 
user3010322
Well, time to get on it then. :D
 
user3010322
How hard it could it be, anyhow?
 
9:47 PM
well
pretty hard
could probably get more progress done with the game than that
anyway I put it on my backburner for another reason
It already exists in the standard library
 
user3010322
Seriously?
 
std::decimal::decimal64 and std::decimal::decimal128.
I don't know when it's getting the definite add though.
It's been in GCC for like 5 years though.
Unless.. you meant fixed-precision for integers :v
it took me 6 months to come up with a division algorithm
maybe a little bit more I don't remember
I went through at least 15.
So my only tip is: Don't do it.
 
user3010322
I meant
 
user3010322
fixed-precision for integers, yes
 
user3010322
Not Variable-precision
 
9:52 PM
yeah, took forever.
 
user3010322
It uses the same operations are regular integers under the hood
 
in order to have fixed-precision that is specified you're gonna have to cut corners
 
user3010322
Cut corners?
 
yeah
it's really hard to generalise division and multiplication for a specified fixed precision
 
user3010322
Dude, I mean doing something like...
 
9:53 PM
you can do int128 with two int64s
 
user3010322
fixed<int32, 30, 2> // 0, 0.25, 0.50, 0.75, 1.00, ...
 
man
that's lame
even for my standards
:v
 
user3010322
It provides fast integer math with some usage of decimals.
 
user3010322
It's also entirely stable and introduces no errors.
 
I don't even know what the 30 and 2 mean
 
user3010322
9:54 PM
30 bits for non-fractional, 2 bits for fractional
 
that's no longer an integer
 
user3010322
It is exactly an integer.
 
not really :v
that is a custom floating point
 
user3010322
When you multiply, divine, add, or substract two fixed<...>
 
user3010322
All you need to do is add the internal integers together
 
user3010322
9:55 PM
or subtract
 
user3010322
or whatever.
 
How is this any different
from
x * 100
or well, x * 10^n
 
user3010322
x * 2 ^ n
 
user3010322
basically.
 
user3010322
But yes, that's the whole point.
 
9:57 PM
lame even by my standards
:v
well okay
 
user3010322
The whole point is that math is FAST (it's all integers) and all of the operations are stable.
 
user3010322
E.g. there's no NaN, INF, etc.
 
user3010322
It's just overflow underflow.
 
at least prevent that
mr. stable
 
user3010322
You can build that into the class if you really want to
 
user3010322
9:58 PM
fixed<uint32, 30, 2, on_underflow, on_overflow> if you REALLY want to.
 
user3010322
But, meh.
 
user3010322
You're right that it's probably not even necessary.
 
user3010322
Can do it later.
 
my documentation looks so pretty
:d
I'm satisfied
 
user3010322
Lol.
 
user3010322
10:02 PM
Docs are for squares.
 
I don't know how to test these constants
I'm not sure I really want to
there are 12 of them
 
user3010322
Do you really have to?
 
I add tests to (mostly) everything.
The code base is sorta big.
 
user3010322
Mmm.
 
issue is idk how to test them
I'll ignore the tests for now and just trust they're right :v
anyway let's get started
 
10:19 PM
According to my todo list
the only thing left for math is an is_prime function
Apparently I implemented it like this eons ago.
bool isPrime(ullong n) {
    if(n == 1)
        return false;
    else if(n < 4)
        return true;
    else if(n % 2 == 0)
        return false;
    else if(n < 9)
        return true;
    else if (n % 3 == 0)
        return false;
    else {
        ullong r = floor(sqrt(static_cast<double>(n)));
        ullong f = 5;
        while (f <= r) {
            if (n % f == 0) {
                return false;
                 }
            if (n % (f+2) == 0) {
                return false;
                }
 
user3010322
@Rapptz is_prime! D:<
 
I already have a prime generator
i.e. a sieve
that is pretty fast :v
I used it for all my project euler problems so I know it's Fast™
 
user3010322
is_prime_fast™
 
user3010322
 
That isPrime up there is pretty fast though
decently fast anyway
it's better than the shitty one where you loop until sqrt(x)
 
user3010322
10:26 PM
Lmao.
 
user3010322
10:38 PM
Okay.
 
user3010322
I really should push these changes and not touch anything and get to work with Sky and Platformer
 
user3010322
ALRIGHTY
 
user3010322
@Rapptz Not going to sub-module Sky into Platformer yet?
 
I didn't do anything.
 
10:56 PM
So what are we gonna do? @ThePhD
 
user3010322
11:48 PM
Start by implementing states. Deciding what entities we should have and what they do.
 

« first day (422 days earlier)      last day (669 days later) »