Powerbuilder Minesweep Game
Source Code
Window w_main
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 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | forward global type w_main from window end type type st_8 from statictext within w_main end type type st_7 from statictext within w_main end type type st_4 from statictext within w_main end type type rb_7 from radiobutton within w_main end type type rb_6 from radiobutton within w_main end type type rb_5 from radiobutton within w_main end type type rb_4 from radiobutton within w_main end type type st_5 from statictext within w_main end type type cb_1 from commandbutton within w_main end type type st_3 from statictext within w_main end type type st_2 from statictext within w_main end type type st_1 from statictext within w_main end type type em_2 from editmask within w_main end type type em_1 from editmask within w_main end type type rb_3 from radiobutton within w_main end type type rb_2 from radiobutton within w_main end type type rb_1 from radiobutton within w_main end type type cdw_1 from datawindow within w_main end type type gb_1 from groupbox within w_main end type type gb_2 from groupbox within w_main end type type r_1 from rectangle within w_main end type type ln_2 from line within w_main end type type ln_3 from line within w_main end type type st_6 from statictext within w_main end type end forward global type w_main from window integer x = 14 integer y = 304 integer width = 5234 integer height = 2280 boolean titlebar = true string title = "Minesweep Datawindow" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true windowstate windowstate = maximized! long backcolor = 67108864 event ue_open_shelf ( ) event ue_make_visible ( ) st_8 st_8 st_7 st_7 st_4 st_4 rb_7 rb_7 rb_6 rb_6 rb_5 rb_5 rb_4 rb_4 st_5 st_5 cb_1 cb_1 st_3 st_3 st_2 st_2 st_1 st_1 em_2 em_2 em_1 em_1 rb_3 rb_3 rb_2 rb_2 rb_1 rb_1 cdw_1 cdw_1 gb_1 gb_1 gb_2 gb_2 r_1 r_1 ln_2 ln_2 ln_3 ln_3 st_6 st_6 end type global w_main w_main type variables long il_end = 0 long il_vis[100,100], il_bomb[100,100], il_bombs[100,100], il_done[100,100] long il_empty[100,100] string is_fullstate long il_nummines, il_width, il_height, il_new_width, il_new_height boolean ib_custom end variables event ue_open_shelf();String dw_cmd Long cnt, cnt2, xloc, pix, ll_num_mines Long startx, ll_rand, ll_height, ll_width String ls_name, ls_bomb, ls_bomb_vis, ls_bombs SetPointer(hourglass!) If il_new_width = 0 Then il_new_width = Long(em_1.Text) End If If il_new_height = 0 Then il_new_height = Long(em_2.Text) End If il_width = il_new_width il_height = il_new_height For cnt = 1 To il_width xloc = startx + (cnt * 14) pix = PixelsToUnits(xloc,xpixelstounits!) ls_name = 't'+String(cnt) dw_cmd = 'create ellipse(band=detail x="'+String(pix)+'" y="4" height="44" width="50" name=oval'+String(cnt)+' visible="0~tLONG(MID(bomb,'+String(cnt)+',1))" brush.hatch="6" brush.color="255" pen.style="0" pen.width="5" pen.color="0" background.mode="2" background.color="255" )' dw_cmd = dw_cmd+' create compute(band=detail alignment="2" expression="MID(bombs,'+String(cnt)+',1)" border="0" color="0~tCASE (LONG(MID(bombs,'+String(cnt)+',1)) WHEN 1THEN 16711680 WHEN 2 THEN 32768 WHEN 3 THEN 255 WHEN 4 THEN 8388608 WHEN 5 THEN 128 WHEN 6 THEN 25794313 ELSE 0)" x="'+String(pix + 4)+'" y="0" visible="0~tIF(LONG(MID(bombs,'+String(cnt)+',1)) = 0,0,1)" height="42" width="48" font.face="Arial" font.height="-8" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="80269524" )' dw_cmd = dw_cmd+'create compute(band=detail alignment="2" expression="MID(text,'+String(cnt)+',1)" name='+ls_name+' border="6" color="30013682" x="'+String(pix)+'" y="0" visible="0~tLONG(MID(vis,'+String(cnt)+',1))" height="46" width="48" font.face="Arial" font.height="-12" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16711680" )' cdw_1.Modify(dw_cmd) Next cdw_1.Object.vis.X = pix Randomize(0) For cnt = 1 To il_height ls_bomb = '' For cnt2 = 1 To il_width If Rand(60) < il_nummines Then ls_bomb_vis = '1' il_bomb[cnt,cnt2] = 1 ll_num_mines++ Else ls_bomb_vis = '0' il_bomb[cnt,cnt2] = 0 End If ls_bomb = ls_bomb+ls_bomb_vis il_vis[cnt,cnt2] = 1 Next cdw_1.InsertRow(99999) cdw_1.Object.vis[cdw_1.RowCount()] = FillA('1',il_width) cdw_1.Object.Text[cdw_1.RowCount()] = FillA(' ',il_width) cdw_1.Object.bomb[cdw_1.RowCount()] = ls_bomb Next st_6.Text = String(ll_num_mines) For cnt = 1 To il_height For cnt2 = 1 To il_width If cnt2 > 1 Then If il_bomb[cnt,cnt2] = 1 Then If il_bomb[cnt,cnt2 - 1] = 0 Then il_bombs[cnt,cnt2 - 1] = il_bombs[cnt,cnt2 - 1] + 1 End If If cnt > 1 Then If il_bomb[cnt - 1,cnt2 - 1] = 0 Then il_bombs[cnt - 1,cnt2 - 1] = il_bombs[cnt - 1,cnt2 - 1] + 1 End If End If If cnt < il_height Then If il_bomb[cnt + 1,cnt2 - 1] = 0 Then il_bombs[cnt + 1,cnt2 - 1] = il_bombs[cnt + 1,cnt2 - 1] + 1 End If End If End If End If If cnt2 < il_width Then If il_bomb[cnt,cnt2] = 1 Then If il_bomb[cnt,cnt2 + 1] = 0 Then il_bombs[cnt,cnt2 + 1] = il_bombs[cnt,cnt2 + 1] + 1 End If If cnt > 1 Then If il_bomb[cnt - 1,cnt2 + 1] = 0 Then il_bombs[cnt - 1,cnt2 + 1] = il_bombs[cnt - 1,cnt2 + 1] + 1 End If End If If cnt < il_height Then If il_bomb[cnt + 1,cnt2 + 1] = 0 Then il_bombs[cnt + 1,cnt2 + 1] = il_bombs[cnt + 1,cnt2 + 1] + 1 End If End If End If End If If cnt > 1 Then If il_bomb[cnt,cnt2] = 1 Then If il_bomb[cnt - 1,cnt2] = 0 Then il_bombs[cnt - 1,cnt2] = il_bombs[cnt - 1,cnt2] + 1 End If End If End If If cnt < il_height Then If il_bomb[cnt,cnt2] = 1 Then If il_bomb[cnt + 1,cnt2] = 0 Then il_bombs[cnt + 1,cnt2] = il_bombs[cnt + 1,cnt2] + 1 End If End If End If Next Next For cnt = 1 To il_height ls_bomb = '' For cnt2 = 1 To il_width ls_bomb = ls_bomb+String(il_bombs[cnt,cnt2]) Next cdw_1.Object.bombs[cnt] = ls_bomb Next ll_width = pix + 48 + PixelsToUnits(14,xpixelstounits!) + 80 If ll_width > This.WorkSpaceWidth() - (40 + 622) Then ll_width = This.WorkSpaceWidth() - (40 + 622) End If cdw_1.Width = ll_width ll_height = 90 + (il_height * 60) If ll_height + (20 * 2) > This.WorkSpaceHeight() Then ll_height = This.WorkSpaceHeight() - (20 * 2) End If cdw_1.Height = ll_height cdw_1.Y = (This.WorkSpaceHeight() - cdw_1.Height) / 2 cdw_1.X = (((This.WorkSpaceWidth() - 622) - cdw_1.Width) / 2) + 622 il_done = il_vis This.Event Post ue_make_visible() end event event ue_make_visible();SetPointer(arrow!) cdw_1.Visible = True cb_1.Text = 'J' This.SetRedraw(True) cdw_1.SetFocus() end event event open; is_fullstate = cdw_1.Object.datawindow.Syntax This.Event Post ue_open_shelf() end event on w_main.create this.st_8=create st_8 this.st_7=create st_7 this.st_4=create st_4 this.rb_7=create rb_7 this.rb_6=create rb_6 this.rb_5=create rb_5 this.rb_4=create rb_4 this.st_5=create st_5 this.cb_1=create cb_1 this.st_3=create st_3 this.st_2=create st_2 this.st_1=create st_1 this.em_2=create em_2 this.em_1=create em_1 this.rb_3=create rb_3 this.rb_2=create rb_2 this.rb_1=create rb_1 this.cdw_1=create cdw_1 this.gb_1=create gb_1 this.gb_2=create gb_2 this.r_1=create r_1 this.ln_2=create ln_2 this.ln_3=create ln_3 this.st_6=create st_6 this.Control[]={this.st_8,& this.st_7,& this.st_4,& this.rb_7,& this.rb_6,& this.rb_5,& this.rb_4,& this.st_5,& this.cb_1,& this.st_3,& this.st_2,& this.st_1,& this.em_2,& this.em_1,& this.rb_3,& this.rb_2,& this.rb_1,& this.cdw_1,& this.gb_1,& this.gb_2,& this.r_1,& this.ln_2,& this.ln_3,& this.st_6} end on on w_main.destroy destroy(this.st_8) destroy(this.st_7) destroy(this.st_4) destroy(this.rb_7) destroy(this.rb_6) destroy(this.rb_5) destroy(this.rb_4) destroy(this.st_5) destroy(this.cb_1) destroy(this.st_3) destroy(this.st_2) destroy(this.st_1) destroy(this.em_2) destroy(this.em_1) destroy(this.rb_3) destroy(this.rb_2) destroy(this.rb_1) destroy(this.cdw_1) destroy(this.gb_1) destroy(this.gb_2) destroy(this.r_1) destroy(this.ln_2) destroy(this.ln_3) destroy(this.st_6) end on type st_8 from statictext within w_main integer x = 27 integer y = 1712 integer width = 503 integer height = 108 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16711680 long backcolor = 67108864 boolean enabled = false string text = "(Best viewed at 1024x768)" alignment alignment = center! long bordercolor = 67108864 boolean focusrectangle = false end type type st_7 from statictext within w_main integer x = 366 integer y = 1268 integer width = 137 integer height = 72 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16777215 boolean focusrectangle = false end type type st_4 from statictext within w_main integer x = 82 integer y = 1256 integer width = 233 integer height = 116 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Mines Deployed" boolean focusrectangle = false end type type rb_7 from radiobutton within w_main integer x = 73 integer y = 432 integer width = 402 integer height = 80 integer taborder = 40 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Custom" end type event clicked;il_new_width = 0 il_new_height = 0 end event type rb_6 from radiobutton within w_main integer x = 73 integer y = 1156 integer width = 402 integer height = 80 integer taborder = 90 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Lots" end type event clicked;il_nummines = 14 end event type rb_5 from radiobutton within w_main integer x = 73 integer y = 1056 integer width = 402 integer height = 96 integer taborder = 80 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Some" boolean checked = true end type event clicked;il_nummines = 9 end event event constructor;il_nummines = 9 end event type rb_4 from radiobutton within w_main integer x = 73 integer y = 960 integer width = 402 integer height = 96 integer taborder = 70 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Few" end type event clicked;il_nummines = 4 end event type st_5 from statictext within w_main integer x = 105 integer y = 852 integer width = 343 integer height = 56 integer textsize = -8 integer weight = 700 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Mines" alignment alignment = center! boolean focusrectangle = false end type type cb_1 from commandbutton within w_main integer x = 155 integer y = 1488 integer width = 279 integer height = 208 integer taborder = 100 integer textsize = -36 integer weight = 700 fontcharset fontcharset = symbol! fontpitch fontpitch = variable! string facename = "Wingdings" string text = "J" end type event clicked;cdw_1.SetRedraw(False) cb_1.Text = 'K' cdw_1.Reset() cdw_1.Modify("datawindow.syntax = '"+is_fullstate+"'") il_vis = il_empty il_bomb = il_empty il_bombs = il_empty il_done = il_empty Parent.Event ue_open_shelf() il_end = 0 end event type st_3 from statictext within w_main integer x = 128 integer y = 60 integer width = 343 integer height = 56 integer textsize = -8 integer weight = 700 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Playing Field" alignment alignment = center! boolean focusrectangle = false end type type st_2 from statictext within w_main integer x = 82 integer y = 680 integer width = 224 integer height = 128 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Height (Max. 99)" boolean focusrectangle = false end type type st_1 from statictext within w_main integer x = 82 integer y = 552 integer width = 256 integer height = 128 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = " Width (Max. 60)" boolean focusrectangle = false end type type em_2 from editmask within w_main integer x = 347 integer y = 692 integer width = 114 integer height = 88 integer taborder = 60 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 string text = "none" borderstyle borderstyle = stylelowered! string mask = "##" end type type em_1 from editmask within w_main integer x = 347 integer y = 564 integer width = 114 integer height = 88 integer taborder = 50 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 string text = "none" borderstyle borderstyle = stylelowered! string mask = "##" end type type rb_3 from radiobutton within w_main integer x = 73 integer y = 352 integer width = 434 integer height = 80 integer taborder = 30 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Large (60x40)" end type event clicked;il_new_width = 60 il_new_height = 40 end event type rb_2 from radiobutton within w_main integer x = 73 integer y = 256 integer width = 434 integer height = 96 integer taborder = 20 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Medium (40x30)" boolean checked = true end type event clicked;il_new_width = 40 il_new_height = 30 end event event constructor;il_new_width = 40 il_new_height = 20 end event type rb_1 from radiobutton within w_main integer x = 73 integer y = 160 integer width = 402 integer height = 96 integer taborder = 10 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "Small (20x10)" end type event clicked;il_new_width = 20 il_new_height = 10 end event type cdw_1 from datawindow within w_main event lbd pbm_lbuttondown event oe_toast ( ) event oe_setpointer ( ) boolean visible = false integer x = 622 integer y = 32 integer width = 4498 integer height = 2816 integer taborder = 110 string dataobject = "d_minesweep" boolean hscrollbar = true boolean vscrollbar = true borderstyle borderstyle = stylelowered! end type event lbd;String ls_vis, ls_vis_array[] Long row, ll_seq, ll_cnt1, ll_cnt2, ll_test Long ll_new_row, ll_new_seq String ls_object Long ll_row_hilo[2], ll_seq_hilo[2] If il_end = 1 Then Return End If ls_object = This.GetObjectAtPointer() If LeftA(ls_object,1) = 't' Then row = Long(RightA(ls_object,LenA(ls_object) - PosA(ls_object,'~t'))) ls_object = LeftA(ls_object,PosA(ls_object,'~t')) ll_seq = Long(RightA(ls_object,LenA(ls_object) - 1)) If il_bomb[row,ll_seq] = 1 Then ls_vis_array = This.Object.vis.current For ll_cnt1 = 1 To il_height For ll_cnt2 = 1 To il_width If il_bomb[ll_cnt1,ll_cnt2] = 1 Then ls_vis_array[ll_cnt1] = ReplaceA(ls_vis_array[ll_cnt1],ll_cnt2,1,'0') End If Next Next This.Object.vis.current = ls_vis_array il_end = 1 This.Event Post oe_toast() cb_1.Text = 'L' Return Else If il_bombs[row,ll_seq] = 0 Then SetPointer(hourglass!) cb_1.Text = 'K' If row - 1 < 1 Then ll_row_hilo[1] = 1 Else ll_row_hilo[1] = row - 1 End If ll_row_hilo[2] = row + 1 If ll_seq - 1 < 1 Then ll_seq_hilo[1] = 1 Else ll_seq_hilo[1] = ll_seq - 1 End If ll_seq_hilo[2] = ll_seq + 1 //O mah gosh... a goto statement :-( here: If row - 1 < ll_row_hilo[1] And row - 1 > 0 Then ll_row_hilo[1] = row - 1 ElseIf row + 1 > ll_row_hilo[2] And row + 1 < il_height + 1 Then ll_row_hilo[2] = row + 1 End If If ll_seq - 1 < ll_seq_hilo[1] And ll_seq - 1 > 0 Then ll_seq_hilo[1] = ll_seq - 1 ElseIf ll_seq + 1 > ll_seq_hilo[2] And ll_seq + 1 < il_width + 1 Then ll_seq_hilo[2] = ll_seq + 1 End If For ll_cnt1 = -1 To 1 If row + ll_cnt1 > 0 And row + ll_cnt1 < il_height + 1 Then ls_vis = This.Object.vis[row + ll_cnt1] If ll_seq - 1 > 0 Then il_vis[row + ll_cnt1,ll_seq - 1] = 0 ls_vis = ReplaceA(ls_vis,ll_seq - 1,3,'000') Else ls_vis = ReplaceA(ls_vis,ll_seq - 1,2,'00') End If il_vis[row + ll_cnt1,ll_seq] = 0 il_vis[row + ll_cnt1,ll_seq + 1] = 0 This.Object.vis[row + ll_cnt1] = ls_vis il_done[row,ll_seq] = 0 End If Next For ll_cnt1 = -1 To 1 For ll_cnt2 = -1 To 1 If row + ll_cnt2 > 0 And ll_seq + ll_cnt1 > 0 Then If il_bombs[row + ll_cnt2,ll_seq + ll_cnt1] = 0 And il_done[row + ll_cnt2,ll_seq + ll_cnt1] = 1 Then ll_new_row = row + ll_cnt2 ll_new_seq = ll_seq + ll_cnt1 If ll_new_row > 0 And ll_new_row < il_height + 1 And & ll_new_seq > 0 And ll_new_seq < il_width + 1 Then row = ll_new_row ll_seq = ll_new_seq Goto here End If End If End If Next Next For ll_cnt1 = ll_row_hilo[1] To ll_row_hilo[2] For ll_cnt2 = ll_seq_hilo[1] To ll_seq_hilo[2] If il_done[ll_cnt1,ll_cnt2] = 1 And il_vis[ll_cnt1,ll_cnt2] = 0 And & il_bomb[ll_cnt1,ll_cnt2] = 0 And il_bombs[ll_cnt1,ll_cnt2] = 0 Then row = ll_cnt1 ll_seq = ll_cnt2 Goto here End If Next Next This.Event Post oe_setpointer() Else ls_vis = This.Object.vis[row] il_vis[row,ll_seq] = 0 This.Object.vis[row] = ReplaceA(ls_vis,ll_seq,1,'0') End If End If If il_bomb = il_vis Then il_end = 1 MessageBox('HOORAY!!!!','Victory!',exclamation!) End If End If end event event oe_toast();messagebox('BOOM!!!!','Your have been failed!',exclamation!) end event event oe_setpointer;setpointer(arrow!) cb_1.text = 'J' end event event rbuttondown;String ls_object, ls_text Long ll_seq ls_object = This.GetObjectAtPointer() If LeftA(ls_object,1) = 't' Then ls_object = LeftA(ls_object,PosA(ls_object,'~t')) ll_seq = Long(RightA(ls_object,LenA(ls_object) - 1)) ls_text = This.Object.Text[row] If MidA(ls_text,ll_seq,1) = '^' Then This.Object.Text[row] = ReplaceA(ls_text,ll_seq,1,' ') Else This.Object.Text[row] = ReplaceA(ls_text,ll_seq,1,'^') End If End If end event type gb_1 from groupbox within w_main boolean visible = false integer x = 69 integer y = 160 integer width = 411 integer height = 372 integer taborder = 120 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "none" end type type gb_2 from groupbox within w_main boolean visible = false integer x = 55 integer y = 576 integer width = 411 integer height = 352 integer taborder = 130 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 string text = "none" end type type r_1 from rectangle within w_main long linecolor = 16777215 long fillcolor = 16711680 integer x = 18 integer y = 40 integer width = 576 integer height = 1380 end type type ln_2 from line within w_main long linecolor = 15793151 integer beginx = 23 integer beginy = 132 integer endx = 590 integer endy = 132 end type type ln_3 from line within w_main long linecolor = 15793151 integer beginx = 23 integer beginy = 924 integer endx = 590 integer endy = 924 end type type st_6 from statictext within w_main integer x = 370 integer y = 1272 integer width = 128 integer height = 64 boolean bringtotop = true integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 16777215 long backcolor = 16711680 alignment alignment = center! boolean focusrectangle = false end type |
Datawindow d_minesweep
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | release 10.5; datawindow(units=0 timer_interval=0 color=16777215 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 97 print.margin.bottom = 97 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes print.preview.outline=yes hidegrayline=no pointer="Arrow!" ) header(height=36 color="536870912" ) summary(height=0 color="553648127" ) footer(height=0 color="553648127" ) detail(height=60 color="553648127" ) table(column=(type=char(100) updatewhereclause=no name=vis dbname="vis" ) column=(type=char(100) updatewhereclause=no name=bomb dbname="bomb" ) column=(type=char(100) updatewhereclause=no name=bombs dbname="bombs" ) column=(type=char(100) updatewhereclause=no name=text dbname="text" ) ) column(band=detail id=1 alignment="0" tabsequence=32766 border="0" color="0" x="238" y="8" height="76" width="64" format="[general]" html.valueishtml="0" name=vis visible="1~t0" edit.limit=0 edit.case=any edit.autoselect=yes font.face="Arial" font.height="-12" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" ) htmltable(border="1" ) htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" ) xhtmlgen() cssgen(sessionspecific="0" ) xmlgen(inline="0" ) xsltgen() jsgen() export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 ) import.xml() export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" ) export.xhtml() |
Get From Internet
Find Projects On Github click here
Good Luck!