all stats

Zaya's stats

guessed the most

namecorrect guessesgames togetherratio

were guessed the most by

namecorrect guessesgames togetherratio

entries

round #47

submitted at
0 likes

guesses
comments 0

post a comment


code.pharo ASCII text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
findLongestIncreasingSubArray
	| longest current |
	longest := OrderedCollection new .
	current := OrderedCollection new .
	
	1 to: self size do: [ :i |
	self from: i to: self size do:
		[ :n |
			current isEmpty
				ifTrue:
					[ current add: n ]
				ifFalse:
					[ n > current last
						ifTrue: [ current add: n ] ] ] .
	longest size < current size
		ifTrue: [ longest := current ] .
	current := OrderedCollection new ] .
	^longest
playground.pharo ASCII text
1
{ 4. 5. 2. 6. 3. 5. } findLongestIncreasingSubarray .

round #43

submitted at
1 like

guesses
comments 0

post a comment


main.lua ASCII text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- sample usage: love . 5 3 5

local R = arg[2] and tonumber(arg[2]) or 3
local r = arg[3] and tonumber(arg[3]) or -1
local d = arg[4] and tonumber(arg[4]) or 0.5
local max_radius = R + math.abs(r) + d
local Rpx = R * 25
local rpx = r * 25
local dpx = d * 25

local x, y = max_radius * 25, max_radius * 25
local data = love.image.newImageData(1024, 1024)
for angle = 0, 360, 0.1 do
    local x1 = Rpx * math.cos(angle * math.pi / 180)
    local y1 = Rpx * math.sin(angle * math.pi / 180)
    data:setPixel(x + x1, y + y1, 0, 0, 1, 1)
end

local img = love.graphics.newImage(data)
local angle = 0
function love.draw()
    angle = angle - 1

    local radius = (Rpx - rpx)
    local x1 = radius * math.cos(angle * math.pi / 180)
    local y1 = radius * math.sin(angle * math.pi / 180)
    local xo, yo = x + x1, y + y1
    data:setPixel(xo, yo, 1, 1, 1, 1)

    local ratio = (1 - (R/r))
    local x1 = dpx * math.cos(angle * ratio * math.pi / 180)
    local y1 = dpx * math.sin(angle * ratio * math.pi / 180)
    data:setPixel(xo + x1, yo + y1, 1, 0, 0, 1)

    img:replacePixels(data)
    love.graphics.draw(img, 0, 0, 0, 1, 1)
end

round #34

submitted at
0 likes

guesses
comments 0

post a comment


fib.rs ASCII text
1
2
3
4
5
6
7
8
fn main() {
    (1..=100).for_each(|n| match n {
        _ if n % 15 == 0 => println!("FizzBuzz"),
        _ if n %  3 == 0 => println!(  "Fizz"  ),
        _ if n %  5 == 0 => println!(  "Buzz"  ),
        _                => println!(   "{n}"  ),
    })
}