(newLISP) 로또 번호 생성 In newLISP (slice (randomize (sequence 1 45)) 0 6) ; 로또 1등이 얼마나 되기 어려운지 실험 (define (lotto) (slice (randomize (sequence 1 45)) 0 6)) (let (i 0) (while (!= n '(1 2 3 4 5 6)) (++ i) (setq n (lotto)) (println i " " n))) My Computer Programs 2013.07.26
(newlisp) port scan http://www.h-i-r.net/2009/07/network-programming-and-distributed.html #!/usr/bin/newlisp (set 'params (main-args)) (when (< (length params) 5) (println "USAGE: " (params 0) " " (params 1) " host begin-port end-port") (exit)) (set 'host (nth 2 params)) (set 'bport (int (nth 3 params))) (set 'eport (int (nth 4 params))) (for (port bport eport) (print port) (set 'socket (net-connect host port 1000).. My Computer Programs 2013.07.22
(Paren) 로또 번호 생성 In Paren (set contains? (fn (x lst) (set found false) (set i (dec (length lst))) (while (&& (>= i 0) (! found)) (when (== x (nth i lst)) (set found true)) (-- i)) found)) (set lotto (fn () (set r (list)) (while (< (length r) 6) (set x (inc (int (* (rand) 45)))) (when (! (contains? x r)) (set r (cons x r)))) (prn r))) (lotto) My Computer Programs 2013.07.09
(Parenjs) 로또 번호 생성 In Parenjs (set nums []) (set r []) (while (< r.length 6) (set n (floor (inc (* (rand) 45)))) (when (! nums[n]) (set nums[n] true) (r.push n))) (r.sort -) My Computer Programs 2013.06.17
(Scheme) primes A program that prints prime numbers 소수를 출력하는 프로그램 Program (Compiled with Racket.) Source Code License Copyright 2012 KIM Taegyoon Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin.. My Computer Programs 2013.05.05
(Windows, C++) setscrsave http://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx // setscrsave: set screen saver (C) 2013 KIM Taegyoon #include #include "windows.h" using namespace std; unsigned int bScreensaverActive, nScreensaverTimeout, bSecure; void get_setting() { //To read SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &bScreensaverActive, 0); SystemParametersInfo(SPI_GETSCREENSAVETIME.. My Computer Programs 2013.04.08
(JavaScript) SweepSecond A clock with a sweep second 초침이 부드럽게 움직이는 시계 HTML5 supported web browser is required. HTML5 지원 웹 브라우저 필요 Screenshot Program and Source Code SweepSecond License Copyright 2013 KIM Taegyoon Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2... My Computer Programs 2013.04.03