IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++/CLI Discussion :

Programmation Objet - boulier chinois


Sujet :

C++/CLI

  1. #1
    Invité
    Invité(e)
    Par défaut Programmation Objet - boulier chinois
    Bonjour,

    En cours, nous devons programmer un boulier chinois.
    Donc si y'en a qui connaisse tant mieux, sinon c'est pas important
    le principe en gros c'est un boulier chinois conteneur de 5 colonnes conteneur de 2 tiges conteneur de 5 ou 2 boules. Et cela permet de faire des calculs

    Donc le truc c'est que c'est hyper répétitif.. On apprend à codé en objet, mais autant dire qu’une fois devant le code, je suis complètement bloqué et je code donc en procédurale façon ultra gros beu comme dirais mon prof

    voici la partie principale de mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
     
    	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
    			 }
    /******************************COLONNE 1*******************************************/
    /*________________________________________________________________________________*/
    ////////// //////////  Boule51_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule51_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if (pb_boule51_02->Visible){
    				 pb_boule51_1->Visible=false;
    				 pb_boule51_01->Visible=true;
    				// textBox_total->Text="000001";
    			 }
    		 }
    ////////// //////////  Boule51_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule51_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule51_1->Visible=true;
    			 pb_boule51_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule51_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule51_2_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 pb_boule51_2->Visible=false;
    			 pb_boule51_02->Visible=true;
    		 }
    ////////// //////////  Boule51_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule51_02_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 if (pb_boule51_1->Visible){
    				 pb_boule51_2->Visible=true;
    				 pb_boule51_02->Visible=false;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule11_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_05->Visible) && (pb_boule11_04->Visible) && (pb_boule11_03->Visible) && (pb_boule11_02->Visible)) {
    				 pb_boule11_01->Visible=true;
    				 pb_boule11_1->Visible=false;
    				 if ((pb_boule51_01->Visible) && (pb_boule51_02->Visible) && (pb_boule12_05->Visible)) {
    					pb_boule12_4->Visible=false;
    					pb_boule12_04->Visible=true;
    					pb_boule12_5->Visible=false;
    					pb_boule12_05->Visible=true;
    					pb_boule51_1->Visible=true;
    					pb_boule51_01->Visible=false;
    					pb_boule51_2->Visible=true;
    					pb_boule51_02->Visible=false;
    					pb_boule11_1->Visible=true;
    					pb_boule11_2->Visible=true;
    					pb_boule11_3->Visible=true;
    					pb_boule11_4->Visible=true;
    					pb_boule11_5->Visible=true;
    					pb_boule11_01->Visible=false;
    					pb_boule11_02->Visible=false;
    					pb_boule11_03->Visible=false;
    					pb_boule11_04->Visible=false;
    					pb_boule11_05->Visible=false;
    				 }
    				 else if ((pb_boule51_01->Visible) && (pb_boule51_02->Visible)) {
    					pb_boule12_5->Visible=false;
    					pb_boule12_05->Visible=true;
    					pb_boule51_1->Visible=true;
    					pb_boule51_01->Visible=false;
    					pb_boule51_2->Visible=true;
    					pb_boule51_02->Visible=false;
    					pb_boule11_1->Visible=true;
    					pb_boule11_2->Visible=true;
    					pb_boule11_3->Visible=true;
    					pb_boule11_4->Visible=true;
    					pb_boule11_5->Visible=true;
    					pb_boule11_01->Visible=false;
    					pb_boule11_02->Visible=false;
    					pb_boule11_03->Visible=false;
    					pb_boule11_04->Visible=false;
    					pb_boule11_05->Visible=false;
    				 }
    				 else if ((pb_boule11_01->Visible) && (pb_boule51_02->Visible)) {
    					pb_boule51_1->Visible=false;
    					pb_boule51_01->Visible=true;
    					pb_boule51_2->Visible=false;
    					pb_boule51_02->Visible=true;
    					pb_boule11_1->Visible=true;
    					pb_boule11_2->Visible=true;
    					pb_boule11_3->Visible=true;
    					pb_boule11_4->Visible=true;
    					pb_boule11_5->Visible=true;
    					pb_boule11_01->Visible=false;
    					pb_boule11_02->Visible=false;
    					pb_boule11_03->Visible=false;
    					pb_boule11_04->Visible=false;
    					pb_boule11_05->Visible=false;
    				 }
    				 else if (pb_boule11_01->Visible) {
    					pb_boule51_2->Visible=false;
    					pb_boule51_02->Visible=true;
    					pb_boule11_1->Visible=true;
    					pb_boule11_2->Visible=true;
    					pb_boule11_3->Visible=true;
    					pb_boule11_4->Visible=true;
    					pb_boule11_5->Visible=true;
    					pb_boule11_01->Visible=false;
    					pb_boule11_02->Visible=false;
    					pb_boule11_03->Visible=false;
    					pb_boule11_04->Visible=false;
    					pb_boule11_05->Visible=false;
    				 }
    			 }
    		 }
    ////////// //////////  Boule11_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule11_1->Visible=true;
    			 pb_boule11_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule11_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_2_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_05->Visible) && (pb_boule11_04->Visible) && (pb_boule11_03->Visible)) {
    				pb_boule11_02->Visible=true;
    				pb_boule11_2->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule11_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_02_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_1->Visible)) {
    				pb_boule11_02->Visible=false;
    				pb_boule11_2->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule11_3 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_3_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_05->Visible) && (pb_boule11_04->Visible)) {
    				 pb_boule11_03->Visible=true;
    				 pb_boule11_3->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule11_3 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_03_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_1->Visible) && (pb_boule11_2->Visible)) {
    				 pb_boule11_03->Visible=false;
    				 pb_boule11_3->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule11_4 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_4_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_05->Visible)) {
    				pb_boule11_04->Visible=true;
    				pb_boule11_4->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule11_4 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_04_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_1->Visible) && (pb_boule11_2->Visible) && (pb_boule11_3->Visible)) {
    				pb_boule11_04->Visible=false;
    				pb_boule11_4->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule11_5 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_5_Click(System::Object^  sender, System::EventArgs^  e) {
    				pb_boule11_5->Visible=false;
    				pb_boule11_05->Visible=true;
    		 }
    ////////// //////////  Boule11_5 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule11_05_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule11_1->Visible) && (pb_boule11_2->Visible) && (pb_boule11_3->Visible) && (pb_boule11_4->Visible)) {
    				pb_boule11_5->Visible=true;
    				pb_boule11_05->Visible=false;
    			 }
    		 }
     
     
     
     
     
     
    /******************************COLONNE 2*******************************************/
    /*________________________________________________________________________________*/
    ////////// //////////  Boule52_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule52_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if (pb_boule52_02->Visible){
    				 pb_boule52_1->Visible=false;
    				 pb_boule52_01->Visible=true;
    				// textBox_total->Text="000001";
    			 }
    		 }
    ////////// //////////  Boule52_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule52_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule52_1->Visible=true;
    			 pb_boule52_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule52_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule52_2_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 pb_boule52_2->Visible=false;
    			 pb_boule52_02->Visible=true;
    		 }
    ////////// //////////  Boule52_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule52_02_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 if (pb_boule52_1->Visible){
    				 pb_boule52_2->Visible=true;
    				 pb_boule52_02->Visible=false;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule12_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_05->Visible) && (pb_boule12_04->Visible) && (pb_boule12_03->Visible) && (pb_boule12_02->Visible)) {
    				 pb_boule12_01->Visible=true;
    				 pb_boule12_1->Visible=false;
    				 if ((pb_boule52_01->Visible) && (pb_boule52_02->Visible)) {
    					pb_boule12_01->Visible=true;
    					pb_boule12_02->Visible=true;
    					pb_boule12_03->Visible=true;
    					pb_boule12_04->Visible=true;
    					pb_boule12_05->Visible=true;
    				 }
    				 else if ((pb_boule12_01->Visible) && (pb_boule52_02->Visible)) {
    					pb_boule52_1->Visible=false;
    					pb_boule52_01->Visible=true;
    					pb_boule52_2->Visible=false;
    					pb_boule52_02->Visible=true;
    					pb_boule12_1->Visible=true;
    					pb_boule12_2->Visible=true;
    					pb_boule12_3->Visible=true;
    					pb_boule12_4->Visible=true;
    					pb_boule12_5->Visible=true;
    					pb_boule12_01->Visible=false;
    					pb_boule12_02->Visible=false;
    					pb_boule12_03->Visible=false;
    					pb_boule12_04->Visible=false;
    					pb_boule12_05->Visible=false;
    				 }
    				 else if (pb_boule12_01->Visible) {
    					pb_boule52_2->Visible=false;
    					pb_boule52_02->Visible=true;
    					pb_boule12_1->Visible=true;
    					pb_boule12_2->Visible=true;
    					pb_boule12_3->Visible=true;
    					pb_boule12_4->Visible=true;
    					pb_boule12_5->Visible=true;
    					pb_boule12_01->Visible=false;
    					pb_boule12_02->Visible=false;
    					pb_boule12_03->Visible=false;
    					pb_boule12_04->Visible=false;
    					pb_boule12_05->Visible=false;
    				 }
    			 }
    		 }
    ////////// //////////  Boule12_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule12_1->Visible=true;
    			 pb_boule12_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule12_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_2_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_05->Visible) && (pb_boule12_04->Visible) && (pb_boule12_03->Visible)) {
    				pb_boule12_02->Visible=true;
    				pb_boule12_2->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule12_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_02_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_1->Visible)) {
    				pb_boule12_02->Visible=false;
    				pb_boule12_2->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule12_3 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_3_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_05->Visible) && (pb_boule12_04->Visible)) {
    				 pb_boule12_03->Visible=true;
    				 pb_boule12_3->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule12_3 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_03_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_1->Visible) && (pb_boule12_2->Visible)) {
    				 pb_boule12_03->Visible=false;
    				 pb_boule12_3->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule12_4 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_4_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_05->Visible)) {
    				pb_boule12_04->Visible=true;
    				pb_boule12_4->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule12_4 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_04_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_1->Visible) && (pb_boule12_2->Visible) && (pb_boule12_3->Visible)) {
    				pb_boule12_04->Visible=false;
    				pb_boule12_4->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule12_5 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_5_Click(System::Object^  sender, System::EventArgs^  e) {
    				pb_boule12_5->Visible=false;
    				pb_boule12_05->Visible=true;
    		 }
    ////////// //////////  Boule12_5 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule12_05_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule12_1->Visible) && (pb_boule12_2->Visible) && (pb_boule12_3->Visible) && (pb_boule12_4->Visible)) {
    				pb_boule12_5->Visible=true;
    				pb_boule12_05->Visible=false;
    			 }
    		 }
     
     
     
     
     
    /******************************COLONNE 3*******************************************/
    /*________________________________________________________________________________*/
    ////////// //////////  Boule53_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule53_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if (pb_boule53_02->Visible){
    				 pb_boule53_1->Visible=false;
    				 pb_boule53_01->Visible=true;
    				// textBox_total->Text="000001";
    			 }
    		 }
    ////////// //////////  Boule53_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule53_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule53_1->Visible=true;
    			 pb_boule53_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule53_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule53_2_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 pb_boule53_2->Visible=false;
    			 pb_boule53_02->Visible=true;
    		 }
    ////////// //////////  Boule53_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule53_02_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 if (pb_boule53_1->Visible){
    				 pb_boule53_2->Visible=true;
    				 pb_boule53_02->Visible=false;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule13_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_05->Visible) && (pb_boule13_04->Visible) && (pb_boule13_03->Visible) && (pb_boule13_02->Visible)) {
    				 pb_boule13_01->Visible=true;
    				 pb_boule13_1->Visible=false;
    				 if ((pb_boule53_01->Visible) && (pb_boule53_02->Visible)) {
    					pb_boule13_01->Visible=true;
    					pb_boule13_02->Visible=true;
    					pb_boule13_03->Visible=true;
    					pb_boule13_04->Visible=true;
    					pb_boule13_05->Visible=true;
    				 }
    				 else if ((pb_boule13_01->Visible) && (pb_boule53_02->Visible)) {
    					pb_boule53_1->Visible=false;
    					pb_boule53_01->Visible=true;
    					pb_boule53_2->Visible=false;
    					pb_boule53_02->Visible=true;
    					pb_boule13_1->Visible=true;
    					pb_boule13_2->Visible=true;
    					pb_boule13_3->Visible=true;
    					pb_boule13_4->Visible=true;
    					pb_boule13_5->Visible=true;
    					pb_boule13_01->Visible=false;
    					pb_boule13_02->Visible=false;
    					pb_boule13_03->Visible=false;
    					pb_boule13_04->Visible=false;
    					pb_boule13_05->Visible=false;
    				 }
    				 else if (pb_boule13_01->Visible) {
    					pb_boule53_2->Visible=false;
    					pb_boule53_02->Visible=true;
    					pb_boule13_1->Visible=true;
    					pb_boule13_2->Visible=true;
    					pb_boule13_3->Visible=true;
    					pb_boule13_4->Visible=true;
    					pb_boule13_5->Visible=true;
    					pb_boule13_01->Visible=false;
    					pb_boule13_02->Visible=false;
    					pb_boule13_03->Visible=false;
    					pb_boule13_04->Visible=false;
    					pb_boule13_05->Visible=false;
    				 }
    			 }
    		 }
    ////////// //////////  Boule13_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule13_1->Visible=true;
    			 pb_boule13_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule13_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_2_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_05->Visible) && (pb_boule13_04->Visible) && (pb_boule13_03->Visible)) {
    				pb_boule13_02->Visible=true;
    				pb_boule13_2->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule13_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_02_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_1->Visible)) {
    				pb_boule13_02->Visible=false;
    				pb_boule13_2->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule13_3 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_3_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_05->Visible) && (pb_boule13_04->Visible)) {
    				 pb_boule13_03->Visible=true;
    				 pb_boule13_3->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule13_3 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_03_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_1->Visible) && (pb_boule13_2->Visible)) {
    				 pb_boule13_03->Visible=false;
    				 pb_boule13_3->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule13_4 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_4_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_05->Visible)) {
    				pb_boule13_04->Visible=true;
    				pb_boule13_4->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule13_4 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_04_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_1->Visible) && (pb_boule13_2->Visible) && (pb_boule13_3->Visible)) {
    				pb_boule13_04->Visible=false;
    				pb_boule13_4->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule13_5 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_5_Click(System::Object^  sender, System::EventArgs^  e) {
    				pb_boule13_5->Visible=false;
    				pb_boule13_05->Visible=true;
    		 }
    ////////// //////////  Boule13_5 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule13_05_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule13_1->Visible) && (pb_boule13_2->Visible) && (pb_boule13_3->Visible) && (pb_boule13_4->Visible)) {
    				pb_boule13_5->Visible=true;
    				pb_boule13_05->Visible=false;
    			 }
    		 }
     
     
     
     
     
    /******************************COLONNE 4*******************************************/
    /*________________________________________________________________________________*/
    ////////// //////////  Boule54_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule54_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if (pb_boule54_02->Visible){
    				 pb_boule54_1->Visible=false;
    				 pb_boule54_01->Visible=true;
    				// textBox_total->Text="000001";
    			 }
    		 }
    ////////// //////////  Boule54_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule54_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule54_1->Visible=true;
    			 pb_boule54_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule54_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule54_2_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 pb_boule54_2->Visible=false;
    			 pb_boule54_02->Visible=true;
    		 }
    ////////// //////////  Boule54_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule54_02_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 if (pb_boule54_1->Visible){
    				 pb_boule54_2->Visible=true;
    				 pb_boule54_02->Visible=false;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule14_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_05->Visible) && (pb_boule14_04->Visible) && (pb_boule14_03->Visible) && (pb_boule14_02->Visible)) {
    				 pb_boule14_01->Visible=true;
    				 pb_boule14_1->Visible=false;
    				 if ((pb_boule54_01->Visible) && (pb_boule54_02->Visible)) {
    					pb_boule14_01->Visible=true;
    					pb_boule14_02->Visible=true;
    					pb_boule14_03->Visible=true;
    					pb_boule14_04->Visible=true;
    					pb_boule14_05->Visible=true;
    				 }
    				 else if ((pb_boule14_01->Visible) && (pb_boule54_02->Visible)) {
    					pb_boule54_1->Visible=false;
    					pb_boule54_01->Visible=true;
    					pb_boule54_2->Visible=false;
    					pb_boule54_02->Visible=true;
    					pb_boule14_1->Visible=true;
    					pb_boule14_2->Visible=true;
    					pb_boule14_3->Visible=true;
    					pb_boule14_4->Visible=true;
    					pb_boule14_5->Visible=true;
    					pb_boule14_01->Visible=false;
    					pb_boule14_02->Visible=false;
    					pb_boule14_03->Visible=false;
    					pb_boule14_04->Visible=false;
    					pb_boule14_05->Visible=false;
    				 }
    				 else if (pb_boule14_01->Visible) {
    					pb_boule54_2->Visible=false;
    					pb_boule54_02->Visible=true;
    					pb_boule14_1->Visible=true;
    					pb_boule14_2->Visible=true;
    					pb_boule14_3->Visible=true;
    					pb_boule14_4->Visible=true;
    					pb_boule14_5->Visible=true;
    					pb_boule14_01->Visible=false;
    					pb_boule14_02->Visible=false;
    					pb_boule14_03->Visible=false;
    					pb_boule14_04->Visible=false;
    					pb_boule14_05->Visible=false;
    				 }
    			 }
    		 }
    ////////// //////////  Boule14_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule14_1->Visible=true;
    			 pb_boule14_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule14_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_2_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_05->Visible) && (pb_boule14_04->Visible) && (pb_boule14_03->Visible)) {
    				pb_boule14_02->Visible=true;
    				pb_boule14_2->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule14_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_02_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_1->Visible)) {
    				pb_boule14_02->Visible=false;
    				pb_boule14_2->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule14_3 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_3_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_05->Visible) && (pb_boule14_04->Visible)) {
    				 pb_boule14_03->Visible=true;
    				 pb_boule14_3->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule14_3 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_03_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_1->Visible) && (pb_boule14_2->Visible)) {
    				 pb_boule14_03->Visible=false;
    				 pb_boule14_3->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule14_4 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_4_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_05->Visible)) {
    				pb_boule14_04->Visible=true;
    				pb_boule14_4->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule14_4 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_04_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_1->Visible) && (pb_boule14_2->Visible) && (pb_boule14_3->Visible)) {
    				pb_boule14_04->Visible=false;
    				pb_boule14_4->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule14_5 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_5_Click(System::Object^  sender, System::EventArgs^  e) {
    				pb_boule14_5->Visible=false;
    				pb_boule14_05->Visible=true;
    		 }
    ////////// //////////  Boule14_5 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule14_05_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule14_1->Visible) && (pb_boule14_2->Visible) && (pb_boule14_3->Visible) && (pb_boule14_4->Visible)) {
    				pb_boule14_5->Visible=true;
    				pb_boule14_05->Visible=false;
    			 }
    		 }
     
     
     
     
     
    /******************************COLONNE 5*******************************************/
    /*________________________________________________________________________________*/
    ////////// //////////  Boule55_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule55_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if (pb_boule55_02->Visible){
    				 pb_boule55_1->Visible=false;
    				 pb_boule55_01->Visible=true;
    				// textBox_total->Text="000001";
    			 }
    		 }
    ////////// //////////  Boule55_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule55_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule55_1->Visible=true;
    			 pb_boule55_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule55_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule55_2_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 pb_boule55_2->Visible=false;
    			 pb_boule55_02->Visible=true;
    		 }
    ////////// //////////  Boule55_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule55_02_Click(System::Object^  sender, System::EventArgs^  e) { 
    			 if (pb_boule55_1->Visible){
    				 pb_boule55_2->Visible=true;
    				 pb_boule55_02->Visible=false;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule15_1 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_05->Visible) && (pb_boule15_04->Visible) && (pb_boule15_03->Visible) && (pb_boule15_02->Visible)) {
    				 pb_boule15_01->Visible=true;
    				 pb_boule15_1->Visible=false;
    				 if ((pb_boule55_01->Visible) && (pb_boule55_02->Visible)) {
    					pb_boule15_01->Visible=true;
    					pb_boule15_02->Visible=true;
    					pb_boule15_03->Visible=true;
    					pb_boule15_04->Visible=true;
    					pb_boule15_05->Visible=true;
    				 }
    				 else if ((pb_boule15_01->Visible) && (pb_boule55_02->Visible)) {
    					pb_boule55_1->Visible=false;
    					pb_boule55_01->Visible=true;
    					pb_boule55_2->Visible=false;
    					pb_boule55_02->Visible=true;
    					pb_boule15_1->Visible=true;
    					pb_boule15_2->Visible=true;
    					pb_boule15_3->Visible=true;
    					pb_boule15_4->Visible=true;
    					pb_boule15_5->Visible=true;
    					pb_boule15_01->Visible=false;
    					pb_boule15_02->Visible=false;
    					pb_boule15_03->Visible=false;
    					pb_boule15_04->Visible=false;
    					pb_boule15_05->Visible=false;
    				 }
    				 else if (pb_boule15_01->Visible) {
    					pb_boule55_2->Visible=false;
    					pb_boule55_02->Visible=true;
    					pb_boule15_1->Visible=true;
    					pb_boule15_2->Visible=true;
    					pb_boule15_3->Visible=true;
    					pb_boule15_4->Visible=true;
    					pb_boule15_5->Visible=true;
    					pb_boule15_01->Visible=false;
    					pb_boule15_02->Visible=false;
    					pb_boule15_03->Visible=false;
    					pb_boule15_04->Visible=false;
    					pb_boule15_05->Visible=false;
    				 }
    			 }
    		 }
    ////////// //////////  Boule15_1 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_01_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule15_1->Visible=true;
    			 pb_boule15_01->Visible=false;
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule15_2 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_2_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_05->Visible) && (pb_boule15_04->Visible) && (pb_boule15_03->Visible)) {
    				pb_boule15_02->Visible=true;
    				pb_boule15_2->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule15_2 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_02_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_1->Visible)) {
    				pb_boule15_02->Visible=false;
    				pb_boule15_2->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule15_3 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_3_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_05->Visible) && (pb_boule15_04->Visible)) {
    				 pb_boule15_03->Visible=true;
    				 pb_boule15_3->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule15_3 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_03_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_1->Visible) && (pb_boule15_2->Visible)) {
    				 pb_boule15_03->Visible=false;
    				 pb_boule15_3->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule15_4 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_4_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_05->Visible)) {
    				pb_boule15_04->Visible=true;
    				pb_boule15_4->Visible=false;
    			 }
    		 }
    ////////// //////////  Boule15_4 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_04_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_1->Visible) && (pb_boule15_2->Visible) && (pb_boule15_3->Visible)) {
    				pb_boule15_04->Visible=false;
    				pb_boule15_4->Visible=true;
    			 }
    		 }
    /*________________________________________________________________________________*/
    ////////// //////////  Boule15_5 INACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_5_Click(System::Object^  sender, System::EventArgs^  e) {
    				pb_boule15_5->Visible=false;
    				pb_boule15_05->Visible=true;
    		 }
    ////////// //////////  Boule15_5 ACTIF ////////// ////////// ////////// //////////
    private: System::Void pb_boule15_05_Click(System::Object^  sender, System::EventArgs^  e) {
    			 if ((pb_boule15_1->Visible) && (pb_boule15_2->Visible) && (pb_boule15_3->Visible) && (pb_boule15_4->Visible)) {
    				pb_boule15_5->Visible=true;
    				pb_boule15_05->Visible=false;
    			 }
    		 }
    private: System::Void bt_reinitialise_Click(System::Object^  sender, System::EventArgs^  e) {
    			 pb_boule11_5->Visible=true;
    			 pb_boule11_4->Visible=true;
    			 pb_boule11_3->Visible=true;
    			 pb_boule11_2->Visible=true;
    			 pb_boule11_1->Visible=true;
    			 pb_boule12_5->Visible=true;
    			 pb_boule12_4->Visible=true;
    			 pb_boule12_3->Visible=true;
    			 pb_boule12_2->Visible=true;
    			 pb_boule12_1->Visible=true;
    			 pb_boule13_5->Visible=true;
    			 pb_boule13_4->Visible=true;
    			 pb_boule13_3->Visible=true;
    			 pb_boule13_2->Visible=true;
    			 pb_boule13_1->Visible=true;
    			 pb_boule14_5->Visible=true;
    			 pb_boule14_4->Visible=true;
    			 pb_boule14_3->Visible=true;
    			 pb_boule14_2->Visible=true;
    			 pb_boule14_1->Visible=true;
    			 pb_boule15_5->Visible=true;
    			 pb_boule15_4->Visible=true;
    			 pb_boule15_3->Visible=true;
    			 pb_boule15_2->Visible=true;
    			 pb_boule15_1->Visible=true;
     
    			 pb_boule11_05->Visible=false;
    			 pb_boule11_04->Visible=false;
    			 pb_boule11_03->Visible=false;
    			 pb_boule11_02->Visible=false;
    			 pb_boule11_01->Visible=false;
    			 pb_boule12_05->Visible=false;
    			 pb_boule12_04->Visible=false;
    			 pb_boule12_03->Visible=false;
    			 pb_boule12_02->Visible=false;
    			 pb_boule12_01->Visible=false;
    			 pb_boule13_05->Visible=false;
    			 pb_boule13_04->Visible=false;
    			 pb_boule13_03->Visible=false;
    			 pb_boule13_02->Visible=false;
    			 pb_boule13_01->Visible=false;
    			 pb_boule14_05->Visible=false;
    			 pb_boule14_04->Visible=false;
    			 pb_boule14_03->Visible=false;
    			 pb_boule14_02->Visible=false;
    			 pb_boule14_01->Visible=false;
    			 pb_boule15_05->Visible=false;
    			 pb_boule15_04->Visible=false;
    			 pb_boule15_03->Visible=false;
    			 pb_boule15_02->Visible=false;
    			 pb_boule15_01->Visible=false;
     
    			 pb_boule51_1->Visible=true;
    			 pb_boule51_2->Visible=true;
    			 pb_boule52_1->Visible=true;
    			 pb_boule52_2->Visible=true;
    			 pb_boule53_1->Visible=true;
    			 pb_boule53_2->Visible=true;
    			 pb_boule54_1->Visible=true;
    			 pb_boule54_2->Visible=true;
    			 pb_boule55_1->Visible=true;
    			 pb_boule55_2->Visible=true;
     
    			 pb_boule51_01->Visible=false;
    			 pb_boule51_02->Visible=false;
    			 pb_boule52_01->Visible=false;
    			 pb_boule52_02->Visible=false;
    			 pb_boule53_01->Visible=false;
    			 pb_boule53_02->Visible=false;
    			 pb_boule54_01->Visible=false;
    			 pb_boule54_02->Visible=false;
    			 pb_boule55_01->Visible=false;
    			 pb_boule55_02->Visible=false;
    		 }
    Comme vous pouvez le constater, c'est très répétitif
    Ça marche très bien, mais pas très optimisé et j'aimerais refaire mon programme et comprendre la programmation Objet

    Mais la je n'ai aucune idée de comment je vais codé sa..
    (je code sous Visual Studio 2010)

    Dans mon analyse UML, nous avons donc 4 classes (BoulierChinois, colonne, tige, boules) (avec comme liaison une composition)

    Si quelqu'un pouvait m'éclaircir..

    Merci à l'avance!
    Dernière modification par Deepin ; 17/11/2010 à 10h14. Motif: Suppression de mention de type "besoin d'aide" du titre

  2. #2
    Membre émérite
    Avatar de dkmix
    Profil pro
    Inscrit en
    Septembre 2007
    Messages
    619
    Détails du profil
    Informations personnelles :
    Localisation : Jamaïque

    Informations forums :
    Inscription : Septembre 2007
    Messages : 619
    Par défaut
    De quoi creer le boulier déjà si ca peut t'aider... (En C# !!... connais pas C++)
    apres pour les evenemenst etc... fo voir


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
     
    public class Boulier
        {
            public IList<Colonne> Colonnes = new List<Colonne>();
        }
     
        public class Colonne
        {
            public IList<Tige> Tiges = new List<Tige>();
            public int Puissance; // dizaine / centaine .....
            public Colonne(int puissance)
            {
                Puissance = puissance;
            }
     
     
        }
        public class Tige
        {
            public IList<Boule> Boules = new List<Boule>();
            public int Multiplicateur; //1 ou 5 (pas obligé de prendre un entier)
     
            public Tige(int multipli)
            {
                Multiplicateur = multipli;
            }
        }
        public class Boule
        {
            public int Rang; // position dans la tige pour les evts ...
            public bool Active;
     
            public Boule(int rang)
            {
                Rang = rang;
            }
     
        }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
     
    static void Main(string[] args)
            {
                Boulier boulier = new Boulier();
     
                for(int p=1; p<=5;p++)
                {
                    Colonne col = new Colonne(p);
     
                    for (int m = 1; m <= 5; m += 4)
                    {
                        Tige tige = new Tige(m);
                        col.Tiges.Add(tige);
     
                        int nbDeBoules;
                        nbDeBoules = (m == 1) ? 5 : 2;
     
                        for (int r = 1; r <= nbDeBoules; r++)
                        {
                            Boule b = new Boule(r);
                            tige.Boules.Add(b);
                        }
                    }
     
                    boulier.Colonnes.Add(col);
                }
     
           }

  3. #3
    Invité
    Invité(e)
    Par défaut
    je te remerci de ton aide, mais je n'ai pas encore eu le temps de me pecher sur le C# et je n'y connais rien

    je vais essayé de m'inspirer de ta structure et voir ce que je peut faire

  4. #4
    Invité
    Invité(e)
    Par défaut
    voici mon problème qui est tout con, mais je n'arrive plus à me rappeller comment faire .

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
            pb_boule12_5->Visible=true;
    	pb_boule12_4->Visible=true;
    	pb_boule12_3->Visible=true;
    	pb_boule12_2->Visible=true;
    	pb_boule12_1->Visible=true;
    j'ai sa comme code, et je pourrais faire tous simplement un tableau de caractère qui incrémente de 1 à 5 avec un boucle for, mais impossible de me rappellé comment codé sa :/ sa marche pas ce que je fait

    merci à l'avance

  5. #5
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 468
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 468
    Par défaut
    Primo.: Une conception objet en C# est tout aussi valable en C++ car leurs conceptions de l'objet sont très proches. (classe, instance de classe = objet, statics, opérateurs etc..)
    Donc regarder plus attentivement le post de dkmix.
    La différence entre les génériques de .NET et les templates C++ ne devrait pas être insurmontable.

    Votre code ressemble plus à la simulation d'un invertébré sans système nerveux central qu'à un programme montrant toute la puissance d'abstraction d'un développeur moyen (homo sapien-sapien malgré les jaloux).

    En clair, votre code n'est qu'une suite d'action réflexe à des boutons. Un boulier, si je ne m'abuse, sert à compter. Il faut donc avoir une représentation du ou des nombres courants et n'utiliser les boules que pour représenter ces nombres et pour initier des commandes pour calculer le ou les nouveaux nombres.

    Il faut séparer le model (le ou les nombres) de la vue (la manière de les afficher, un boulier).

    Ainsi, si une action sur le boulier correspond à faire +1 sur un nombre, votre code de la vue génère une commande (+1) qui sera traité trivialement par le model. Une fois le calcul effectué, vous demandez à la vue d'afficher le ou les nouveaux nombres.

    Ainsi votre code sera beaucoup plus simple, le model pourra être utilisé avec un notre type de boulier (comme le japonais ). Etc.

    En un mot, faire de l'algorithmie, c'est prendre un peu de recule.

  6. #6
    Invité
    Invité(e)
    Par défaut
    Et vous avez raison, mais faut être indulgent la conception objet voir la programmation tous court n'est pas une chose facile à assimilé, je suis plus que novice dans la matière.

    Étant plus orienté web et infographie pour ma part, mais je demande qu'a comprendre et à apprendre.

    En vous remerciant

  7. #7
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 468
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 468
    Par défaut
    Avez-vous réussi à séparer dans votre programme selon le model MVC (Model, vue, contrôleur) ?

    - le model (le ou les nombre)
    - la vue (la représentation du ou des nombres sous la forme d'un boulier)
    - le contrôleur (élément de l'IHM qui permet à l'utilisateur d'interagir avec le programme)

    En séparant bien ces différents éléments, vous simplifierez considérablement votre programme.

    Effectivement, l'acquisition des concepts de la POO est un processus loin d'être évident.

    Courage.

Discussions similaires

  1. [Débuter] Programmation objet mais conditions particulières
    Par KaptainouK dans le forum Langages de programmation
    Réponses: 13
    Dernier message: 30/09/2005, 00h20
  2. [Débutant(e)][Conception] prob de programmation objet
    Par gregorian dans le forum Général Java
    Réponses: 3
    Dernier message: 07/07/2005, 11h20
  3. Questions sur la programmation objet en Delphi
    Par Manopower dans le forum Débuter
    Réponses: 20
    Dernier message: 15/06/2005, 15h39
  4. [ASP] Programmation objet ?
    Par Hell dans le forum ASP
    Réponses: 6
    Dernier message: 07/04/2005, 15h28
  5. Problème programmation objet
    Par Contrec dans le forum MFC
    Réponses: 54
    Dernier message: 30/03/2005, 11h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo