#dev-general

1 messages · Page 365 of 1

eternal compass
#

yeah ik

forest pecan
#

now when i ask questions on that site, they dont get answers cause they are too hard

#

lol

unkempt tangle
#

I'm mad

half harness
#

unless ur coding something to make u mad 👀

jovial warren
#

oml wtf

#

okay, you guys remember how I said material likes to change my editor?

#

guess what I see now

#

tf is this? Eclipse?

static zealot
#

lmao

sweet cipher
#

lol

onyx loom
#

ive had that before

#

i get it when the plugin updates

jovial warren
#

doesn't clip use that theme?

#

🥲

#

it fucking deleted the custom theme I had

#

that's why

#

mother fucker

onyx loom
#

oh no!

jovial warren
#

lol

#

now I gotta write up the changelog for Krypton 0.14 🥲

#

I made sendActionBar, sendPlayerListHeaderAndFooter, showTitle, clearTitle and resetTitle work

#

added some documentation for data class constructor params with @param

#

switched to superior Kotlin DSL

#

also switched the config format to HOCON instead of TOML

#

also just used my brain and realised that KryptonServer can be an object

#

so yes, the server is now a singleton 🥲

prisma wave
#

ew

jovial warren
#

well, the backend of the server anyway

#

dw, there's no singletons in the actual API

#

actually, does having it be a singleton mean I still get control over when it's instantiated?

prisma wave
#

no

jovial warren
#

right, back to a class then lol

#

oh btw, probably asked this 100 times before, but I should definitely swap out using the manifest's main class for a main attribute in plugin.conf right?

#

screw it, it's done lol

#

also, is it just me or is use one of the most useful extensions to I/O streams there is

#
return JarFile(file).use { jar ->
            val entry = jar.getJarEntry("plugin.conf")
                ?: throw FileNotFoundException("Plugin's JAR does not contain a plugin.conf!")
            jar.getInputStream(entry).use {
                HOCON.decodeFromConfig(ConfigFactory.parseReader(InputStreamReader(it)))
            }
        }
```vs```kotlin
val jar = JarFile(file)
        val entry = jar.getJarEntry("plugin.conf")
            ?: throw FileNotFoundException("Plugin's JAR does not contain a plugin.conf!")

        val stream = jar.getInputStream(entry)

        try {
            return HOCON.decodeFromConfig(ConfigFactory.parseReader(InputStreamReader(stream)))
        } finally {
            jar.close()
            stream.close()
        }
prisma wave
#

it's literally try with resources

jovial warren
#

that's what I mean

#

but use is so much better than try-with-resources

#

so much more idiomatic

#

xD

#

also, I do love some of the hackery in this project

#

like avoiding using ticking to send keep alive packets by using an SES

forest pecan
#

you would be amazed how many reflection hacks people use

#

lmao

jovial warren
#

lol

#

I'm still actually thinking about how I'd even do ticking

#

since I've made a vow that a "primary thread" will never exist in Krypton

#

well, when Krypton gets into release anyway

#

that will not exist

prisma wave
#

as someone said the other day use creates arrow code

#

try with resources doesnt

jovial warren
#

true

#

if you use it right though it doesn't

oblique heath
#

what exactly are you going to do in place of having a primary thread o.o

prisma wave
#

die

jovial warren
#

if I can

oblique heath
#

right but like

#

there's probably a lot of ways to do that

jovial warren
#

yeah ik

#

I could split up the world into sections and have each section be processed concurrently

#

but that might get expensive at scale

oblique heath
#

that's a lot of threads

jovial warren
#

and might be a bit dangerous

#

well, coroutines

prisma wave
jovial warren
#

which you can kinda just throw around

oblique heath
#

i was thinking

prisma wave
#

tfw that's literally what aether does

oblique heath
#

what if instead of having a primary thread

jovial warren
oblique heath
#

you have a primary thread pool

jovial warren
#

there will be a pool for handling ticking

#

remember though, this won't be a thread pool

#

Kotlin will handle the thread pool internally

#

I'll be using a coroutine dispatcher 😎

prisma wave
#

why dont we have a stateless game that can be represented as a pure function

#

oh wait that's game of life

#

ez

jovial warren
#

omfg can you please not

#

how would I even split up the sections?

prisma wave
#

?

oblique heath
#

split sections dynamically based on how many tiles are in use

#

add a new coroutine and rebalance after a threshold is passed

jovial warren
#

okay you lost me with the words dynamically and rebalance xD

oblique heath
#

well if we're talking about the game of life

#

scale is important

prisma wave
#

lol

oblique heath
#

you don't need many coroutines for a small automata

jovial warren
#

I'm talking about Minecraft

oblique heath
#

well same thing

#

chunks are just tiles with extra steps

jovial warren
#

oh yeah, because the game of life and Minecraft are the same thing

#

Mojang has entered the room

prisma wave
#

theyre close enough

oblique heath
#

/s

jovial warren
#

lol

vale flax
#

Hey, how can I make material: change every seconds with DeluxeMenu please ?

oblique heath
#

anyways same point applies

oblique heath
#

you don't want or need 50 coroutines for a single loaded chunk

jovial warren
#

yes, you're right lol

#

ofc

oblique heath
#

but thats hard

jovial warren
#

but I do want more than just a single thread ticking an entire world

jovial warren
#

it's just how they're going to stay at least somewhat in sync with each other that worries me

prisma wave
#

noooooooooooooooooooooooooooooooooooooooooooooo

oblique heath
#

yeah

prisma wave
#

i need to fix this now

vale flax
#

Site down :/

