且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

需要有关项目的想法和见解......

更新时间:2022-11-16 08:51:38


我们有75个球对象,可以由机器随机挑选,因此需要意识到被选中(),因为在比赛中没有球可以出现两次。



实际上,我认为机器是有问题的对象,并且球是它所不具备的数据。机器(对象)有更好的机会来封装已经分配的数字而不是球的意识。


我们有一个25分的记分卡网格它上面的正方形对象,以及网格中每列的适当值(B:1-15,i:16-30等),这些值在每张卡上随机选择。如果我们使用所有75个可能的数字(可能不是***的方法),每个数字需要知道它是否在这个游戏的宾果卡上,是否与已经被挑选的数字相匹配( ),以及它是否是免费赠品(卡上的中间方块 - ''免费''而不是数字)


初步问题:


可以通过某种机制对对象进行分组,以便更改外部参数使它们响应该更改,或者每次都需要对它们进行迭代/操作以使其成为意识到的对象。全球变化?例如,拾取一个数字() - 正方形知道可以如果一个匹配新号码,或者我是否需要触发每个号码进行检查?



我在这里有类似的想法。去寻找一些例子


也许我在想更多的并行线程模式,每个对象一个线程,它仍然是 ;有源"在比赛期间。是那样的吗?无论如何,现在可能已经过了我的脑袋。


把我卷进去;告诉我你的想法。



你有Robin Dunn的书:wxPython在行动吗?



实际上,我认为机器是有问题的对象,并且球是它所不具备的数据。机器(物体)有更好的机会封装已经分配的数字而不是球的意识。



我有类似的想法这里。去寻找一些例子



你有Robin Dunn的书:wxPython in Action?



我还没读完所有内容,只是看了几件事。


我不是真的特别感兴趣的是GUI,更多的逻辑。如果GUI对象比抽象代码项更容易构建/附加,那就没问题。


作为对象的球而不是机器的原因是我想要的在行动中运用多个相同的对象。 JFYI。

I would like to solicit your thoughts and ideas (code can come later) about how you would approach a project idea I just tossed together. I chose this as a testbed for me to play with objects, specifically multiple instances of a few specific objects, and as I thought about it, it raised a lot of questions about how to manage, contain, signal all of those objects that do almost the same thing at the same time.

I want to build an OO bingo simulator. While it is not necessarily the most efficient approach, let''s academically assume it needs to be object-oriented.

We have 75 ball objects, which can be picked randomly by a machine, and which therefore need an awareness of being picked(), since no ball can come up twice in a game.

We have a scorecard grid with 25 square objects on it, and appropriate values for each column of the grid (B: 1-15,i:16-30, etc.), which are chosen randomly on each card. If we work with all 75 possible numbers (maybe not the best approach), each number needs to know if it''s on the bingo card for this game, whether it''s matched a number that''s already been picked(), and whether it''s a Freebie (middle square on the card - ''FREE'' instead of a number)

Initial questions:

Can like objects be grouped by some mechanism such that changing an external parameter has them respond to that change, or do they each need to be iterated/manipulated each time to become "aware" of global changes? For example, a number is picked() - can the squares "know" if one matches the new number, or do I need to trigger each one to check?

Maybe I''m thinking in more of a parallel-thread mode here, one thread per object, which remains "active" during the game. Is that way out there? It''s probably over my head at this point anyway.

Reel me in; tell me what you think.

We have 75 ball objects, which can be picked randomly by a machine, and which therefore need an awareness of being picked(), since no ball can come up twice in a game.

Actually, I believe that the machine is the object in question and that balls are data that it dispences. The machine (object) has a better chance of encapsulating awareness of which numbers have been dispensed than a ball does.

We have a scorecard grid with 25 square objects on it, and appropriate values for each column of the grid (B: 1-15,i:16-30, etc.), which are chosen randomly on each card. If we work with all 75 possible numbers (maybe not the best approach), each number needs to know if it''s on the bingo card for this game, whether it''s matched a number that''s already been picked(), and whether it''s a Freebie (middle square on the card - ''FREE'' instead of a number)

Initial questions:

Can like objects be grouped by some mechanism such that changing an external parameter has them respond to that change, or do they each need to be iterated/manipulated each time to become "aware" of global changes? For example, a number is picked() - can the squares "know" if one matches the new number, or do I need to trigger each one to check?

I''ve got similar thoughts here. Going to look for some examples

Maybe I''m thinking in more of a parallel-thread mode here, one thread per object, which remains "active" during the game. Is that way out there? It''s probably over my head at this point anyway.

Reel me in; tell me what you think.

Do you have Robin Dunn''s book: wxPython in Action?


Actually, I believe that the machine is the object in question and that balls are data that it dispences. The machine (object) has a better chance of encapsulating awareness of which numbers have been dispensed than a ball does.



I''ve got similar thoughts here. Going to look for some examples



Do you have Robin Dunn''s book: wxPython in Action?

I haven''t read it all, just looked up a few things.

I''m not really interested in the GUI in particular, more the logic. If the GUI objects are easier to build/attach to than abstract code items, that''s fine.


The reason for the balls, instead of the machine, as objects is that I want to exercise multiple identical objects in action. JFYI.