Code Snippets NewLisp

Short texts NewLisp 🧑‍💻 Code snippets NewLisp ✍️ Reading lists NewLisp 👀

A polyglot summation challenge

The summation challenge, extended from the classical a-plus-b problem, is a programming challenge for beginners. A programmer is asked to write a program to read multiple integers separated by whitespace from a single line and then print out their sum. Although not difficult, different solutions to this problem can exhibit different characteristics of programming languages. […]

nft.lisp

;; use the SIP090 interface (testnet) (impl-trait ‘ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.nft-trait.nft-trait) ;; define a new NFT. Make sure to replace MY-OWN-NFT (define-non-fungible-token MY-OWN-NFT uint) ;; Store the last issues token ID (define-data-var last-id uint u0) ;; Claim a new NFT (define-public (claim) (mint tx-sender)) ;; SIP009: Transfer token to a specified principal (define-public (transfer (token-id uint) (sender principal) […]

nft.lsp

;; use the SIP090 interface (testnet) (impl-trait ‘ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.nft-trait.nft-trait) ;; define a new NFT. Make sure to replace MY-OWN-NFT (define-non-fungible-token MY-OWN-NFT uint) ;; Store the last issues token ID (define-data-var last-id uint u0) ;; Claim a new NFT (define-public (claim) (mint tx-sender)) ;; SIP009: Transfer token to a specified principal (define-public (transfer (token-id uint) (sender principal) […]