목록OSSU_CS coursework (18)
무냐의 개발일지

학습목표ENCAPSULATION !! PROGRAM EFFICIENCYBe able to write well-formed local expressions.Be able to diagram lexical scoping on top of expressions using local.Be able to hand-evaluate local expressions.Be able to use local to encapsulate function definitions.Be able to use local to avoid redundant computation. Local Expression : 특정 코드 안에서만 정의되는 코드rkt는 Intermediate으로 업그레이드됐다!! (local [(define a 1) ..

| Cross Product Table경우의 수가 4개가 있고, 그에 대해 일일이 테스트해줘야 한다 일단, lsta가 empty인 경우를 하나로 묶을 수 있고나머지 경우들 (a가 empty가 절대 아닌 경우) 를 다뤄준다!! 둘 다 list였기 때문에, 이 type comment 가 function의 생김새를 규정지어줬다 프로그램 디자이너의 큰 차이점 !!! 코드를 간결하게 만든다 | P2_ Pattern 너 증말 똑똑하구나!? 한 번에 풀었어! listA의 pattern에 listB가 부합하면 true, 하나라도 틀리거나, listb가 짧으면 false ;;Pattern ListOf1String -> Boolean;;determine whether ListOf1String matches th..

앞에 배웠던 내용이 쭉 나오긴 하는데, 엄청 재밌는 편이다오히려 Mutual Reference 덕분에 함수가 더 쉽게 풀리는 느낌 !!!말그대로 element & List Of Element가 서로를 지칭하면서 루프를 만드는 형태의 함수이다코딩 재미쭤 Woman (Listof Man, Listof Woman)Man (Listof Man, Listof Woman) List of Woman (Woman, List of Woman) ;SRList of Man (Man, List of Man) ;SR Woman LOM (MR)Woman LOW (MR)Man LOM (MR)Man LOW (MR) Arbitrary Arity Trees Back tracking search : 잎노드까..

빈 리스트도 리스트다Base Case를 먼저 test 하는 게 중요하다 !!! 비어있는 리스트인지 아닌지를 먼저 확인! The base case test should always appear first for self-referential functions, because it's the simplest and all the other tests depened on it being correct.;;ListOfString is one of:;; -empty;; -(cons String ListOfString) ; this is a self-reference;;interp. a list of strings;(define LOS1 empty)(define LOS2 (cons "McGill" empty)..

벌써 3주차다!!이거 듣고 리트코드 푸니까, 속도도 확연히 빨라졌고, 코드도 깔끔해지고 자신감이 생긴다.공부한 게 성과로 나타나니까 매우 뿌듯하다 :-) | 개요 In this module you will learn how to design interactive programs that use the DrRacket big-bang functionality. We will make simple animations of animals walking across the screen that can be controlled by the keyboard and the mouse. 여기서는 애니메이션을 만들어본단다!!!! > HtDW creates HtDD and HtDF sub-tasks. | The b..

| Cond expressions2개 이상의 조건이 있을 때 cond [(조건) (답)] (require 2htdp/image)(define I1 (rectangle 10 20 "solid" "red"))(define I2 (rectangle 20 20 "solid" "red"))(define I3 (rectangle 20 10 "solid" "red"))(define (aspect-ratio img) (cond [(> (image-height img) (image-width img)) "tall"] [(= (image-height img) (image-width img)) "square"] [else "wide"]))(aspect-rati..
👩💻 #1. Numbers to Mandarin # Problem 3 # There are words for each of the digits from 0 to 10. # trans = {'0':'ling', '1':'yi', '2':'er', '3':'san', '4': 'si', '5':'wu', '6':'liu', '7':'qi', '8':'ba', '9':'jiu', '10': 'shi'} # Example Usage # convert_to_mandarin('36') will return san shi liu # convert_to_mandarin('20') will return er shi # convert_to_mandarin('16') will return shi liu 💡 풀이 def c..
👩💻 문제 #1 (minimum금액 갚을 때, 1년 후 최종 balance) Problem 1 - Paying Debt off in a Year 0.0/10.0 points (graded) Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month. The following variables contain values as described below: balance - the outstanding balance on the credit card annualInteres..