Lol not a great name choice. Wish I would have thought of it though.
Lol not a great name choice. Wish I would have thought of it though.
No, I haven’t. He keeps getting away with shit.
I haven’t seen any evidence he will ever face consequences. I hope I’m wrong.
That’s exactly what this is.
Ideally, all of these values should be represented in memory exactly the same way:
That would make the game hard to play, since you’d have to think about where your move would end up since it won’t stay on the cell you click.
I think you’re wanting to store them that way so that you can easily check for win conditions, maybe? But that’s the wrong approach. Store the cells as they appear to the player, in a 2d Array (or 1d Array with indexing math. That’s how I’d do it).
Then you can take advantage of symmetries in your win condition code, if you like. But it really couldn’t be much simpler than counting the matching cells in each row, column, and diagonal. That’s just 8 groups of 3.
Oh I see. I misunderstood the reason for wanting it represented as an int.
I’m wondering if you could just create a wrapper type that only has an int as a member, but then implement a trait on it so that it can act like a result. That, or just pass around your int type in the rust code, and when you need it to act like a result you do a conversion from int to result. Your debugger wouldn’t show it as an int at that point, but it wouldn’t show any other Result as an int anyway so it would br consistent with other rust code. If this still doesn’t work, you could even make a struct that contains both the int and the result and keeps then synchronized. Then, when debugging, you could look into that struct and see the int value like you want.
How are you running the executable? From command line?
Good luck with it. What’s it called?
Well if you want to keep an int as an int, then use an int. If you want to use Results, use results. Like I said to the other commenter: unless this code is in a very tight loop where performance is crucial, you’ll be fine just implementing From/Into to change your Result to and from an int. You’re already crossing a language boundary by calling c code from Rust. Is it that much more of an issue to just convert the types when you need to?
Trying to store the results as an int in some magical way just screams premature optimization. You have abstraction tools at your disposal. They may not be zero cost, but they are cheap. Use them.
Gotcha. I unfortunately decided to give up on trying to do this in Rust. I’m trying out JUCE since it’s industry standard. I’m already bashing my head against the wall with this C++ garbage. Hopefully the gui scene looks better for rust soon
For real. Unless he’s converting between results and ints millions of times a second, I think he’s going to be just fine using the idiomatic solution. That transmute shit I’d wack lol
So what! Who cares if it’s free? Write first, profile and optimize later. Not everyone cares about whether the conversion is free. Simply matching and converting to the right integer is fast enough.
Unfortunately, you are correct. We’re doomed.
I once saw a comment where a guy said that before the internet, if someone wanted to fuck toasters and told anyone, he would be shamed and made fun of to the point where he’d never bring it up again.
With the internet, if someone wants to fuck a toaster, they can go online and find a while community of people who also enjoy fucking toasters, complete with guides and recommendations on the best toasters to fuck.
Its absurd, but it illustrates a great point. So yeah, we are fucked. Pandoras box is open.
Agreed. I also believe we should all stop showing up for work until we are guaranteed health care, a living wage, and reasonable housing prices. We shouldn’t contribute to system that works against us.
Everyone I know has to work multiple jobs and have roommates to be able to afford housing. What is this free time you speak of?
No. The divide between the rich and everyone else is growing. We will be able to afford less and less.
We shame them for being shitty. Don’t engage them in debate, they are used to that. Don’t try to use facts, because they don’t care about facts. Don’t try to convince them of shit.
Make them feel like outcasts and bad people. Brush off what they say when they say horrible shit. Make them have emotional responses to their shitty views. Conservative news targets these people by exploiting their emotions.
And vote. Vote for people who will fix our education system so that our next generation knows how to think for themselves.
That money goes to administrators instead of teachers.
Yep. He is who the U.S. has become. We are an embarrassment.
I deleted my 14 year old reddit account when they pulled their shit. Then I recently created a new account because I need to be able to get answers to specific programming questions sometimes, and lemmy doesn’t have the population of users that reddit still has. I generally post on both lemmy and reddit, but I almost always get more answers on reddit.