jovial warren
#

omfg you're so useless BM

#

NGINX bad

prisma wave
#

yeah sorry

oblique heath
#

nginx good

jovial warren
#

Caddy good NGINX bad

oblique heath
#

off brand nginx

prisma wave
#

nah the proxy isnt the problem

jovial warren
#

does NGINX have extremely easy configuration? automatic HTTPS?

old wyvern
#

Bad

#

Bard*

jovial warren
#

what

oblique heath
#

it's like 2 lines for https

old wyvern
#

You'll be better off with single threaded ticking than trying to remake aether

#

xD

jovial warren
#

which is like 4 lines

prisma wave
#

i changed a few dependency versions and pushed without thinking

#

shit broke

jovial warren
#
  • the 4 lines you need for HTTPS
oblique heath
#

🤷‍♂️

old wyvern
#

Not trying to demotivate

jovial warren
#

single-threaded ticking means Krypton's just gonna turn into vanilla though

jovial warren
#

which literally makes it pointless

prisma wave
#

no it doesn't

oblique heath
#

nginx runs on a single thread

old wyvern
#

Pretty much every game runs like this

hot hull
#

ticking should be sync tho

jovial warren
#

what makes Minecraft bad then?

oblique heath
#

single thread does not = bad

prisma wave
#

shit spaghetti code with no optimizations

old wyvern
#

^

jovial warren
oblique heath
#

aka coroutines

jovial warren
#

okay, so maybe Krypton can have a single thread for ticking

oblique heath
#

and all that stuff

jovial warren
#

though I want more stuff to be done reactively

old wyvern
#

as in?

oblique heath
#

it'd be nice to not have ticks at all

jovial warren
#

e.g. chunk loading checking, like checking whether you've crossed a chunk border, should be done reactively

#

or should it

#

position packets are sent more often than ticks run I think

#

also, how would I even tick?

#

I know Glowstone uses an SES

#

and vanilla just uses a while (this.running)

prisma wave
#

while true {
tick ()

old wyvern
#

^

jovial warren
prisma wave
#

System.exit

jovial warren
#

won't that keep ticking until it shuts down the main thread though?

half harness
#

while (isTicking())

old wyvern
#

It closes your application bard

oblique heath
#

while running {tick()}

jovial warren
old wyvern
#

Also do have some logic to make sure your application doesnt over tick

half harness
#

and in isTicking() it can do tick()

old wyvern
#

No

#

You dont need to shutdown the server

#

Just make sure you have a cap

#

And send warnings if it goes under

jovial warren
#

also, if I'm using while true, how am I gonna make it run every 20 seconds?

old wyvern
#

Before ticking get time

half harness
old wyvern
#

after ticking, get time

#

Check deviated time

#

Compare with thresh holds

#

If < normal tick time

#

put thread to sleep till that time

oblique heath
#

krypton is supposed to be a super fancy speedy efficient concurrent engine right

old wyvern
#

else

jovial warren
#

maybe Glowstone's method of using a single thread SES and scheduling to run every 50ms wasn't so bad

old wyvern
#

compare with minimum threashhold

#

If lesser than that

#

warn

#

continue looping

jovial warren
#

put to sleep?

oblique heath
#

how about going all the way and finding a way to use GPU to tick 😎

old wyvern
#

Thread.sleep

jovial warren
#

yeah that's gonna be a bad idea

#

isn't it?

old wyvern
#

No

prisma wave
old wyvern
#

We simply dont want the thread to do anything in that interval

jovial warren
#

actually, Netty can still answer people's calls

prisma wave
#

ayyyy

old wyvern
#

Yes

half harness
#

ez

prisma wave
#

minimal downtime

jovial warren
#

ticking whilst isTicking makes 0 sense

#

since if isTicking returns false then we're not ticking anymore

#

but that will only be updated if we're not ticking

half harness
#

then tick()

jovial warren
#

while true makes more sense

#

wait, so Yugi

forest pecan
#

you could use a shutdown hook

#

for System.exit use a shutdown hook

#

and you could stop the ticking

oblique heath
#

while true is bad

#

that's busy waiting isnt it

forest pecan
#

while (someBoolean) is better

old wyvern
#

no ivan

forest pecan
#

like a variable

#

thats mutable

half harness
old wyvern
#

game loops are a thing

oblique heath
#

well no i mean for if a thread has nothing to do

forest pecan
#

pretty much all events and gui updates are infinite loops

#

lol

old wyvern
#

All the threads responsibilities will be inside the loop

forest pecan
#

maybe some build off others

jovial warren
#
const val TICK_EVERY = 50

var lastTickTime = System.currentTimeMillis()

fun start() {
    // do magic

    while (true) {
        if (System.currentTimeMillis() - lastTickTime < TICK_EVERY) return
        // do tick
    }
}
```right?
oblique heath
#

if you want a thread to not do anything you dont want to use while(true)

jovial warren
#

just as an example

half harness
#

return?!

#

continue

jovial warren
#

actually continue

forest pecan
#

lol

#

dkim is 200 braincells

#

not 3

jovial warren
#

wow did dkim just provide some useful information for once?

forest pecan
#

bardy has 3 now

jovial warren
#

wtf is this?

half harness
#

😳

oblique heath
jovial warren
#

what I thought

#

but Yugi didn't respond to that

forest pecan
#

bardy and dkim switched braincell numbers

jovial warren
#

I was thinking of doing what Glowstone does and using a single threaded SES

forest pecan
#

everything is going to boil down to while (someBoolean) eventually whether any fancy library you use

#

or something similar

half harness
old wyvern
#
const val TICK_INTERVAL = 1000/20
...
while (true) {
   val tickStartEpoch = System.currentTimeMillis()
   tick()
   val tickEndEpoch = System.currentTimeMillis()
   val deviatedTime = tickEndEpoch - tickStartEpoch 
   if (deviatedTime < TICK_INTERVAL) {
      Thread.sleep(TICK_INTERVAL - deviatedTime)
   }
}

Something like this ig

onyx loom
#

beautiful

half harness
#

why 1000/20

oblique heath
#

Thread.wait()?

forest pecan
old wyvern
#

1 second = thousand milli*seconds

half harness
#

1_000/20 ftw

old wyvern
#

20 ticks must happen in 1 second

hot hull
#

I mean why don't we make it 60 ticks <o/

old wyvern
#

Sure

#

go for it

half harness
old wyvern
#

unlikely

forest pecan
ocean quartz
onyx loom
#

!!!

obtuse gale
#

!!!

forest pecan
#

!!!

old wyvern
#

Next Up: Nuke Bridge

half harness
#

.

jovial warren
#

can Kotlin actually interpret 1000 / 20 as a compile-time constant?

#

I never knew that lol

#

because it seems to have issues with things

ocean quartz
old wyvern
#

true

jovial warren
old wyvern
#

Yes bard

jovial warren
#

and measure the time of it

#

perfect

#

right, 0.15 will tick things

old wyvern
#

what?

jovial warren
#

I mean Krypton 0.15 lol

old wyvern
#

oh version

half harness
#

is it possible to make like someVar = "a" also run like another method like variableChanged()? or do i need to make a custom setter

jovial warren
#

the version I'm about to release is 0.14

old wyvern
#

yes

#

override a setter

half harness
#

how

prisma wave
#

not the cleanest thing in the world but it makes sense

#

i think

old wyvern
#
var idk = 5
    set(value) {
        callListeners()
        field = value
    }
half harness
#

ooo ok

#

thx

prisma wave
#
        inputs <- replicateM 8 (getLine >>= (\x -> 
            return (read x :: Int)))
``` @old wyvern any idea how i could clean this up?
#

tried return . read :: Int already, doesn't work

old wyvern
#

hmm thinking

oblique heath
#

oo ty, i'll take a look at it

jovial warren
#

oh btw, is Sender's hasPermission function calling an event a violation of SRP?

#

it fires a PermissionCheckEvent

prisma wave
#

quite a few monads there so

#

well 2

#

maybe 1

oblique heath
#

does <- act like #get() for the IO

prisma wave
#

pretty much yeah

#

it's not actually that, but it does a similar thing

old wyvern
#

Wait why is the answer infinitely recursive?

prisma wave
#

the forever?

old wyvern
#

yes

prisma wave
#

cuz it's a clash problem

old wyvern
#

uh?

oblique heath
#

so the way it works is

old wyvern
#

Clash problems dont require that I think

prisma wave
#

this is the "singleplayer"

#

which seems to

oblique heath
#

each time the loop runs, the output "shoots" the mountain

hot hull
#

Anyone wanna play some coc?

oblique heath
#

lowering it's height by 1

old wyvern
#

wait theres a singleplayer??

oblique heath
#

so you might have to run the loop 100 or 1000 times

#

or infinitely many

prisma wave
old wyvern
#

Never seen that, rip

lunar cypress
#

the singleplayer challenges are more sophisticated

prisma wave
#

^

prisma wave
oblique heath
#

ooo gotcha

hot hull
#

Noone joining? :sad:

prisma wave
#

cant rn

#

about to eat

old wyvern
#

comin frost

oblique heath
#

so this line

fromMaybe (-1) $ elemIndex max inputs

i get what elemIndex max inputs does, it gets the index of the largest input
but what is fromMaybe, and the (-1)

prisma wave
#

pretty much Optional#getOrElse

#

-1 being the default value if max isn't in inputs

#

Except it always will be

oblique heath
#

is it required

hot hull
#

It's optional#orElse, what a noob for not knowing this

prisma wave
#

Oh whoops soz

prisma wave
oblique heath
#

ah i see

#

also for

putStrLn $ show index

the show turns the int into a string, i take it?

prisma wave
#

yeah it's like toString kinda

static zealot
#

plss 666

oblique heath
#

i was wondering about that

#

i was using print() instead of putStrLn before

prisma wave
#

Ah yeah that works too

#

Only if the value implements the Show type class though afaik

oblique heath
#

;o

#

i'm getting

/tmp/Answer.hs:24:21: error:
    Variable not in scope: fromMaybe :: Integer -> t0 -> t
   |
24 |         let index = fromMaybe (-1) $ elemIndex max inputs 
   |                     ^^^^^^^^^
/tmp/Answer.hs:24:38: error:
    Variable not in scope: elemIndex :: Int -> [Int] -> t0
   |
24 |         let index = fromMaybe (-1) $ elemIndex max inputs 
   |                                      ^^^^^^^^^
/tmp/Answer.hs:27:20: error:
    • Ambiguous type variable ‘a0’ arising from a use of ‘show’
      prevents the constraint ‘(Show a0)’ from being solved.
      Probable fix: use a type annotation to specify what ‘a0’ should be.
      These potential instances exist:
        instance Show HandlePosn -- Defined in ‘GHC.IO.Handle’
        instance Show BufferMode -- Defined in ‘GHC.IO.Handle.Types’
        instance Show Handle -- Defined in ‘GHC.IO.Handle.Types’
        ...plus 27 others
        ...plus 12 instances involving out-of-scope types
        (use -fprint-potential-instances to see them all)
    • In the second argument of ‘($)’, namely ‘show index’
      In a stmt of a 'do' block: putStrLn $ show index
      In the second argument of ‘($)’, namely
        ‘do inputs <- replicateM 8
                        $ do input_line <- getLine
                             let ...
                             ....
            let max = maximum inputs
            let index = fromMaybe (- 1) $ elemIndex max inputs
            putStrLn $ show index’
   |
27 |         putStrLn $ show index
   |                    ^^^^^^^^^^
#

with this:

forever $ do
        
        inputs <- replicateM 8 $ do
            input_line <- getLine
            let mountainh = read input_line :: Int 
            return (mountainh)
        
        let max = maximum inputs
        let index = fromMaybe (-1) $ elemIndex max inputs 
       
        
        putStrLn $ show index
old wyvern
#

Did you do the imports?

oblique heath
#

all the imports are there

import System.IO
import Control.Monad
#

oh wait

#

🥲

#

thank you

hot hull
#

I broke kotlin in COC

stuck harbor
#

sadge

hot hull
#

@old wyvern You coming or?

old wyvern
#

wdym?

#

oh did it start?

#

weird

hot hull
#

That one was bugged

old wyvern
#

oh

hot hull
#

Did you join or?

#

I'm just gonna assume my internet fucked

oblique heath
#

it's broken for me too it seems like

#

i don't see a timer

#

oop nvm there we go

old wyvern
#

@prisma wave

import System.IO
import Control.Monad
import Data.List
import Data.Maybe

main :: IO ()
main = do
    hSetBuffering stdout NoBuffering -- DO NOT REMOVE
    forever solve
      
solve :: IO ()
solve = do
      inputs <- replicateM 5 $ getLine >>= return . read
      let max = maximum inputs :: Int
      let index = fromMaybe (-1) $ elemIndex max inputs 
      print index

This should work

prisma wave
#

o

#

That's clever

#

Didn't even realize you can "delay" the "casting" to Int

oblique heath
#

what's return . read

old wyvern
#

Its not a casting, the compiler just needs a type hint at some point in the function, it can infer the rest that use the same type

old wyvern
#

return . read so takes an argument (because read takes a single argument) applys read to it, then applies return to it

oblique heath
#

wait so the . does the same thing as $ would?

old wyvern
#

Well no, $ is just a change in precedence

stuck harbor
#

what even

#

that looks odd

old wyvern
#

lol

oblique heath
#

that's Java 2.0

#

electric boogaloo

#

oh also what does >>= do there

winter iron
#

In git production, I should be developing on a different branch to master right?

old wyvern
#

Its the bind operator

winter iron
#

then merge when its "ready"

old wyvern
#

Basically a way to compose functions while using monads

oblique heath
#

bind...

#

so it replaces let?

old wyvern
#

no no

#

not a let binding

#

Basically you are mapping the value contained in the monad to create another monadic value

#

d; CompletableFuture#thenApply

ruby craterBOT
#
<U> CompletionStage<U> thenApply(Function fn)```
Description:

Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function.

This method is analogous to Optional.map and Stream.map.

See the CompletionStage documentation for rules covering exceptional completion.

Returns:

the new CompletionStage

Parameters:

fn - the function to use to compute the value of the returned CompletionStage

old wyvern
#

something like this

static zealot
#

Barry really hates me

old wyvern
#

except you actually have to wrap it in the function yourself

static zealot
#

I was at 666 664

#

and it just put me at 666 671

#

you guys still playing COC?

oblique heath
#

not right now, but i could go for another round

#

d; clashofcode

ruby craterBOT
#
@@Deprecated(since="9", forRemoval=true)
public interface ClassDoc
extends ProgramElementDoc, Type```
ClassDoc has 5 super interfaces, 2 extensions, 21 methods, and  1 sub interfaces.
Deprecation Message:

The declarations in this package have been superseded by those in the package jdk.javadoc.doclet. For more information, see the Migration Guide in the documentation for that package.

Description:

Represents a java class or interface and provides access to information about the class, the class's comment and tags, and the members of the class. A ClassDoc only exists if it was processed in this run of javadoc. References to classes which may or may not have been processed in this run are referred to using Type (which can be converted to ClassDoc, if possible).

oblique heath
#

😦

old wyvern
#

@static zealot @oblique heath

static zealot
#

I can't join rn lmao. I was just wondering

oblique heath
#

eeeh

old wyvern
half harness
#

hm

#

idk what to do rn

#

should i
a) code
b) do schoolwork
c) play hypixel

