-
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
목차
[Blackjack]
[bin]
[Image]
[obj]
[Properties]
Blackjack.csproj
cards_png71x96.zip
ClassDiagram1.cd
Form1.cs
Form1.Designer.cs
Form1.resx
GameClass.cs
Program.cs
Blackjack.sln
Blackjack.suo
BlackJack.uml
파일 77, 폴더 9
473KB
BlackJack Game.docx……………………………………3p
1. 개발환경
2. 내용
3. 게임 화면
4. Class 설명
5. Diagram
6. C# Source 파일
[bin]
[Image]
[obj]
[Properties]
Blackjack.csproj
cards_png71x96.zip
ClassDiagram1.cd
Form1.cs
Form1.Designer.cs
Form1.resx
GameClass.cs
Program.cs
Blackjack.sln
Blackjack.suo
BlackJack.uml
파일 77, 폴더 9
473KB
BlackJack Game.docx……………………………………3p
1. 개발환경
2. 내용
3. 게임 화면
4. Class 설명
5. Diagram
6. C# Source 파일
본문내용
1. 개발환경
- OS : Windows 7 32bit
- Language : C#, 닷넷 framework 4.5.1
- Tool : Visual Studio 2010
- UML : StatUML 5.0
2. 내용
- C#을 이용하여 Blackjack game을 개발한다.
- GUI( Winform base)기반으로 개발한다.
- Class Diagram, Sequence Diagram을 기술한다.
< 게임룰>
- User와 Computer가 1:1 게임을 진행한다.
- 총 5개의 Card를 수령할 수 있다.
- A는 1 또는 11의 값을 선택할 수 있다.
- J,Q,K는 10의 값을 선택한다.
- 카드의 총 score합이 21에 가까운 사람이 승리한다.
- 상대가 21을 over할 경우 넘지 않은 사람이 승리한다.
3. 게임 화면
≪ 그 림 ≫
Game Start : 새 게임을 시작한다.
Hit : User가 카드를 한 장 더 받는다.
Stand : User가 카드 수령을 중단한다. Computer는 나머지 카드에 대한 게임을 진행하고
게임이 마무리 된다.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
GameClass.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Blackjack
{
public struct Card
{
public int iIndex;
public int iShape;
public bool bUse;
public void Clear()
{
iIndex = -1;
iShape = -1;
bUse = false;
}
}
public class CardStore
{
Card[] HasCard;
const int cardShapeMax = 4;
const int cardIndexMax = 13;
public CardStore()
{
// create card
HasCard = new Card[cardIndexMax * cardShapeMax];
for (int iShape = 0; iShape < cardShapeMax; iShape++)
{
for (int iIndex = 0; iIndex < cardIndexMax; iIndex++)
{
HasCard[cardIndexMax * iShape + iIndex].Clear();
}
}
}
public void InitCard()
{
for (int iShape = 0; iShape < cardShapeMax; iShape++)
{
for (int iIndex = 0; iIndex < cardIndexMax; iIndex++)
{
HasCard[cardIndexMax * iShape + iIndex].iShape = iShape;
HasCard[cardIndexMax * iShape + iIndex].iIndex = iIndex;
HasCard[cardIndexMax * iShape + iIndex].bUse = false;
}
}
}
public Card GetCard()
{
Card retCard = new Card();
int nCnt = 0;
while (true)
{
System.Threading.Thread.Sleep(100);
Random ran = new Random();
int iIndex = ran.Next(0, cardIndexMax * cardShapeMax);
if (HasCard[iIndex].bUse == false)
{
retCard = HasCard[iIndex];
HasCard[iIndex].bUse = true;
break;
}
nCnt++;
if(nCnt > 100) // avoid endless loop
break;
}
return retCard;
}
public int CheckWin(int user, int computer)
{
// ret 1 : user
// 2 : computer
// 0 : both
int retWin = 0;
//승자 판단부
if (user == computer)
{
retWin = 0;
}
else if (user < 21)//21 이하이다.
{
if (computer == 21)
{
retWin = 2;
}
else if (computer > 21)
{
retWin = 1;
}
else//둘다 21이하다.
{
if (user > computer)
{
retWin = 1;
}
else if (user < computer)
{
retWin = 2;
}
- OS : Windows 7 32bit
- Language : C#, 닷넷 framework 4.5.1
- Tool : Visual Studio 2010
- UML : StatUML 5.0
2. 내용
- C#을 이용하여 Blackjack game을 개발한다.
- GUI( Winform base)기반으로 개발한다.
- Class Diagram, Sequence Diagram을 기술한다.
< 게임룰>
- User와 Computer가 1:1 게임을 진행한다.
- 총 5개의 Card를 수령할 수 있다.
- A는 1 또는 11의 값을 선택할 수 있다.
- J,Q,K는 10의 값을 선택한다.
- 카드의 총 score합이 21에 가까운 사람이 승리한다.
- 상대가 21을 over할 경우 넘지 않은 사람이 승리한다.
3. 게임 화면
≪ 그 림 ≫
Game Start : 새 게임을 시작한다.
Hit : User가 카드를 한 장 더 받는다.
Stand : User가 카드 수령을 중단한다. Computer는 나머지 카드에 대한 게임을 진행하고
게임이 마무리 된다.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
GameClass.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Blackjack
{
public struct Card
{
public int iIndex;
public int iShape;
public bool bUse;
public void Clear()
{
iIndex = -1;
iShape = -1;
bUse = false;
}
}
public class CardStore
{
Card[] HasCard;
const int cardShapeMax = 4;
const int cardIndexMax = 13;
public CardStore()
{
// create card
HasCard = new Card[cardIndexMax * cardShapeMax];
for (int iShape = 0; iShape < cardShapeMax; iShape++)
{
for (int iIndex = 0; iIndex < cardIndexMax; iIndex++)
{
HasCard[cardIndexMax * iShape + iIndex].Clear();
}
}
}
public void InitCard()
{
for (int iShape = 0; iShape < cardShapeMax; iShape++)
{
for (int iIndex = 0; iIndex < cardIndexMax; iIndex++)
{
HasCard[cardIndexMax * iShape + iIndex].iShape = iShape;
HasCard[cardIndexMax * iShape + iIndex].iIndex = iIndex;
HasCard[cardIndexMax * iShape + iIndex].bUse = false;
}
}
}
public Card GetCard()
{
Card retCard = new Card();
int nCnt = 0;
while (true)
{
System.Threading.Thread.Sleep(100);
Random ran = new Random();
int iIndex = ran.Next(0, cardIndexMax * cardShapeMax);
if (HasCard[iIndex].bUse == false)
{
retCard = HasCard[iIndex];
HasCard[iIndex].bUse = true;
break;
}
nCnt++;
if(nCnt > 100) // avoid endless loop
break;
}
return retCard;
}
public int CheckWin(int user, int computer)
{
// ret 1 : user
// 2 : computer
// 0 : both
int retWin = 0;
//승자 판단부
if (user == computer)
{
retWin = 0;
}
else if (user < 21)//21 이하이다.
{
if (computer == 21)
{
retWin = 2;
}
else if (computer > 21)
{
retWin = 1;
}
else//둘다 21이하다.
{
if (user > computer)
{
retWin = 1;
}
else if (user < computer)
{
retWin = 2;
}
추천자료
- 계획안 - 닭싸움 (게임, 전통놀이)
- 비쥬얼베이직을 이용해서 신 야구게임 만들어서 A+ 받았습니다.
- 독후감 - 코리아 앤드게임
- C++ 숫자 야구 게임, 퍼즐 스트라이크 구현하기
- C언어를 이용한 테트리스 게임 프로그램
- 자바 Class를 이용한 숫자 맞추기 게임 프로그램
- ASIC 프로젝트 양궁 게임
- 네트워크 프로그래밍 - 1:1 섯다 게임
- Microsoft visual c++ 6.0을 이용한 보드게임
- C언어를 이용한 가위바위보 게임
- (나와 가족)부분수업계획안_게임
- 자바(JAVA) 야구게임
- 최대한 간단한 함수를 이용한 C언어 야구게임
- (atmega128) 도트매트릭스를 이용한 팽이게임
소개글