>>> import holdemresources_sevencardeval as handeval
>>> handeval.timedtrials()
133784560 hands counted with for loop in 0.7762000560760498 seconds
133784560 hands counted with for loop in 0.7375249862670898 seconds
133784560 hands counted with for loop in 0.7383525371551514 seconds
...
I’m kind of curious what Numba is actually doing with that code. I copied the code over to Rust, and it took 4.76 s without compiler optimizations, and 19 ms with. Now, 19ms is not enough time to do 10^8 additions, but also much too long to have optimized all the loops down to a single computation. So… kind of talking out of my ass here, but perhaps the inner loop gets vectorized into a single processor operation and the outside loops get flattened. Then you have ~2 million vector instructions plus ~2 million loop iterations, which seems reasonable. If Numba’s compilation time is included in that 216 ms, I would guess it has to be doing something similar and the nested loops are actually not in the final assembly code at all.
Eh it took me about 3 months of 2-4 hours a day to get to alpha, but my game is much more complicated. Prepare for front end code being about 4x the back end code, especially if you don’t need rock solid auth (signups, passportjs) and if you want to trust the client a bit (not recommended). Strongly recommend pure JS stack but of course I would.
Another question is whether or not you want chat. Ironically I went from wanting to be a web game developer to actually being a chat developer, that’s like 80% of what people do, and yeah its solving problems much smarter people have already solved 10x.
If you don’t want auth and chat, its not really that hard. But you will have some trouble getting to hello world.
I haven’t used it, but if you are a C++ programmer you might look at WebAssembly for doing the front-end. I would guess that it would take much longer for development than JS though.
My shit is mostly “card based” as well and I just use react of course and CSS transitions and tranforms, works great. Want it to flip, add a class of “flipped” based off of props, have the CSS do a transform: rotateY(180deg); etc, CSS animations to make it flash/pulse an outline to be clickable or whatever, not super hard but yeah lots of code.
its not really bare bones though, it has an entire production ready build step, typescript support, meow chow. I think eventually (1-2 years) we all start using stuff like snowpack i.e. we get rid of ridiculous webpack/babel transformations and preprocessing and uh… it’ll be down to 100mb.
It’s a) a personal preference, I don’t like vues custom nonsense htmlish attributes, I think jsx works better and b) react has continued to dominate the market and if you want to get paid for this stuff you should almost certainly use react. If not/you just want to get some UI out whatever you know best I’m sure is fine. Jquery!
I started an app, and found that everything was changing between 1 and 2 or maybe it was 2 and 3. The next time I looked into it, like a year later, they were on version 6. It’s like the opposite of python2 4lyfe phenomenon, where the entire world bends over backwards for decades to support the old version.
I have a new one, I wanted to do some logging inside of our top level react error boundary, so I made it call a prop function when the UI gets fucked. I couldn’t test it on localhost so I just assumed I got it right and made a PR and got it merged to master. I somehow confused state and props and the function didn’t exist. So basically when my application crashes, it crashes the crash.
hey, came from the old site tho i had maybe 200 posts over 10yrs, so you guys would not recognize my old name.
anyway, you could look into webGL, specifically, i can vouch for the Unity engine to be a good, performant solution for a game front end. i also checked and it seems unreal can build for webGL too, so this being C++ might be more up your alley. gotta say, C# is kinda neat actually, some nice stuff in there and easy to pick up.
main advantage would be , it’s a breeze to set up a nice UI in your unity project and everything UI will be more-or-less WYSIWYG, plus manipulating objects in your scene, say a shuffle animation or a bet being placed will be much easier. main drawback is prob you dont get to use React (which i agree is cool and v useful). Wouldn’t say the learning curve for Unity or C# is a hurdle, it’s probably an afternoon or 2 of tutorials for what you need.
I recently started a small personal project with Unity webGL and websocket communication to a node backend. it has a long way to go but setting up a basic UI and communication was actually enjoyable. c# has the observer pattern baked in the language via the Event keyword, you can probably guess that’s pretty useful to subscribe listeners to ws messages and such.
Also check out the browser game curvefever, which is made with unity and uses ws communication as well. nothing too impressive but it does manage smooth gameplay and low latency.
One last note is builds will probably rather large and build times long as there’s a couple of steps (i think using IL2CPP and then to wasm). so a card game can get by with just React, but I wouldn’t call it the right tool for anything that’s a game. With Unity or UE for that matter user input is taken care of, you have a physics engine if you’d need one, you could make 3d games, have spatial audio support… and moving “GameObjects” around in a scene seems less convoluted and easier to grasp than css animation imo.
Anyway, if you or anyone else (grue?) is interested, i can elaborate more or share snippets/even the project to get you started. and again, i have used and loved React. for stuff like this, i love anything using webgl more though
Update on my daughter’s memory-matching game. It turns out it was the end-of-semester AP test. (AP is Advanced Placement, for those of us who went to school in the stone age.) Tests are scored on a 1-5 scale, with 3 generally considered a pass, which means many colleges will allow you to skip the 101-type class in that area. She took three AP classes her Freshman year, and three this year (and I think 3-4 honors classes–basically, every class has been honors or AP, except one, which didn’t offer either).
So anyway, she got a 3 on the CS AP project. It might have hurt her score that she followed instructions and noted in the code that @bobman0330 wrote the loop in the code. Her classmates were sure she’d get a 5 because their programs were so simple in comparison. She was bummed but I told her I wouldn’t want her skipping a CS class in college, anyway, because it’s probably going to be such a foundation for anything she does, and a one-semester class in high school–half of which was done through distance learning–wasn’t enough.
She got 5s on both her World History and Physics tests.
IDK about TS but for JS its a big fat no. I had to manually do my own shitty webpack config to make a similar thing hit express i.e. non webpack-dev-server i.e. a real back end. I don’t get why this is not a thing at all and mostly blame abramov.
I think graphql has a bunch of front-end/back-end married packages - some even tied to an ORM. To me that’s the real promise of graphql.
If I have to write a bunch of back-end graphql query handling logic basically from scratch it’s not worth it imo. Might as well just do rest. But if I can get front end all the way to the DB in one package, then I feel that makes sense for some sites.
So I was asked to 1 hr interview 3 candidates for another team this week. Its essentially lead UI - react, etc, team is ~10 people, some backend, basically no other UI people so yeah get out some web app.
We discuss the guy who for sure did the best on the tech questions I threw at him, mostly javascript array stuff, gets a no from the overall team lead because… he didn’t know how to do CI/CD and was weak on “testing”.