oblique heath
#

d) coc

hot hull
#

e) cock

#

f) skydiving without a parachute

static zealot
#

ef

#

please

jovial warren
static zealot
#

wait what?

oblique heath
#

g) bungee jumping with a rope

obtuse gale
#

h) bungee jumping without a rope

jovial warren
# static zealot wait what?

I added support for Krypton to LuckPerms, but lucko wouldn't merge it because Krypton isn't popular enough 😔

#

so I'm maintaining it in my own fork, like he suggested

static zealot
#

ah I see

jovial warren
#

and providing a download for it on the CI

static zealot
#

I'm to lazy to open the link

hot hull
oblique heath
#

your CoC

obtuse gale
#

Your testicles

hot hull
#

No

jovial warren
#

someone here actually test that LuckPerms JAR out btw, I wanna see if it works for you guys lol

oblique heath
#

your incredibly long and misshapen nose

half harness
jovial warren
#

all this time I've been the only one doing the testing

jovial warren
static zealot
#

ok now I can play @old wyvern wanna play?

hot hull
#

Bardy, I'll set up a sub server tommorrow

obtuse gale
#

I mean of course he wouldn't merge it, it's not a popular enough of a platform to be his responsibility loll

jovial warren
#

he just said it's not worth the maintenance required to maintain it

