Skip to content

Instantly share code, notes, and snippets.

@guaracy
guaracy / bf.red
Created August 16, 2024 05:58
BF em 23 linhas (legível)
Red []
bf: function [prog][
size: 30000
cells: make string! size
append/dup cells null size
parse prog [
some [
">" (cells: next cells)
| "<" (cells: back cells)
| "+" (cells/1: cells/1 + 1)
@guaracy
guaracy / day01.pas
Created December 3, 2023 18:53
day01
PROGRAM day01;
{$mode objfpc}{$H+}
USES
StrUtils,
SysUtils,
uSuporte;
CONST
beads 1 program vslice
var g : a_date
calc main_init
loom_timer(do_tick, delay:0 sec, interval:1 sec, reps:INFINITY)
calc do_tick
merge seconds_to_date() ===> g
@guaracy
guaracy / hangman.red
Created August 28, 2020 17:47
Animation for the hangman game (CLI on Linux)
Red [
Title: "Hangman"
Date: 25-Aug-2020
Author: @guaracy
File: %hangman.red
Purpouse: {
Just an animation for the hangman game
CLI on Linux
}
]
Red [needs: 'view]
; frog
; https://opengameart.org/content/frog-player-spritesheets
; background
; https://opengameart.org/content/several-scrolling-backgrounds-and-layerable-runners
frog-sprites: #{
89504E470D0A1A0A0000000D4948445200000100000000800806000000E4B5B7
@guaracy
guaracy / rcalc.red
Created March 31, 2019 18:18
Calculadore Red
Red [ needs: 'view]
π: does[pi]
rnd: func[n][random n]
calcula: func[v l][
attempt [
eq: yes
res: form math to block! load v/text
c: copy v/text
append c rejoin [" = " res]
@guaracy
guaracy / teste.org
Last active February 24, 2019 01:46
Teste .org

tit

sub-title

Texto bold italico

(defun org-xor (a b)
   "Exclusive or."
   (if a (not b) b))
https://drivy.engineering/ruby-lambda-composition/
Red []
GREET: func[val][rejoin ["hello " val]]
UPPER: func[val][uppercase val]
print GREET "world"
print UPPER "world"
@guaracy
guaracy / demo.red
Last active October 4, 2018 17:42
demo.red
Red [
Title: "Red Android bridge demo"
Author: "Nenad Rakocevic"
File: %eval2.red
;Config: [type: 'dll libRed?: no libRedRT?: yes export-ABI: 'cdecl]
Tabs: 4
Needs: 'View
Rights: "Copyright (C) 2013-2017 Nenad Rakocevic. All rights reserved."
License: {
Distributed under the Boost Software License, Version 1.0.
@guaracy
guaracy / bootstrap.ring
Created July 22, 2018 04:56
Teste com ring + bootstrap
#!ring -cgi
Load "weblib.ring"
Import system.web
BootStrapWebPage() {
div { classname = :container
div { classname = :jumbotron