Last active
November 30, 2023 10:41
-
-
Save elderica/44bf02aaad98e75d0a4afbc120d787cc to your computer and use it in GitHub Desktop.
ドドスコ問題
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define ds (vector "ドド" "スコ")) | |
(define (take-upto lst pos) | |
(cond | |
[(<= pos 0) null] | |
[(null? lst) null] | |
[else (cons (car lst) | |
(take-upto (cdr lst) (sub1 pos)))])) | |
(define (take-history history) | |
(take-upto history 12)) | |
(define (ddsk-rec history) | |
(if (equal? (take-history history) | |
(list 1 1 1 0 1 1 1 0 1 1 1 0)) | |
(displayln "ラブ注入♡") | |
(let ([i (random 2)]) | |
(display (vector-ref ds i)) | |
(ddsk-rec (cons i history))))) | |
(ddsk-rec null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment