U E D R , A S I H C RSS

��호/����

다른 사람과 비�하니 구조가 너무 다르군... 나만 ��드 리스트로 짰나...
? : 문� �렇게 좋�줄 �제서야 알다니.
아무튼 미완성. ��� 안하고 소스 짜고...
컴파�러� 없어서 메모장�서 작업하고...
조금만 ë�” 짜면 ë� í…Œì§€ë§Œ 미완성 ë€ë„ 완성시켜ë�„ 메모장ì—�서 소스 짜버려 제대로 ë�Œì•„갈지ë�„ ì�˜ë¬¸ì�´ê³ ...
그래서 나온 버그 잡�바� 새로 코딩하는게 나�테고 !@#!$$@#^%!^$!%
아무튼... 밥�나 먹�. 사랑스러운 나� 밥.


~cpp 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int check(int array[]);
void print_card();


typedef struct _home {
	struct _home *next;
	struct _home *prev;
	int num;
	char name[20];
} HOME;

HOME *head;
head = (HOME *)malloc(sizeof(HOME));




main(int argc, char *argv[]){
FILE *fp;
int i, j;
HOME *buf = head;
int array[52];	// 다� 체�할 배열.
int count;	// � 몇 번 체�해야하는가?
char itoa_buf[3];

	if(argc != 2)
		fprintf(stderr, "Usage: %s input_file", argv[0]), exit(1);

	if((fp=fopen(argv[1], "ra") == NULL)
		fprintf(stderr, "fopen error(%s)", argv[1]), exit(1);



	strcpy(head->name, "2 of Clubs");

	for(j=1; j<=4; j++){
		for(i=1; i<=13; i++){
			if(i==1 && j ==1) continue;

			buf->next = (HOME *)malloc(sizeof(HOME));
			buf->next->prev = buf;
			buf = buf->next;


			itoa(itoa_buf, i+1, 10);

			// 카드 초기화.
			sprintf(buf->name, "%s of %s",
							i==10?"Jack":i==11?"Queen":i==12?"King":i==13?"Ace":itoa_buf,
							j==1?"Clubs":j==2?"Diamonds":j==3?"Hearts":"Spades");
		}
	}


// 52개� 순서 초기화. (따로 밖으로 내는게 편하다는 ��� 든다.)
	buf = head;
	for(i=0; i<52; i++){
		buf.num = array[i];
		buf = buf->next;
	}


############################################
// (count - 1) 번 체� (미완성)
// File�서 array로 바� 것� �어와 함수를 수행 하는 것� count-1번 반복한다.
	for(i=1; i<count; i++)
	{
		for(j=0; j<52; j++)
			array[j] = ;

		check(array);
	}
############################################

	exit(0);	// 우아한 종료!
}




############################################
// buf와 array를 비�한다. (미완성)
// 달�진곳� save ��터� 주소를 저장하고 다시 체�를 시작해 달�진곳� 나오면 �리를 �체한다.
// ��만 �체 시킨다.
int check(int array[])
{
HOME *buf = head;
HOME *save = head;

}
############################################

// 간단한 출력.
void print_card()
{
int i;
HOME *buf = head;

	for(i=0; i<52; i++){
		printf("%s\n", buf->name);
		buf=buf->next;
	}
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:32
Processing time 0.0189 sec