게시판 인덱스

 
 FAQFAQ   검색검색   멤버리스트멤버리스트   사용자 그룹사용자 그룹   사용자 등록하기사용자 등록하기 
 개인 정보개인 정보   비공개 메시지를 확인하려면 로그인하십시오비공개 메시지를 확인하려면 로그인하십시오   로그인로그인 

2-3번 testcase입니다.

 
이 게시판은 잠겼으므로 글을 올리거나, 답변을 하거나 수정을 할 수 없습니다   이 주제는 잠겼으므로 답변을 하거나 수정을 할 수 없습니다     게시판 인덱스 -> 4190.210 Principles of Programming (Fall 2008)
이전 주제 보기 :: 다음 주제 보기  
글쓴이 메시지
고윤석



가입: 2008년 9월 26일
올린 글: 11

올리기올려짐: 2008년9월26일 3:37    주제: 2-3번 testcase입니다. 인용과 함께 답변

숙제는 잘들 하고 계신가요?

멍청하면 몸이 고생이라고.. 끝없는 삽질의 연속이군요. Crying or Very sad
혹시라도 콘크리트 바닥에 삽질하는데 도움이 되었으면 하는 바램에
제가 쓰던 testcase를 공개합니다.

2-3 "어울리지 않아"의 testcase입니다.
원 출처는 작년인가 재작년 게시판이며, 저에게 필요한 testcase를 추가로 더 넣었습니다.
전 이제서야 간신히 모두 통과했네요. Smile
잠좀 잡시다. -_-;;;


코드:

; test set
; 1023 = 10(1)+23
(if (not (match-it '(1 0 2 3) (dot (dot (dot (dot (atom 1) (atom 0)) (plus (atom 1))) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 10 = 10(1)+
(if (not (match-it '(1 0) (dot (dot (atom 1) (atom 0)) (plus (atom 1))))) (display "right!") (display "wrong!")) (newline)
; 101 = 10(1)+
(if (match-it '(1 0 1) (dot (dot (atom 1) (atom 0)) (plus (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1001 = (10)+1
(if (not (match-it '(1 0 0 1) (dot (plus (dot (atom 1) (atom 0))) (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1011 = (10)+1
(if (not (match-it '(1 0 1 1) (dot (plus (dot (atom 1) (atom 0))) (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1010101 = (10)+1
(if (match-it '(1 0 1 0 1 0 1) (dot (plus (dot (atom 1) (atom 0))) (atom 1))) (display "right!") (display "wrong!")) (newline)
; 1001 = 1(0)+1
(if (match-it '(1 0 0 1) (dot (dot (atom 1) (plus (atom 0))) (atom 1))) (display "right!") (display "wrong!")) (newline)
; 10001 = 1(0)+1
(if (match-it '(1 0 0 0 1) (dot (dot (atom 1) (plus (atom 0))) (atom 1))) (display "right!") (display "wrong!")) (newline)
; 10010 = 1(0)+1
(if (not (match-it '(1 0 0 1 0) (dot (dot (atom 1) (plus (atom 0))) (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1949410 = ((94|1)+|7)0
(if (match-it '(1 9 4 9 4 1 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0))) (display "right!") (display "wrong!")) (newline)
; 94194170 = ((94|1)+|7)0
(if (not (match-it '(9 4 1 9 4 1 7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0)))) (display "right!") (display "wrong!")) (newline)
; 70 = ((94|1)+|7)0
(if (match-it '(7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0))) (display "right!") (display "wrong!")) (newline)
; 170 = ((94|1)+|7)0
(if (not (match-it '(1 7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0)))) (display "right!") (display "wrong!")) (newline)
; 11719470 = ((94|1)+|7)0
(if (not (match-it '(1 1 7 1 9 4 7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0)))) (display "right!") (display "wrong!")) (newline)
; 12313321 = (1|2|3)+
(if (match-it '(1 2 3 1 3 3 2 1) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 13313322 = (1|2|3)+
(if (match-it '(1 3 3 1 3 3 2 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 31113121 = (1|2|3)+
(if (match-it '(3 1 1 1 3 1 2 1) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 22123222 = (1|2|3)+
(if (match-it '(2 2 1 2 3 2 2 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 33333333 = (1|2|3)+
(if (match-it '(3 3 3 3 3 3 3 3) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 12313322 = (1|2|3)+
(if (match-it '(1 2 3 1 3 3 2 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 12413321 = (1|2|3)+
(if (not (match-it '(1 2 4 1 3 3 2 1) (plus (bar (bar (atom 1) (atom 2)) (atom 3))))) (display "right!") (display "wrong!")) (newline)
; 12310112 = (1|2|3)+
(if (not (match-it '(1 2 3 1 0 1 1 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3))))) (display "right!") (display "wrong!")) (newline)
위로
사용자 정보 보기 비밀 메시지 보내기 글 올린이의 웹사이트 방문
이남구
손님





올리기올려짐: 2008년9월26일 14:59    주제: 감사합니다! 인용과 함께 답변

테스트셋 감사합니다!

잘 활용하겠습니다~
위로
이연석



가입: 2008년 9월 5일
올린 글: 17

올리기올려짐: 2008년9월26일 19:49    주제: 우와... 인용과 함께 답변

감사합니다!!!

잘 쓸게요 ㅋㅋ
위로
사용자 정보 보기 비밀 메시지 보내기
이전 글 표시:   
이 게시판은 잠겼으므로 글을 올리거나, 답변을 하거나 수정을 할 수 없습니다   이 주제는 잠겼으므로 답변을 하거나 수정을 할 수 없습니다     게시판 인덱스 -> 4190.210 Principles of Programming (Fall 2008) 시간대: GMT + 9 시간(한국)
페이지 11

 
건너뛰기:  
새로운 주제를 올릴 수 없습니다
답글을 올릴 수 없습니다
주제를 수정할 수 없습니다
올린 글을 삭제할 수 없습니다
투표를 할 수 없습니다


Powered by phpBB 2.0.21-7 (Debian) © 2001, 2005 phpBB Group
Translated by kss & drssay