Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Bantumi program in turbo c.


  • Please log in to reply
6 replies to this topic

#1 rusoman

rusoman

  • Members
  • 14 posts
  • OFFLINE
  •  
  • Local time:09:16 PM

Posted 04 January 2009 - 09:12 AM

Hi, I want to make a Bantumi program, how can I make it in Turbo C?

Can you give me the code, or the algorithm of the game?

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:16 AM

Posted 04 January 2009 - 09:49 AM

If we give you the code or the algorithm, then you are not writing it, are you? And since I have no idea what Bantumi is, I guess you probably won't get much help. You could have at least given a description of the rules of the game, or did you expect that we could Google it for ourselves? I am positive that you are not asking us to both research the game for you, and write the silly thing for you too? :thumbsup:

#3 rusoman

rusoman
  • Topic Starter

  • Members
  • 14 posts
  • OFFLINE
  •  
  • Local time:09:16 PM

Posted 04 January 2009 - 10:40 PM

If we give you the code or the algorithm, then you are not writing it, are you? And since I have no idea what Bantumi is, I guess you probably won't get much help. You could have at least given a description of the rules of the game, or did you expect that we could Google it for ourselves? I am positive that you are not asking us to both research the game for you,
and write the silly thing for you too? :thumbsup:


Sorry, cause I'm new to BleepingComputer.com.

The objective of the game is to move your stones from the trays at the bottom of the screen into your mancala on the right hand side. The following rules apply to the bantumi game you can download on this page.

1. The game always moves counterclockwise.

2. After you have made your selection, each tray increases by 1 counterclockwise, until all the stones you picked up have been used.

3. You cannot drop any stones into your opponents mancala.

4. If your stone arrives in your mancala, your score increases by 1.

5. If your last stone arrives in your mancala, you have another move to do.

6. If your last stone arrives in an empty tray in the bottom half, it is added to your total, and any stone in the opposite tray are added as well.

7. If either player is left with no stone in their trays, the game is over. If the other player still has stones, they are added automatically to his mancala (player - machine).

8. The winner is the player with the highest number of stones in his mancala.

Play it here.

Can you give me tips on how to make it, what functions, or starting code? So I can start from there.

Or algorithm, it's ok if I'm not writing it.

#4 haun

haun

  • Members
  • 156 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Denver, CO
  • Local time:07:16 AM

Posted 05 January 2009 - 12:04 AM

you are going to need a lot more than that for info. You need, pieces, types of pieces, rules of pieces, rules of the game, movement of the board, spots on the board, rules of those spots, everything.
Annnnd you're, asking, me...

#5 rusoman

rusoman
  • Topic Starter

  • Members
  • 14 posts
  • OFFLINE
  •  
  • Local time:09:16 PM

Posted 06 January 2009 - 02:42 AM

you are going to need a lot more than that for info. You need, pieces, types of pieces, rules of pieces, rules of the game, movement of the board, spots on the board, rules of those spots, everything.


I've already specify all the rules.
Play it here

#6 geemicah_16

geemicah_16

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:08:16 AM

Posted 27 January 2009 - 02:55 AM

you are going to need a lot more than that for info. You need, pieces, types of pieces, rules of pieces, rules of the game, movement of the board, spots on the board, rules of those spots, everything.


ruso and me have the same problem.. but heres the problem....

will you check this codes? since ruso gave the set of rule<check it on 2nd commentor>

you are going to need a lot more than that for info. You need, pieces, types of pieces, rules of pieces, rules of the game, movement of the board, spots on the board, rules of those spots, everything.

#7 geemicah_16

geemicah_16

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:08:16 AM

Posted 27 January 2009 - 02:56 AM

1. //this is a two player bantumi game,the user will enter the position in the board game to start
2.
3. #include<stdio.h>
4. #include<conio.h>
5. int d1=0,d2=0,p1[]={7,7,7,7,7,7,7},p2[]={7,7,7,7,7,7,7},B2=0,B1=0,i,j,n,turn=1,posi;
6.
7. void player1()
8. {for(i=n;i>0;i--)
9. {if(posi<7)
10. {p1[posi]+=1;
11. if(p1[posi]-1==0&&i-1==0)
12. {B1+=1;
13. B1+=p2[posi]+p1[posi];
14. p2[posi]=0;
15. i=0;turn++;
16. }
17. ++posi;
18. }
19.
20. else if(posi==7)
21. {B1+=1;
22. posi++;
23. }
24.
25. else
26. {p2[j]+=1;
27. j-=1;
28. if(j<0&&i>0)
29. {B2+=1;
30. posi=0;
31. }
32. }
33. }
34. }
35.
36. void player2()
37. {for(i=n;i>0;i--)
38. {if(posi>=0)
39. {p2[posi]+=1;
40. if(p1[posi]+1==0&&i-1==0)
41. {B2+=1;
42. B2+=p2[posi]+p1[posi];
43. p1[posi]=0;
44. i=0;turn++;
45. }
46. posi--;
47. }
48.
49. else if(posi==-1)
50. {B2+=1;
51. posi--;
52. }
53.
54. else
55. {p1[j]+=1;
56. j+=1;
57. if(j>6&&i>0)
58. {B1+=1;
59. posi=6;
60. }
61. }
62. }
63. }
64.
65. int decision(int d)
66. { d=0;
67. for(i=0;i<7;i++)
68. {if(p1[i]==0)
69. d1+=1;
70. if(p2[i]==0)
71. d2+=1;
72. }
73.
74. if(d1==7||d2==7)
75. {B2+=p2[0]+p2[1]+p2[2]+p2[3]+p2[4]+p2[5]+p2[6];
76. B1+=p1[0]+p1[1]+p1[2]+p1[3]+p1[4]+p1[5]+p1[6];
77.
78. if(B1>B2)
79. printf("player 1 wins");
80. else if(B2>B1)
81. printf("player 2 wins");
82. else printf("Draw Game");
83. d+=1;
84. }
85. return d;
86. }
87.
88. void gameboard()
89. {gotoxy(10,1);
90. printf("[%d] [%d] [%d] [%d] [%d] [%d] [%d]",p2[0],p2[1],p2[2],p2[3],p2[4],p2[5],p2[6]);
91. gotoxy(8,3);
92. printf("[%d]",B2);
93. gotoxy(38,3);printf("[%d]",B1);
94. gotoxy(10,5);
95. printf("[%d] [%d] [%d] [%d] [%d] [%d] [%d]",p1[0],p1[1],p1[2],p1[3],p1[4],p1[5],p1[6]);
96. }
97.
98. void main()
99. {int d=0;//this variable determines if the game is over or not
100. clrscr();
101. do{
102. clrscr();gameboard();
103. gotoxy(10,15);
104. printf("Enter position: ");
105. scanf("%d",&posi);
106. posi-=1;if(posi>0&&posi<6){
107. if(turn%2!=0)
108. {gotoxy(10,3);
109. printf("Player 1");
110. n=p1[posi];
111. j=6;
112. p1[posi]=0;
113. ++posi;
114. player1();
115. }
116. else
117. {gotoxy(10,3);
118. printf("Player 2");j=0;
119. n=p2[posi]=0;++posi;
120. player2();
121. }}
122. decision(d);
123. }while(d<1);
124. getch();
125. }




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users