obtuse gale
#

maintenance required to maintain it

jovial warren
#

that first sentence in his response made me smile

obtuse gale
#

When the maintenance requires maintenance

static zealot
#

oh no

jovial warren
#

I mean, I offered to maintain it myself, which is what I'm doing, he just said that he didn't want it in the main repo because the platform's not popular enough

obtuse gale
#

tl;dr no one uses it because it sucks

jovial warren
#

Fefo stfu

#

he said it was cool

obtuse gale
#

Shut me up yourself bitch

hot hull
#

Screenshot, save, show in a year when it's finished and it possibly goes places

jovial warren
#

not sure whether he meant the implementation or the server was cool

#

or both

half harness
jovial warren
#

smiling face with 3 tears eh

#

literally looks it took BM 5 minutes in photoshop

static zealot
half harness
#

lol

static zealot
prisma wave
static zealot
#

for BM

jovial warren
#

lol

prisma wave
#

Yeah I didn't make it

static zealot
#

actually it was paint

#

not photoshop

#

:))

half harness
#

how

#

that would have taken me at least 10 minutes

#

lol

static zealot
#

why?

#

just use the select tool

half harness
#

how do u copy paste it

#

without the smile

#

like

static zealot
#

top copy a half, reverse it

half harness
#

oh

#

but what about the down part

static zealot
#

and then add 1 more tier

half harness
#

the 3rd tear

static zealot
#

and delete what is not needed

#

just a select of the tear

#

with some more shit

half harness
#

💩

oblique heath
#

@old wyvern is either afk or extremely focused on finishing the CoC

half harness
#

afk for 2 mins

#

going on pc

static zealot
prisma wave
#

Wot

static zealot
#

so guys down for another game of COC?

half harness
#

back

old wyvern
#

Yea

prisma wave
#

How can it possibly know it's an Int before the type hint

#

I'll do 1 soon

old wyvern
static zealot
#

ok my browser finally opened

#

after 10 minutes

prisma wave
#

Oh what

old wyvern
#

as long as it uses the sam type

prisma wave
#

That's crazy

old wyvern
#

isnt it the same in f#?

prisma wave
#

I don't think F# has type hints in the same way

oblique heath
#

`\x?

prisma wave
#

lambda

old wyvern
#

I see

half harness
#

challenge: type a but replace a with ` (with the code block thing)

oblique heath
#

```

half harness
#

lol

old wyvern
#

bm

#

you joining?

half harness
forest pecan
#

starttt

oblique heath
#

\ `

onyx loom
#

val a = "a".replace("a", "`")
🙂

old wyvern
#

Alright

prisma wave
#

I'll do next

old wyvern
#

Holy god is questions

prisma wave
#

for reading an int you'd just do ```fs
System.Console.ReadLine() |> int

#

No type hints needed

onyx loom
#

System.Console.ReadLine

#

are we going to talk about this

jovial warren
#

oh btw, @old wyvern, you know how for ticking, you said I should use Thread.sleep?

#

since this is a coroutine, shouldn't I use delay instead?

prisma wave
static zealot
#

to much fucking text

prisma wave
#

Ruddy interop

onyx loom
#

true 😔

prisma wave
#

Ez fix is fs let readLine = System.Console.ReadLine

jovial warren
#

so it would just end up as ```kotlin
while (true) {
val tickTime = measureTimeMillis(::tick)
if (tickTime < TICK_INTERVAL) delay(TICK_INTERVAL - tickTime)
}

static zealot
#

I think I got some of it but this shit to much text

#

for me to read

#

it will

#

well not until we die

#

oh wait I'm blocked lmao and he uses BetterDiscord

#

so he can't see my messages

#

lmao

prisma wave
#

🙄

oblique heath
#

phew

static zealot
#

ivan pls end my suffering. to much for me

#

to handle

oblique heath
#

i believe in you

forest pecan
#

i gtg lol

oblique heath
#

if all else fails i will let you borrow a length of rope

static zealot
#

wait

forest pecan
#

its just a greedy algorithm i think, but i have to go rn

oblique heath
#

it's just math

static zealot
#

yeah math

oblique heath
#

🥲

forest pecan
#

logrithms?

#

base 2?

oblique heath
#

yea

#

but shhh

static zealot
#

I got the height. just not the other thing

forest pecan
#

i had that too

#

in my mind

#

but i gtg lol

oblique heath
#

submit your code

#

before you go

forest pecan
#

its unfinished

oblique heath
#

dewit

winter iron
#

i couldnt figure out how to power a fucking int in kotlin

#

sat there for like 5 minutes

#

:/

cinder flare
#

just plug it in, idiot

oblique heath
#

xd

#

does Math.pow exist in kotlin

prisma wave
#

Int.pow

cinder flare
#

probably

#

yea

prisma wave
#

or double*

winter iron
#

Int.pow was not working on coc

static zealot
#

Well I give up

jovial warren
#

oh btw, is it wise to use the default dispatcher instead of the IO dispatcher for ticking to avoid the IO dispatcher getting overcrowded?

#

and also because ticking isn't generally IO

#

Yugi

prisma wave
#

as the name suggests the IO dispatcher is only for IO

jovial warren
#

you never answered me

old wyvern
oblique heath
#

guys let's have an unofficial rule for this next CoC

old wyvern
#

I just did

#

lol

jovial warren
#

oh

#

lol

oblique heath
#

we'll have to use recursion

static zealot
#

no thanks Ivan

oblique heath
#

😦

prisma wave
#

ez

jovial warren
old wyvern
#

Just because you have a hammer in your toolbox doesnt mean you should go hitting everything with it

jovial warren
#

actually that is the dumbest circlejerk I have heard ever I swear

prisma wave
#

that's not even a circlejerk

#

it's just wrong

old wyvern
#

^

jovial warren
#

true

#

coroutines good threads good

#

they both have a purpose

obtuse gale
#

hi

jovial warren
#

hello

static zealot
#

you got yourself recursivity ivan

jovial warren
#

oh btw, @old wyvern, is it worth storing the next tick time so I can do what vanilla does and compare it to see if the server is running behind?

#
long nextTickTime = Util.getMillis() - this.nextTickTime;
if (nextTickTime > 2000L && this.nextTickTime - lastOverloadWarning >= 15000L) {
    long nextTickTimeTicks = nextTickTime / 50L;
    LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", nextTickTime, nextTickTimeTicks);
    this.nextTickTime += nextTickTimeTicks * 50L;
    lastOverloadWarning = this.nextTickTime;
}
```like this
oblique heath
#

