================== 서버 ============================ public class Server {public static void main(String[] arg){ServerSocket server = null;BufferedReader in = null;try{// 서버 포트번호 셋팅server = new ServerSocket(12345);System.out.println("Server Ready");while(true){// 클라이언트가 보내는 연결요청을 기다린다.Socket s = server.accept();// 클라이언트가 보낸 데이터를 읽는 객체를 생성한다.in = new BufferedReader(new InputStreamReader(s.getInputS..
종류별 스트림 1바이트 입출력 형식 1. 콘솔 출력 FileOutputStream fos = new FileOutputStream(FileDescriptor.out);BufferedOutputStream bos = new BufferedOutputStream(fos, 1024);DataOutputStream dos = new DataOutputStream(bos);dos.write() 입력 FieInputStream fis = new FileInputStream(FileDescriptor.in);BufferedInputStream bis = new BufferedInputStream(fis,1024);DataInputStream dis = new DataInputStream(bis);dis.read() ..
Update() 함수에 추가 if (isMoveState) { //Vector3 targetPos = transform.position + hitPosition; Vector3 dir = hitPosition - transform.position; Vector3 dirXY = new Vector3(dir.x, dir.y , 0); //Vector3 targetPos = transform.position + (hitPosition - transform.position); Vector3 targetPos = transform.position + dirXY; Vector3 framePos = Vector3.MoveTowards(transform.position, targetPos, moveSpeed * Tim..
리지디바디로 점프 - 물리적 점프GetComponent().velocity = new Vector2(GetComponent().velocity.x, jump); 리지디바디 사용안하고 점프 - 계산식으로 만든 점프 private Vector3 moveDirection = Vector3.zero; Vector3 targetDirection = (new Vector3(CrossPlatformInputManager.GetAxis("Horizontal") * speed, 0f, CrossPlatformInputManager.GetAxis("Vertical") * speed)); if (targetDirection != Vector3.zero) { moveDirection = targetDirection; move..
// 해시 테이블이기는하나 완벽하지 않다.. // 리스트 10칸에 10칸씩 리스트 되어야 맞는 것 같으나 그냥 리스트 10칸에서 다시 해시가 적용된다.. #include #include #include #define TABLE_SIZE 10; typedef struct _node NODE; struct _node { int key; NODE *next; }; int hash_func(int key) { int h; h = key % TABLE_SIZE; return h; } int hsc_init(NODE a[],int *np,int N) { int i; for(i=0;inext = a[tri].next; /* a[tri]는 테이블의 첫라인만 가리킬뿐 값은 들어있지않다. */ t->key = key; /..
#include #include #include #include typedef struct node NODE; struct node { int key; NODE *parent; NODE *left; NODE *right; }; NODE *root; NODE* node_search(int key, NODE *root) { NODE *s; s = root->left; while(key != s->key && s != NULL) { if(key key ) s = s->left; if(key > s->key ) s = s->right; } if(s == NULL) return NULL; else return s; } NODE * node_insert(int key) { NODE *p,*s; p = ro..
#include #include #include #include typedef struct node NODE; struct node { char x[6]; NODE *prev; NODE *next; }; NODE *head = NULL; NODE *tail = NULL; NODE* Find_Node(char *x) { NODE *node; node = (NODE*)malloc(sizeof(NODE)); node = head->next; while(node != tail) { if(strcmp(node->x,x) next != tail) { node = node->next; continue; } else return node; if( strcmp(node->x,x) == 0 ) ..
#include #include #include typedef struct node NODE; typedef struct node { char x[3]; NODE *prev; NODE *next; }NODE; NODE *head = NULL; NODE *tail = NULL; NODE* Find_Node(char *x) { NODE *node; node = (NODE*)malloc(sizeof(NODE)); node = head->next; while(node != tail) { if( strcmp(node->x,x) x,x) == 0) return node; else if( strcmp(node->x,x) > 0 ) return n..
#include void quick_sort(int a[],int n) { int v,t; int i,j; if(n>1) { v = a[n-1]; i = -1; j = n-1; while(1) { while(a[++i] v); if( i >=j ) break; t = a[i]; a[i] = a[j]; a[j] = t; } t = a[i]; a[i] = a[n-1]; a[n-1] = t; quick_sort(a,i); quick_sort(a+i+1,n-i-1); } } void main() { int q; int a[10] = {6,3,1,4,2,9,7,0,8,5}; quick_sort(a,10); for(q=0;q
#include #define MAX 10 int front,rear; char queue[MAX]; void init_queue() { front = rear = 0; } void clear_queue() { front = rear; } int put(char* ch) { if( (rear+1)%MAX == front ) return -1; queue[rear] = *ch; rear = ++rear % MAX; return 0; } int get(char* ch) { if( rear == front ) return -1; *ch = queue[front]; front = ++front % MAX; return 0; } void main() { char a,b,c; init_queue(); put("1"..
- Total
- Today
- Yesterday
- 지원금
- 유머
- 연결 리스트
- 버즈
- 발생후
- 김광석 코드
- 축제
- 김광석 기타 코드
- 임창정
- 청년몽땅정보통
- 공모전
- 문화
- 유니티
- 안드로이드
- 신청
- 아이유
- 태풍발생
- 공연
- 뜻밖의 샤워
- android
- 청년정책
- 서울특별시
- 서울시
- 고양이 깜놀
- 김광석
- 민경훈
- 지원
- Linked List
- 혁오
- 청년
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |