게시판 인덱스

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

4-4 문제 테스트셋

 
글 쓰기   답변 달기     게시판 인덱스 -> 4190.310 Programming Languages (Fall 2012)
이전 주제 보기 :: 다음 주제 보기  
글쓴이 메시지
윤형석



가입: 2012년 9월 5일
올린 글: 26

올리기올려짐: 2012년10월30일 16:18    주제: 4-4 문제 테스트셋 인용과 함께 답변

09년도 프로그래밍의 원리 문제여서, 이쪽에 테스트셋이 많네요.
Smile


https://ropas.snu.ac.kr/phpbb/viewtopic.php?t=1959
위로
사용자 정보 보기 비밀 메시지 보내기
윤형석



가입: 2012년 9월 5일
올린 글: 26

올리기올려짐: 2012년10월30일 17:11    주제: 인용과 함께 답변

이 데이터셋에서 하나 틀린게 있습니다.

# result (Branch(Guide ("x", (Guide ("y", Guide ("z", Guide ("w", Branch (Branch (End (NameBox "x"), End (NameBox "y")), Branch (End (NameBox "z"), End (NameBox "w")))))))), Guide ("a", Branch (End (NameBox "a"),End (NameBox "b"))))) ;;
{-, (-,-), (-,(-,-)), ((-,(-,-)),(-,-))}
- : unit = ()


이 경우에 답이 없는 것이 정상인 듯 합니다.



제가 잘못생각했었네요 Sad


윤형석 가 2012년10월30일 18:56에 수정함, 총 1 번 수정됨
위로
사용자 정보 보기 비밀 메시지 보내기
최근준



가입: 2012년 9월 5일
올린 글: 29

올리기올려짐: 2012년10월30일 17:16    주제: 데이터가 틀린것 같습니다. 인용과 함께 답변

Guide설명에서

e1 안에서 만날 보물상자 x의 열쇠가 α 이고 e1의 시작점이 암시하는 열쇠모양을 β라고 하면, 현재 위치가 암시하는 열쇠모 양은 (α, β)(왼쪽가지 α, 오른쪽가지 β).

라고 했는데

데이터들을 보면 가이드에 써있는 스트링(보물 이름)이 트리안에 없는 경우가 많습니다.
위로
사용자 정보 보기 비밀 메시지 보내기
최근준



가입: 2012년 9월 5일
올린 글: 29

올리기올려짐: 2012년10월30일 17:35    주제: 인용과 함께 답변

데이타 아무거나 만들어봤어요

# result (Guide ("b", Branch (Guide ("a", Branch (Branch (Branch (Guide ("x", (Branch (End (NameBox "x"), End (StarBox)))), Guide ("z", Branch (End (NameBox "y"), End (NameBox "z")))), Branch (End (NameBox "a"), End(NameBox "b"))), Guide ("i", End(NameBox "i")))), Branch (Guide ("c", End (NameBox "c")), Guide ("d", Branch (End (NameBox "d"), Guide ("e", Branch (End (NameBox "e"), Guide ("f", Guide ("g", Branch (Branch (End (NameBox "f"), End (StarBox)), Branch (End (NameBox "g"), End (NameBox "x")))))))))))));;
{((-,(-,((-,-),-))),-), (-,(-,-)), (((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-), (((((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-),-),-), ((((((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-),-),-),-), -, (-,(-,((-,-),-)))}
- : unit = ()
# result (Guide ("b", Branch (Guide ("a", Branch (Branch (Branch (Guide ("x", (Branch (End (NameBox "x"), End (StarBox)))), Guide ("z", Branch (End (NameBox "y"), End (NameBox "z")))), Branch (End (NameBox "a"), End(NameBox "b"))), Guide ("i", End(NameBox "i")))), Branch (Guide ("c", End (NameBox "c")), Guide ("d", Branch (End (NameBox "d"), Guide ("x", Branch (End (NameBox "e"), Guide ("f", Guide ("g", Branch (Branch (End (NameBox "f"), End (StarBox)), Branch (End (NameBox "g"), End (NameBox "x")))))))))))));;
{((-,(-,((-,-),-))),-), (-,(-,-)), (((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-), (((-,(-,((-,-),-))),-),-), ((((-,(-,((-,-),-))),-),-),-), -, (-,(-,((-,-),-)))}
- : unit = ()
위로
사용자 정보 보기 비밀 메시지 보내기
임완률



가입: 2012년 10월 31일
올린 글: 1

올리기올려짐: 2012년10월31일 22:59    주제: 인용과 함께 답변

let rec string_of_key key = match key with
Bar -> "-"
| Node(k1,k2) -> "("^string_of_key k1^","^string_of_key k2^")" ;;

let pprint_keylist kl =
let rec string_of_list f l = match l with
| h::t -> (f h)::(string_of_list f t)
| _ -> []
in
string_of_list string_of_key kl;;

let rec chk a b =
match a with
| h::t -> (List.mem h b)&&(chk t b)
| _ -> true

let result =
fun map ans -> let myans = (pprint_keylist (getReady map)) in (chk myans ans)&&(chk ans myans);;


result (End StarBox) ["-"];;
result (End (NameBox "x")) ["-"];;
result (Guide ("x", End (NameBox "x"))) ["-"];;
result (Branch (Guide ("x", End (NameBox "x")), End StarBox)) ["-"];;
result (Branch (Guide ("x", End (NameBox "x")), Branch (Guide ("y", End (NameBox "y")), End StarBox))) ["-"];;
result (Branch (Guide ("x", End (NameBox "x")), Guide ("y", End (NameBox "y")))) ["-"; "(-,-)"];;
result (Branch (Guide ("x", End (NameBox "x")), Guide ("y", End (NameBox "y")))) ["-"; "(-,-)"];;
result (Guide ("x", Guide ("y", Guide ("z", Branch (Branch (End (NameBox "x"), End (NameBox "y")), End (NameBox "z")))))) ["-"; "(-,(-,-))"];;
result (Branch (End (NameBox "x"), End StarBox)) ["-"; "(-,-)"];;
result (Guide ("x", Guide ("y", Branch (End (NameBox "x"),End (NameBox "y"))))) ["-"; "(-,-)"];;
result (Guide ("x", Guide ("y", Guide ("z", Branch (End (NameBox "x"),Branch (End (NameBox "y"), End (NameBox "z"))))))) ["-"; "(-,-)"];;
result (Branch(Guide ("x", Guide ("y", Branch (End (NameBox "y"), End (NameBox "x")))), Branch (End (NameBox "z"), End (NameBox "w")))) ["-"; "(-,-)"];;
result (Branch(Guide ("x", (Guide ("y", Guide ("z", Guide ("w", Branch (Branch (End (NameBox "x"), End (NameBox "y")), Branch (End (NameBox "z"), End (NameBox "w")))))))), Guide ("a", Branch (End (NameBox "a"),End (NameBox "b"))))) ["-"; "(-,-)"; "(-,(-,-))"; "((-,(-,-)),(-,-))"];;
result (Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")), Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f")))) ["-"; "(-,(-,-))"; "(-,(-,(-,-)))"];;
result (Branch(Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")),Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f"))),Guide ("x", Branch(End (NameBox "x"), End StarBox)))) ["-"; "(-,-)"; "(-,(-,-))"; "(-,(-,(-,(((-,-),-),-))))"];;
result (Branch(Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")),Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f"))),Branch(End (NameBox "b"), End StarBox))) ["-"; "(-,(-,-))"; "(-,-)"; "((-,-),(-,(-,(-,-))))"];;
result (Branch(Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")),Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f"))),Branch(End (NameBox "f"), End StarBox))) ["-"; "(-,-)"; "(-,((-,-),-))"; "(-,(-,(-,(-,-))))"];;
result (Branch(Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")),Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f"))),Branch(End (NameBox "d"), End StarBox))) ["-"; "(-,(-,-))"; "(-,(-,(-,((-,-),-))))"];;
result (Branch(Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")),Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f"))),Branch(End (NameBox "c"), End StarBox))) ["-"; "(-,(-,-))"; "(-,-)"; "(-,((-,-),(-,(-,-))))"];;

let testcmd = (Guide ("ab", (Branch ((End (NameBox "ab")) , (Guide ("ac", (Branch
((Guide ("ad", (Branch ((Guide ("ae", (Guide ("af", (Branch ((End (NameBox "af")) , (Branch ((Branch ((Branch ((Guide ("ag",
(Branch ((End (NameBox "ag")) , (End (NameBox "ah")))))) , (End (NameBox "ai"))))
, (Branch ((End (NameBox "aj")) , (Branch ((Branch ((Branch ((End (NameBox "ak")) , (End (NameBox "al"))))
, (Branch ((End (NameBox "am")) , (End (NameBox "an"))))
)) , (End (NameBox "ao")))) )))) , (Branch ((Guide ("ap", (End (NameBox "ap")))) , (End (NameBox "aq"))))
)) )) )))) , (End (NameBox "ar")))) )) , (Guide ("as", (Branch ((Branch ((Branch ((Guide ("at", (Branch ((End (NameBox "at"))
, (Guide ("au", (End (NameBox "au")))))))) , (Guide ("av", (Branch ((Branch ((Branch ((Guide ("aw",
(Branch ((Branch ((End (NameBox "aw")) , (End (NameBox "ax")))) , (Branch ((End (NameBox "ay")) , (End (NameBox "az"))))
)) )) , (Guide ("ba", (Guide ("bb", (Branch ((End (NameBox "bb")) , (End (NameBox "bc"))))
)))))) , (Branch ((Branch ((Branch ((Branch ((End (NameBox "bd")) , (End (NameBox "be"))))
, (Branch ((End (NameBox "bf")) , (End (NameBox "bg")))) )) , (End (NameBox "bh"))))
, (Branch ((Branch ((End (NameBox "bi")) , (Branch ((End (NameBox "bj")) , (End (NameBox "bk"))))
)) , (Branch ((Branch ((End (NameBox "bl")) , (End (NameBox "bm")))) , (Branch ((End (NameBox "bn")) , (End (NameBox "bo"))))
)) )) )) )) , (End (NameBox "bp")))))))) , (Branch ((Branch ((End (NameBox "bq")) , (Branch ((Guide ("br"
, (Branch ((End (NameBox "br")) , (Branch ((Branch ((Branch ((End (NameBox "bs")) , (End (NameBox "bt")))) ,
(Branch ((End (NameBox "bu")) , (End (NameBox "bv")))) )) , (Branch ((Branch ((End (NameBox "bw")) , (End (NameBox "bx"))))
, (End (NameBox "by")))))))))) , (Branch ((Guide ("bz", (End (NameBox "bz")))) , (Guide ("ca", (Branch ((End (NameBox "ca"))
, (End (NameBox "cb")))) )))))))) , (Guide ("cc", (Branch ((Branch ((End (NameBox "cc")) , (Branch ((Guide ("cd", (Guide
("ce", (End (NameBox "ce")))))) , (Branch ((Guide ("cf", (Branch ((End (NameBox "cf")) , (End (NameBox "cg")))))) ,
(Branch ((End (NameBox "ch")) , (End (NameBox "ci")))))))))) , (Branch ((Branch ((Branch ((Branch((Branch ((End (NameBox "cj"))
, (End (NameBox "ck")))) , (Branch ((End (NameBox "cl")) , (End (NameBox "cm"))))))
, (Guide ("cn", (Branch ((End (NameBox "cn")) , (End (NameBox "co")))))))) , (Guide ("cp", (Branch ((Guide ("cq",
(End (NameBox "cq")))) , (Branch ((End (NameBox "cr")) , (End (NameBox "cs")))))))))) , (Branch ((Branch ((Branch
((End (NameBox "ct")) , (Branch ((End (NameBox "cu")) , (End (NameBox "cv")))))) , (Branch ((End (NameBox "cw"))
, (Guide ("cx", (End (NameBox "cx")))))))) , (Branch ((Branch ((Branch ((End (NameBox "cy")) , (End (NameBox "cz"))))
, (Branch ((End (NameBox "da")) , (End (NameBox "db")))))) , (Guide ("dc", (Branch ((End (NameBox "dc"))
, (End (NameBox "dd")))))))))))))))))))) , (Guide ("de", (End (NameBox "de"))))))))))))))))
in
let ans = ["-"; "(-,-)"; "(-,(-,-))"; "(-,(-,(-,-)))"; "(-,(-,(-,(-,-))))"; "(-,(-,(-,(-,(-,((-,-),-))))))"; "(-,(-,(-,(-,((-,-),-)))))"; "(-,(-,(((-,-),-),-)))"; "(-,(-,(((-,-),-),((-,-),(-,-)))))"; "(-,((-,(-,(-,(-,((-,-),-))))),(-,(-,(-,((-,-),-))))))"; "(-,((((-,-),(-,-)),-),-))"; "((-,-),-)"; "((-,-),(-,-))"; "((-,-),(-,((-,-),-)))"; "((-,((-,-),-)),-)"] in
result testcmd ans;;
let testcmd = (Branch ((Guide ("xebec", (End (NameBox "xebec")))) , (Branch ((End (NameBox "xenia")) ,
(Branch ((Branch ((Branch ((Branch ((Branch ((Branch ((Guide ("xenon", (Branch ((Branch ((Branch
((End (NameBox "xenon")) , (End (NameBox "xenophobia")))) , (Branch ((End (NameBox "xeric")) ,
(End (NameBox "xerophilous")))))) , (End (NameBox "xerophthalmia")))))) , (Branch ((Branch
((Guide ("xerophyte", (Branch ((End (NameBox "xerophyte")) , (End (NameBox "xylem")))))) ,
(Guide ("xylophone", (Guide ("y", (End (NameBox "y")))))))) , (Branch ((Guide ("yacht", (Branch
((End (NameBox "yacht")) , (End (NameBox "yachting")))))) , (Branch ((Branch ((End (NameBox "yachtsman")) ,
(End (NameBox "yahoo")))) , (Branch ((End (NameBox "yak")) , (End (NameBox "yam")))))))))))) ,
(Branch ((Branch ((Branch ((End (NameBox "yammer")) , (Branch ((End (NameBox "yank")) ,
(Guide ("yanqui", (End (NameBox "yanqui"))))))))
, (Branch ((Guide ("yap", (End (NameBox "yap")))) , (Guide ("yard", (Branch ((End (NameBox "yard")) ,
(End (NameBox "yardage")))))))))) , (Branch ((Branch ((Branch ((End (NameBox "yardarm")) , (End (NameBox "yardman"))))
, (Branch ((End (NameBox "yardmaster")) , (Branch ((End (NameBox "yardstick")) , (End (NameBox "yarn"))))))))
, (Branch ((End (NameBox "yarrow")) , (End (NameBox "yaw")))))))))) , (Branch ((Branch ((Branch ((Branch ((End (NameBox "yawl"))
, (Branch ((Branch ((End (NameBox "yawn")) , (End (NameBox "yaws"))))
, (Branch ((End (NameBox "yclept")) , (End (NameBox "ye")))))))) , (Branch ((Branch ((Branch ((End (NameBox "yea")) , (End (NameBox "yean"))))
, (Branch ((End (NameBox "yeanling")) , (End (NameBox "year")))))) , (End (NameBox "yearbook")))))) , (Branch ((Guide ("yearling", (Branch
((End (NameBox "yearling")) , (End (NameBox "yearlong")))))) , (Guide ("yearly", (Branch ((Branch ((End (NameBox "yearly")) ,
(End (NameBox "yearn")))) , (Branch ((End (NameBox "yearning")) , (End (NameBox "yeast"))))))))))))
, (Guide ("yeasty", (Guide ("yell", (Branch ((Guide ("yellow", (End (NameBox "yellow")))) , (Branch ((Branch ((End (NameBox "yellowish")) ,
(End (NameBox "yelp")))) , (Guide ("yen", (End (NameBox "yen")))))))))))))))) , (Branch ((Branch ((Branch
((Branch ((End (NameBox "yeoman")) , (Branch ((Branch ((End (NameBox "yeomanry")) , (Branch ((End (NameBox "yes")) ,
(End (NameBox "yesterday")))))) , (End (NameBox "yesteryear")))))) , (Guide ("yet", (Branch ((Branch ((End (NameBox "yet"))
, (Branch ((End (NameBox "yew")), (End (NameBox "yield")))))) , (End (NameBox "yielding")))))))) ,
(Branch ((Branch ((End (NameBox "yodel")) , (End (NameBox "yoga")))) , (Branch ((Branch ((Branch ((Branch ((End (NameBox "yogi"))
, (End (NameBox "yogurt")))) , (Branch ((End (NameBox "yoke")) , (End (NameBox "yokel"))))
)) , (Branch ((Branch ((End (NameBox "yolk")) , (End (NameBox "yon")))) , (Branch ((End (NameBox "yonder")) ,
(End (NameBox "yore")))))))) , (End (NameBox "you")))))))) , (Branch ((End (NameBox "young")) , (End (NameBox "youngish"))))))
)) , (Guide ("youngling", (Branch ((End (NameBox "youngling")) , (Branch ((End (NameBox "youngster")) , (End (NameBox "younker")))))))))) ,
(Branch ((Branch ((Branch ((Branch ((Branch ((End (NameBox "your")) , (Guide ("yours", (End (NameBox "yours")))))) ,
(Branch ((Branch ((Branch ((Branch ((Guide ("yourself", (End (NameBox "yourself")))) , (Branch ((End (NameBox "youth")) ,
(End (NameBox "youthful")))))) , (Guide ("yowl", (Branch ((End (NameBox "yowl")) , (End (NameBox "ytterbium"))))
)))) , (End (NameBox "yttrium")))) , (Guide ("yuan", (End (NameBox "yuan")))))))) , (End (NameBox "yucca")))) ,
(Branch ((Branch ((Branch ((Branch ((End (NameBox "yule")) , (Branch ((End (NameBox "yuletide")) , (Branch ((Branch ((End (NameBox "yummy")) ,
(End (NameBox "z")))) , (End (NameBox "zany")))))))) , (End (NameBox "zeal")))) , (Guide ("zealot", (Branch ((Branch ((End (NameBox "zealot"))
, (Guide ("zealous", (Branch ((End (NameBox "zealous")) , (End (NameBox "zebra")))))))) , (Branch ((Guide ("zebu", (End (NameBox "zebu"))))
, (End (NameBox "zed")))))))))) , (End (NameBox "zeitgeist")))))) , (Branch ((End (NameBox "zenana")) ,
(Branch ((Branch ((End (NameBox "zenith")) , (End (NameBox "zephyr")))) , (Branch ((Guide ("zeppelin", (End (NameBox "zeppelin")))) ,
(Branch ((Branch ((Branch ((Branch ((Branch ((End (NameBox "zero")) , (End (NameBox "zest")))) , (Branch ((End (NameBox "zigzag")) ,
(End (NameBox "zinc")))))) , (Branch ((Branch ((End (NameBox "zing")) , (End (NameBox "zinnia")))) , (Branch ((End (NameBox "zip")) ,
(End (NameBox "zipper")))))))) , (Guide ("zippy", (End (NameBox "zippy")))))) , (Guide ("zircon", (Branch ((Branch
((Guide ("zirconium", (End (NameBox "zirconium")))) , (End (NameBox "zither")))) , (Branch ((Branch ((End (NameBox "zloty"))
, (End (NameBox "zodiac")))) , (Branch ((End (NameBox "zombie")) , (End (NameBox "zonal"))))))))))))))))))))))))))
in
let ans = ["-"; "(-,-)"; "(-,(-,-))"; "(-,(-,(-,-)))"; "(-,(-,(-,(-,-))))"; "(-,(-,(-,(-,(-,(-,(-,(-,(-,(((-,-),-),(-,-)))))))))))"; "(-,(-,(-,(-,(-,(-,(-,(((-,-),-),(-,-)))))))))"; "(-,(-,(-,(-,(-,(-,(((-,-),-),(-,-))))))))"; "(-,(-,(-,((-,-),((-,-),-)))))"; "(-,(-,(-,((-,(-,-)),-))))"; "(-,(-,(((((-,-),-),(-,-)),-),(-,-))))"; "(-,((-,-),-))"; "(-,((-,(-,(-,(-,(-,(-,(((-,-),-),(-,-)))))))),(-,(-,(-,(-,(-,(-,(((-,-),-),(-,-))))))))))"; "(-,(((-,-),-),(-,-)))"; "(-,(((-,-),-),(-,((-,-),-))))"; "(-,(((-,(-,-)),-),(-,(-,-))))"; "((-,-),-)"; "((-,-),(-,(-,(-,(-,-)))))"; "((-,(-,-)),-)"; "(((-,-),-),(-,-))"; "(((-,-),-),(-,((-,-),-)))"] in
result testcmd ans;;
let testcmd = (Branch ((End (NameBox "ab")) , (Branch ((Branch ((Branch ((Branch
((Guide ("ac", (Guide ("ad", (Guide ("ae", (Guide ("af", (Guide ("ag", (End (NameBox "ag")))))))))))) , (End (NameBox "ah"))))
, (Branch ((Branch ((Branch ((Branch ((Branch ((Branch ((End (NameBox "ai")) , (End (NameBox "aj"))))
, (Guide ("ak", (End (NameBox "ak")))))) , (Branch ((End (NameBox "al")) , (Guide ("am", (End (NameBox "am"))))))
)) , (Branch ((Branch ((End (NameBox "an")) , (Branch ((End (NameBox "ao")) , (End (NameBox "ap"))))
)) , (Guide ("aq", (End (NameBox "aq")))))))) , (End (NameBox "ar"))))
, (Branch ((End (NameBox "as")) , (Branch ((Branch ((End (NameBox "at")) , (End (NameBox "au"))))
, (Branch ((Guide ("av", (Branch ((End (NameBox "av")) , (End (NameBox "aw"))))
)) , (Branch ((Guide ("ax", (End (NameBox "ax")))) , (End (NameBox "ay"))))
)))))))))) , (End (NameBox "az")))) , (Branch ((Branch ((Guide ("ba", (Branch ((Branch ((Branch ((Branch ((End (NameBox "ba")) ,
(Branch ((End (NameBox "bb")) , (End (NameBox "bc")))))) , (End (NameBox "bd")))) ,
(Guide ("be", (Guide ("bf", (Branch ((End (NameBox "bf")) , (End (NameBox "bg")))) ))))))
, (Branch ((Branch ((End (NameBox "bh")) , (Branch ((Branch ((End (NameBox "bi")) , (End (NameBox "bj"))))
, (End (NameBox "bk")))) ))
, (Branch ((Branch ((Branch ((End (NameBox "bl")) , (End (NameBox "bm"))))
, (Guide ("bn", (End (NameBox "bn"))))))
, (Branch ((Branch ((End (NameBox "bo")) , (End (NameBox "bp"))))
, (Branch ((End (NameBox "bq")) , (End (NameBox "br")))) ))
)) )) )) )) , (End (NameBox "bs")))) , (End (NameBox "bt")))) )) ))
in
let ans = ["-"; "(-,-)"; "(-,(-,-))"; "(-,(-,((-,((-,-),-)),(-,(-,-)))))"; "(-,((-,-),-))"; "(-,((-,-),(-,-)))"; "(-,((-,-),(-,(-,(-,(-,-))))))"; "((-,-),-)"] in
result testcmd ans;;
let testcmd = (Branch ((Guide ("Bill", (End (NameBox "Bill")))) , (Branch ((Branch ((Guide
("Claudette", (Branch ((Branch ((End (NameBox "Claudette")) , (End (NameBox "Danny")))) , (Branch ((End (NameBox "Erika")) ,
(Guide ("Fred", (End (NameBox "Fred")))))))))) , (Branch ((Branch ((Branch ((Branch ((End (NameBox "Grace")) ,
(End (NameBox "Henri")))) , (Branch ((End (NameBox "Ida")) , (End (NameBox "Joaquin")))))) , (End (NameBox "Kate")))) ,
(Branch ((End (NameBox "Larry")) , (Branch ((End (NameBox "Mindy")) , (Guide ("Nicholas", (End (NameBox "Nicholas"))))))))))))
, (Branch ((Branch ((End (NameBox "Odette")) , (Guide ("Peter", (Guide ("Rose", (Branch ((End (NameBox "Rose")) ,
(End (NameBox "Sam")))))))))) , (Branch ((Branch ((Guide ("Teresa", (End (NameBox "Teresa")))) , (End (NameBox "Victor"))))
, (End (NameBox "Wanda"))))))))))
in
let ans = ["-"; "(-,-)"; "(-,(-,(-,-)))"; "(-,(-,(-,(-,(-,(-,(-,-)))))))"; "((-,-),-)"; "((-,((-,-),-)),(-,-))"] in
result testcmd ans;;

result (Guide ("b", Branch (Guide ("a", Branch (Branch (Branch (Guide ("x", (Branch (End (NameBox "x"), End (StarBox)))), Guide ("z", Branch (End (NameBox "y"), End (NameBox "z")))), Branch (End (NameBox "a"), End(NameBox "b"))), Guide ("i", End(NameBox "i")))), Branch (Guide ("c", End (NameBox "c")), Guide ("d", Branch (End (NameBox "d"), Guide ("e", Branch (End (NameBox "e"), Guide ("f", Guide ("g", Branch (Branch (End (NameBox "f"), End (StarBox)), Branch (End (NameBox "g"), End (NameBox "x"))))))))))))) ["((-,(-,((-,-),-))),-)"; "(-,(-,-))"; "(((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-)"; "(((((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-),-),-)"; "((((((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-),-),-),-)"; "-"; "(-,(-,((-,-),-)))"];;
result (Guide ("b", Branch (Guide ("a", Branch (Branch (Branch (Guide ("x", (Branch (End (NameBox "x"), End (StarBox)))), Guide ("z", Branch (End (NameBox "y"), End (NameBox "z")))), Branch (End (NameBox "a"), End(NameBox "b"))), Guide ("i", End(NameBox "i")))), Branch (Guide ("c", End (NameBox "c")), Guide ("d", Branch (End (NameBox "d"), Guide ("x", Branch (End (NameBox "e"), Guide ("f", Guide ("g", Branch (Branch (End (NameBox "f"), End (StarBox)), Branch (End (NameBox "g"), End (NameBox "x"))))))))))))) ["((-,(-,((-,-),-))),-)"; "(-,(-,-))"; "(((-,(-,-)),(((-,(-,((-,-),-))),-),-)),-)"; "(((-,(-,((-,-),-))),-),-)"; "((((-,(-,((-,-),-))),-),-),-)"; "-"; "(-,(-,((-,-),-)))"];;

result (Branch(Guide ("x", Branch (End (NameBox "x"), End (NameBox "x"))), End StarBox)) [];;
result (Branch(Guide ("x", Branch (End (NameBox "x"), End (NameBox "x"))),Guide ("y", Branch (End (NameBox "y"), End (NameBox "y"))))) [];;
result (Branch(Guide ("z", End (NameBox "w")), Branch(Guide ("x", Branch (End (NameBox "x"), End (NameBox "x"))),Guide ("y", Branch (End (NameBox "y"), End (NameBox "y")))))) [];;
result (Branch(Guide ("x", (Guide ("y", Guide ("z", Guide ("w", Branch (Branch (End (NameBox "x"), End (NameBox "y")), Branch (End (NameBox "z"), End (NameBox "w")))))))), End StarBox)) [];;
result (Branch(Guide ("x", (Guide ("y", Guide ("z", Guide ("w", Branch (Branch (End (NameBox "x"), End (NameBox "y")), Branch (End (NameBox "z"), End (NameBox "w")))))))), Guide ("a", End StarBox))) [];;
result (Branch(Branch(Branch(Branch(End (NameBox "a"), End(NameBox "b")), End(NameBox "c")),Branch(Branch(End (NameBox "d"), End(NameBox "e")), End(NameBox "f"))),Branch(End (NameBox "a"), End StarBox))) [];;

위 링크와 이 글에 달린 테스트셋들을 눈으로 비교하려니 힘들어서..
마지막 6개는 에러나고
나머지는 참이면 기존 테스트셋의 결과와 동일합니다.
위로
사용자 정보 보기 비밀 메시지 보내기
이전 글 표시:   
글 쓰기   답변 달기     게시판 인덱스 -> 4190.310 Programming Languages (Fall 2012) 시간대: GMT + 9 시간(한국)
페이지 11

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


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