recursive magic for the win

jovial warren
#

I mean, a bit less whacky than that, but you get the idea

oblique heath
#

though i don't see how it's faster in this case

static zealot
#

please don't bully my I was in a rush and idk what I did

winter iron
#

i wont be able to finish

oblique heath
#

woah woah you didnt even make it recursive

#

for shame

winter iron
#

i got mcdonalds

#

:/

static zealot
#

I didn't xD

oblique heath
#

also something confuses me

static zealot
#

I mean it was pretty easy to make just didn't

#

why I added X?

oblique heath
#

at first i put everything in man

static zealot
#

🙂

oblique heath
#

main*

#

and it said it was too inefficient

#

how does moving this to a function make it run faster

static zealot
#

idk

#

but yeah It would've been pretty easy to make it recursive

#

just remove the while

#

and move the check in the function

old wyvern
jovial warren
#

how?

old wyvern
#

starttime + interval ?

prisma wave
#

>>= (\x -> return (read x :: Int)) 😦

jovial warren
#

sorry, I'm not quite with it today I guess

old wyvern
#

You want an example of addition?

#

uh

jovial warren
#

I want the if statement

prisma wave
#

if haskell is so good why can't it infer that i want read to be an Int

jovial warren
#

I can't figure out how that addition applies to the context

old wyvern
#

Actually im even more confused on what you actually want to do\

#

You want to find out if you're running behind on ticks right?

jovial warren
#

yes

oblique heath
#

can anyone explain why this most recent CoC considers a nested while + for loop in the main inefficinent, but is okay with recursion or a while loop + helper function

#

i don't see why the latter two would be faster

prisma wave
#

huh?

old wyvern
#

That is pretty much checkign with the elapsedTime we used in the earlier loop

oblique heath
#

i got an error saying "this code is to inneficient" when i first solved it

prisma wave
#

probably because it timed out

oblique heath
#

right but why ;-;

prisma wave
#

idk

oblique heath
#

all i did was move stuff into a function

#

and i made it recursive too i guess but blitz literally has what i had originally, just with a function

#

very weird

jovial warren
#

ah I see what you mean now Yugi

#

wow I'm stupid

prisma wave
#

recursive solutions are the best anyway

oblique heath
#

i can't agree more

prisma wave
#

🤨

#

e >>= (\x -> return (read x :: Int))

#

whoops

#

wrong copy paste

tranquil crane
#

If you do another one after that I'll join it, won't be able to for like 10 minutes

prisma wave
#

alrighty

#

we probably will

#

not like any of us have anything better to do

#

@old wyvern @jovial warren ?

oblique heath
#

is this supposed to happen

prisma wave
#

yes

oblique heath
#

i like it

prisma wave
#

it's a feature

jovial warren
#

fine

prisma wave
#

trust me

cinder flare
#

bm transcends reality

prisma wave
#

what monads do to a guy

oblique heath
#

that'd actually be a genius image to use as a profile pic

jovial warren
#

as long as I get to use Python for anything other than shortest then I'll play lol

oblique heath
#

fingers crossed it's reverse

prisma wave
#

python for shortest is cheating

cinder flare
#

reverse? does that mean you want to take the longest or something lol

jovial warren
#

no

oblique heath
#

it means you have to figure out what to do

prisma wave
#

shall we start?

oblique heath
#

based on the output

cinder flare
#

oh isee

prisma wave
#

unless anyone else is joining

jovial warren
#

BM no

#

inv

#

send link

prisma wave
#

smh

#

god damn ur fast

oblique heath
#

ez pezy

ocean quartz
#

I join when you finish lmao

prisma wave
#

okey

static zealot
#

wait did you guys start a new COC?

oblique heath
#

yes

#

there's 11 mins on the clock

static zealot
#

link?

static zealot
#

barry deletes it after few minutes

#

yeah it does

oblique heath
#

nice

static zealot
#

wait nvm it does not

#

you have to still be playing

#

for it to work

oblique heath
#

ah darn

tranquil crane
#

how tf you finish that in 1:40

oblique heath
#

jazz hands

static zealot
#

@ocean quartz link?

#

you joined

jovial warren
#

oh fuck this

tranquil crane
#

I can't even see what the question is so 🤷‍♀️

static zealot
#

someone send link please

#

