|
wavefront is a thing
|
# ? Oct 4, 2015 16:19 |
|
|
# ? May 26, 2024 23:44 |
|
jony ive aces posted:so is "wavefront" an established term for a breadth first search or is it just that one guy's blog I... don't know?
|
# ? Oct 4, 2015 16:22 |
|
Bloody posted:wavefront is a thing
|
# ? Oct 4, 2015 16:48 |
|
I just wanted to say i figured out my problem as I was trying to ask about it here
|
# ? Oct 4, 2015 19:30 |
|
vodkat posted:I just wanted to say i figured out my problem as I was trying to ask about it here i know you might feel like a terrible programmer for doing this but seriously, this is entirely routine for me (well more on stack overflow than here but still)
|
# ? Oct 4, 2015 19:51 |
|
i think every coder rubber ducks sometimes!
|
# ? Oct 4, 2015 20:04 |
|
Bloody posted:wavefront is a thing Alias|Wavefront
|
# ? Oct 4, 2015 20:14 |
|
I wonder if SO tracks how many times people hit "new question", type out a bunch of poo poo into the text box, then close the tab
|
# ? Oct 4, 2015 20:53 |
|
i asked about doing permutations using recursion on snackoverflow once and no one seemed to understand what i was talking about
|
# ? Oct 4, 2015 22:42 |
|
Dessert Rose posted:I wonder if SO tracks how many times people hit "new question", type out a bunch of poo poo into the text box, then close the tab saves the mods the trouble of closing the question
|
# ? Oct 4, 2015 23:02 |
|
Dessert Rose posted:I wonder if SO tracks how many times people hit "new question", type out a bunch of poo poo into the text box, then close the tab do you mean like facebook statuses?
|
# ? Oct 5, 2015 00:05 |
|
"hmm maybe the world doesn't need to know about the huge dump i'm taking" -- applies to facebook and stackoverflow equally well
|
# ? Oct 5, 2015 00:50 |
|
crazysim posted:do you mean like facebook statuses? yeah, i know fb does it, but id like to see stats for so
|
# ? Oct 5, 2015 01:11 |
|
I have this F# program:code:
|
# ? Oct 5, 2015 02:36 |
|
Luigi Thirty posted:I have this F# program: probably because make random card is a variable and not a function. put parentheses after it so that it takes a unit as input and returns a new playing card every time. same with deal hand
|
# ? Oct 5, 2015 02:40 |
|
also I'd do the whole thing in a more functional style and throw in some discriminated unions
|
# ? Oct 5, 2015 02:42 |
|
Luigi Thirty posted:I have this F# program: you are calling rnd.next once when it is passed as a parameter to the delegate.
|
# ? Oct 5, 2015 02:42 |
|
like i think your program would be much simpler if used types like these and don't even bother with making "classes" that have to be instantiatedcode:
|
# ? Oct 5, 2015 02:55 |
|
also you probably want to generate a sequence or list of all possible cards, also known as the deck, and randomly draw from that. otherwise you could end up dealing the exact same card more than once. that'd be awful
|
# ? Oct 5, 2015 03:16 |
|
Dessert Rose posted:I wonder if SO tracks how many times people hit "new question", type out a bunch of poo poo into the text box, then close the tab to be fair, the automatic "similar question" search results from the Ask Question window can be / are usually more relevant than the google results
|
# ? Oct 5, 2015 11:00 |
|
AWWNAW posted:also you probably want to generate a sequence or list of all possible cards, also known as the deck, and randomly draw from that. otherwise you could end up dealing the exact same card more than once. that'd be awful I haven't gotten that far yet when I wrote this on my microcontroller to save memory I drew random(0, 51) and compared it to each of the hands until there were no duplicates
|
# ? Oct 5, 2015 14:39 |
|
god i'd hate to live in a world where having a single array of 10 vs 50 ints was a concern. it's not like you're running thousands of these in parallel
|
# ? Oct 5, 2015 14:46 |
|
Luigi Thirty posted:I haven't gotten that far yet ah good, the possibly-never-halting implementation probably ok if you only ever have 10-15 cards out at once though
|
# ? Oct 5, 2015 17:46 |
|
but really an entire deck fits in 52 bytes. 26 if you want to try and pack them into ... words? words are 4 bits, right?
|
# ? Oct 5, 2015 17:48 |
|
I'm pretty sure the code to iterate all the cards already dealt is larger than the size of the deck array would be
|
# ? Oct 5, 2015 17:49 |
|
I used the seven card Charlie rule to make sure that wouldn't happen also yes storing the deck would probably be easier
|
# ? Oct 5, 2015 17:49 |
|
Dessert Rose posted:but really an entire deck fits in 52 bytes. 26 if you want to try and pack them into ... words? words are 4 bits, right? nibbles are 4 bits I think
|
# ? Oct 5, 2015 18:07 |
|
meatpotato posted:hi(g_pTerrible_programmers); save a ton of money until you can do that or support yourself for a couple of years while you try
|
# ? Oct 5, 2015 18:38 |
|
meatpotato posted:hi(g_pTerrible_programmers); get out and meet a bunch of people at meetups
|
# ? Oct 5, 2015 18:43 |
|
Dessert Rose posted:but really an entire deck fits in 52 bytes. 26 if you want to try and pack them into ... words? words are 4 bits, right? 7 bytes if you just use bit flags, can't shuffle it but if you're already looping to check for duplicates Lime fucked around with this message at 18:58 on Oct 5, 2015 |
# ? Oct 5, 2015 18:55 |
|
Lime posted:7 bytes if you just use bit flags, can't shuffle it but if you're already looping to check for duplicates you could represent the deck in 6 bytes for dealing the cards, but you'd still need a separate data structure for representing an individual card, or a hand of cards. a single card takes 6 bits, a hand of 2 cards could be represented in 11 bits, a hand of 5 in 22 bits. Jerry Bindle fucked around with this message at 20:51 on Oct 5, 2015 |
# ? Oct 5, 2015 20:35 |
|
Dessert Rose posted:I wonder if SO tracks how many times people hit "new question", type out a bunch of poo poo into the text box, then close the tab gotta be a lot. i get notifications whenever a question is posted with our tag and like 10% of questions are already deleted when i click on it a minute later
|
# ? Oct 5, 2015 21:13 |
|
Barnyard Protein posted:you could represent the deck in 6 bytes for dealing the cards, but you'd still need a separate data structure for representing an individual card, or a hand of cards. a single card takes 6 bits, a hand of 2 cards could be represented in 11 bits, a hand of 5 in 22 bits. profligate wastrel. you can represent the entire game in 52 * log (N + 2) bits where N is the number of players. use bit flags to mark whether each card is in the deck, in the discard pile, or in a given player's hand
|
# ? Oct 5, 2015 21:16 |
|
NihilCredo posted:profligate wastrel. you can represent the entire game in 52 * log (N + 2) bits where N is the number of players. use bit flags to mark whether each card is in the deck, in the discard pile, or in a given player's hand
|
# ? Oct 5, 2015 21:23 |
|
I made an Atari breakout clone years ago. the secret trick I had to save ROM space was that when the level was drawn, it was made using background tiles. a row was 8 bits long but 12 bricks wide. the level data was fed from the ROM into the TIA as background tiles so I mirrored the background at exactly the right time that the left third of the level mirrored the right third. then you do the mirror in software when copying the brick bitfields into RAM and you've saved 24 BITS PER LEVEL of ROM space (6 rows of 8 bricks instead of 6 rows of 12 bricks) and your level fits cleanly into 6 bytes of RAM I never wrote enough levels for this to make any difference whatsoever because the core game logic was 1.5kb and my compiler did 4kb cartridges anyway
|
# ? Oct 5, 2015 21:37 |
|
design is hurting my head because i AM making a card game and have my cards neatly made and loaded and everything in the domain with their behavior but they also have to be in the UI for display and they all have the same everything but also exactly one additional attribute in the constructor (the location of the loving card's image) and i really don't like it at all because knowing when to separate logic from UI is retarded and stupid....... sometimes
|
# ? Oct 5, 2015 22:50 |
|
the worst part is the game is conga. a game exactly 0.1% of the world play or know. a game i understand but have never played because it's a stupid rear end card game
|
# ? Oct 5, 2015 22:51 |
|
don't worry about the API design, how many bytes does the card model consume?? j/k API design is hard. you could implement it using two interfaces: one that deals with the logic, and another that cares about the view. the instances of the concrete class realization of those interfaces would combine the two, but the methods that operated on the logic and the view would be separated.
|
# ? Oct 5, 2015 23:05 |
|
still trying to come up with questions to ask people to find out if they know how to program good
|
# ? Oct 5, 2015 23:22 |
|
|
# ? May 26, 2024 23:44 |
|
eh it's all design. it's assumed we already know everything about the language itself already. efficiency is left for the algorithms and data structures class. not a care in the world here, though i know you're joking but yeah it's both cool and terrifying working with observer and facade and so many other patterns in conjunction for the first time. it's like i worked with mvc by complete accident with c# at this point. however my one project partner just literally broke his right (good) hand punching a wall out of gayness. so that leaves 4 simultaneous projects almost up to just me and it's slowly creeping up to "a lot of stuff." this is me venting on the yos. i prolly posted that already somewhere but come on. how do you break your loving hand. PLS
|
# ? Oct 5, 2015 23:23 |