cwbe coordinatez:
101
63540
2076399
3671716
3684355

ABSOLUT
KYBERIA
permissions
you: r,
system: public
net: yes

neurons

stats|by_visit|by_K
source
tiamat
K|my_K|given_K
last
commanders
polls

total descendants::
total children::1
show[ 2 | 3] flat


Ok pridavam vedomost, ktoru by snad mohol niekto vyuzit
Popis... Funkcionalny program, ktory ma definovany vlastny datovy typ Bitseq, ktory reprezentuje spocetne nekonecnu sekvenciu jednotiek a nul

Nalsedne je definovana funkcia "ones", ktora rekurzivne pocita pocet jednotiek v lubovolnej sekvencii jednotiek a nul definovanej tymto typom...

Program resp. funkcia 'ones' ma cisto demonstracnu ulohu (definicia vlastneho typu a jeho pouzitie) a neviem si predstavit jeho prakticke aplikacne vyuzitie :)


data Bit = Zero | One
data Bitseq = Nil | Cons Bit Bitseq

ones :: Bitseq -> Int
ones Nil = 0
ones (Cons One x) = 1 + ones (x)
ones (Cons Zero x) = ones (x)


Pre demonstraciu - bitova reprezentacia postupnosti '1101' by zapisana v tejto typovej notacii vyzerala nasledovne:>>
(Cons One (Cons One (Cons Zero (Cons One Nil))))

Don\'t Tase Me, Bro!


  submission:: Re: 08.02.2008-16:04:20 :: NEW (1 children )   NEW DESCENDANT   (Thunder Perfect Mind)


There are currently 10044 K available in
2nd Guild's K-treasury.




get 1 🦆 for 5 🐘
get 1 🐘 for 1 🦆