lmao

tranquil crane
#

25%

static zealot
#

I'm going to die here

jovial warren
#

yeah I'm not awake enough for these today

hot hull
#

Oh wow and now that I'm no longer on pc y'all doing coc

#

Sadge times

static zealot
#

had to go to logs

#

for link 😦

oblique heath
#

poor efe

cinder flare
#

im fucking dumb

#

is Integer#parseInt not a thing

oblique heath
#

it is

hot hull
#

You asking about coc?

#

If so no, I believe that still runs java 8

oblique heath
#

Integer#parseInt definitely works

#

i used it (in java at least)

static zealot
#

Kotlin: Is the only way to loop thru the digits of a number by converting it to a char array?

hot hull
#

Or just get the size

lunar cypress
#

no

old wyvern
#

test

hot hull
#

And increment index

old wyvern
#

1234

oblique heath
#

you can use substring and loop for the length like frosty said ye

old wyvern
#

@static zealot what is this new avatar

static zealot
#

do you not like it?

old wyvern
#

😫

cinder flare
#

omg parseint doesn't take a char wtf

old wyvern
#

I cant even tell what that is

lunar cypress
#

you're looking for Character.digit

old wyvern
#

The level thing?

oblique heath
#

@cinder flare char+""

static zealot
old wyvern
#

lol

#

Patrick was better

static zealot
#

it didn't want to give me 6x 6

prisma wave
#

yugi how to get indexed values of list

old wyvern
lunar cypress
#

haskal losing PepeLaugh

prisma wave
#

[1, 2, 4] => [(0, 1), (1, 2), (2, 4)]

#

wouldve solved this by now if i was in a good language

lunar cypress
#

D:

old wyvern
#

Do you just need to map with an index or something?

prisma wave
#

yes

#

got it

#

i think

old wyvern
#

Data.Sequence.mapWithIndex

onyx loom
#

forEachIndexed 🙂

cinder flare
#

#3 baby

static zealot
#

did it

cinder flare
#

les go

static zealot
#

oh I got 4?

old wyvern
#

new game?

static zealot
#

how did I get 4 when I joined at minute 10

old wyvern
#

Another haskell requests to join

lunar cypress
#

not done yet

old wyvern
#

haskell shall not lose

static zealot
#

there's still 4 playing yugi

cinder flare
#

efe got a 0% score lmao

old wyvern
#

oh I see

#

Alrighty

lunar cypress
#

What am I doing here

#

I have an exam tomorrow

cinder flare
#

Johnny did it in Clojure? what a madman

old wyvern
#

which subject?

lunar cypress
#

linear algebra 🥲

old wyvern
#

🥲

cinder flare
old wyvern
#

I have like 2 weeks to my mid terms now I think

prisma wave
#

CANNOT be bothered

#

useless language lacks even the most BASIC functions

cinder flare
#

haskell?

old wyvern
#

No!

lunar cypress
#

blasphemy

old wyvern
#

What was the question btw?

lunar cypress
#

it was a weird question

old wyvern
#

Another really long one?

prisma wave
#

nah

tranquil crane
#

I spent 90% of the time just trying to understand the question

prisma wave
#

minimum possible value of subtracting 9 from each digit of n

old wyvern
#

o.o

lunar cypress
#

"Create the smallest number from the input by either subtracting each digit from 9 or not"

prisma wave
#

123 => min [823, 163, 126]

tranquil crane
#

cursed

lunar cypress
#

This or something similar was the way it was phrased

old wyvern
#

I see

#

Ok seems everyone is done

#

oh wait

prisma wave
#

yes

cinder flare
#
    var x = StringBuilder()
    
    N.forEach {
        var n = it.toString().toInt()
        if (9-n<n) n = 9-n
        x.append(n)
    }```
old wyvern
#

1 more dude

prisma wave
#

unfortunately

ocean quartz
#

Forgot you can forEach a number

cinder flare
#

that's Blitz' solution

old wyvern
#

did sensei leave?

lunar cypress
#

it's over in a min anyway

static zealot
cinder flare
#

ew

old wyvern
#

aight

tranquil crane
cinder flare
cinder flare
tranquil crane
#

that was BM's

old wyvern
cinder flare
#

oh wtf

#

ew

old wyvern
#

Nah thats a lie

#

he wouldnt

tranquil crane
#

I used TypeScript lol

cinder flare
#

ewwww

old wyvern
#

Imperative bad

winter iron
#

Lol just finished eating got 7 seconds left

#

lmao

old wyvern
#

join sensei

winter iron
#

ok

#

lets coc

prisma wave
#

THATS more like it

static zealot
#

haskell has won this time

winter iron
#

i got no idea

static zealot
#

well 1 haskell

#

not both

prisma wave
#

it's redeemed itself

winter iron
#

what to do

#

lol

#

how to do it atleast

old wyvern
#

😌

oblique heath
#

what was the question this time

old wyvern
#

reverse the alphabets

oblique heath
#

o.O

cinder flare
#

i feel i am doing this very poorly

old wyvern
#

"abcdefghijklmnopqrstuvwxyz".toCharArray().toSet()well well well

#

xD

prisma wave
#

that's cursed

ocean quartz
#

Shhhh

lunar cypress
#

I'm dumb, I thought 'a' was 65 lol

old wyvern
#

lol

lunar cypress
#

maths already going great here

tranquil crane
#

my answer is absolutely cursed

prisma wave
tranquil crane
#

219 - charCode

old wyvern
#

☝️

tranquil crane
#

no magic values here

old wyvern
#

Monads solve everything

ocean quartz
#

Share code Nicole

tranquil crane
#

there

#

I could have just used a bunch of maps

#

I was just in a hurry

ocean quartz
#

That's smart

prisma wave
#

haskell definitely cleanest tho

ocean quartz
#

Didn't even think about the char code

old wyvern
#

Throw em onto your torn shoes? Fixed.
Throw em onto your purse? Fixed, more money.
Hotel? Trivago

winter iron
#

idk what the fuck to do

#

lol

#

im brick walled

#

:/

old wyvern
#
map (\x -> chr (ord('z') - ord(x) + ord('a'))) word
#

Decipher what you may

prisma wave
#

chaotic good

cinder flare
#

what in the fuck you can't do indexOf on a char array

oblique heath
#

can someone send me a link to the clash report

static zealot
#

ugh you guys started 2 of them

prisma wave
oblique heath
#

aw i cant view the code

tranquil crane
#

those are both the reports

old wyvern
#

we need hasklash in here

prisma wave
#

pretty much identical to python except the lambda

old wyvern
#

!!!

prisma wave
#

!!!

lunar cypress
#

not even waiting for others smh

prisma wave
#

no this is the same one

old wyvern
#

Petition to add hasklash

winter iron
#

how to i quit this oje

#

i cba

#

shitty challegne

prisma wave
#

just submit something funny

lunar cypress
#

I'll be off now anyway, you people have fun

prisma wave
#

adios

old wyvern
#

ciao

cinder flare
#

solid 7th bois

prisma wave
#

could be worse

oblique heath
#

how many fastest have we had in a row now

cinder flare
#

oop

static zealot
#

idk

prisma wave
#

let me convert

old wyvern
#

wonderful

cinder flare
#

I think I just need to become more familiar with stuff

tranquil crane
#

what does reverse do?

prisma wave
#
word.map { 
  ('z'.toInt() - it.toInt() + 'a'.toInt()).toChar()
}
static zealot
old wyvern
tranquil crane
#

I mean the reverse mode lmao

static zealot
#

or whatever else

#

it reverses

#

ohhh

#

lmao

#

it gives you input and output

tranquil crane
#

that sounds painful

static zealot
#

like 10 options

prisma wave
#

like reverse engineering

static zealot
#

and you have to know

#

what it does

#

to figure out

#

what it does

#

and then code it

prisma wave
#

oh god

tranquil crane
#

is that a SNAKE

errant geyser
ocean quartz
#

This one is confusing

oblique heath
#

this one was a lot easier than i thought when i first saw it

winter iron
#

mine bugged out on 2nd to last test

oblique heath
#

yeah mine too

#

casting was needed

winter iron
#

mhm

static zealot
#

OMFGGG

#

I checked the tongue the opsite ways

cinder flare
#

wtf yeah what's up with the second to last

static zealot
#

and now I'm 3rd because of it

oblique heath
#

check yer casting

winter iron
#

xXd

static zealot
#

oh I didn't check if it has a tongue in both places as well did I?

#

fuck

cinder flare
#

my casting?

static zealot
#

or was that not a requirement?

cinder flare
#

i did no casting

static zealot
#

all the tests worked

oblique heath
#

wait blitz i think you checked the tongue correctly

static zealot
#

but of course it only gives 71

tranquil crane
#

just submitted it with my debug lines but who cares

winter iron
#

@static zealot ur last 2 tests would have failed

oblique heath
#

^

static zealot
#

oh really?

oblique heath
#

gotta cast to int

tranquil crane
#

go view my debug code if you dare

static zealot
#

I missed it then

ocean quartz
#

I'm perpetually 4th place

oblique heath
#

4th is the one with the treasure chest

#

or something

winter iron
#

hairy chest

#

i believe

cinder flare
#

there's only one snake per line right?

oblique heath
#

yes

static zealot
#

yeah

tranquil crane
#

snek

cinder flare
#

then wtf is up with the last two

prisma wave
#

haskell division makes me want to die

ocean quartz
#

I thought it was the perfect language!

prisma wave
#

almost perfect

tranquil crane
#

fromIntegral $ length happyCount

#

wtf is this

prisma wave
#

i can see why they did it tbf

tranquil crane
#

that whole language is a minefield

prisma wave
#

fromIntegral (length happyCount)

#

fromIntegral converts an Int to a "Float"

#

because you can only do truncating division on ints

cinder flare
#

okay looking at my boy Matt's code

#

I don't see what I did wrong

ocean quartz
#

Share code

static zealot
#

you didn't cast

#

to double did you?

#

or float

cinder flare
#

no?

tranquil crane
#

System.`in` in kotlin is cursed

cinder flare
#

what would I cast

static zealot
#

yeah that's what I didn't do either

cinder flare
#
fun main(args : Array<String>) {
    val input = Scanner(System.`in`)
    val n = input.nextInt()
    if (input.hasNextLine()) {
        input.nextLine()
    }
    var counter = 0
    for (i in 0 until n) {
        val snake = input.nextLine()
        if (snake.startsWith(">-") || snake.endsWith("-<")) {
            counter++
        }
    }
    println(((counter / n) * 100).toString() + "%")
}```
old wyvern
#

yea new round

#

haskell did not do me well

static zealot
#

also for some reason it doesn't let me do println(int + "%")

prisma wave
#

shame

tranquil crane
#

you didn't truncate the percentage

static zealot
#

or whatever int + string

#

in print

cinder flare
#

yeah you gotta toString it

winter iron
#

println((((counter / n.tofloat()) * 100).toint()).toString() + "%")

#

@cinder flare ^