CodeWalrus

CodeWalrus Website => Contests => Topic started by: brentmaas on September 24, 2015, 07:12:21 pm

Title: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: brentmaas on September 24, 2015, 07:12:21 pm
First topic I've seen so far...

Quote from: iv.bat ~ README.txtiv.bat is made to be precisely 140 B and will, when run, check if it's 140 B.
If it is, it will write 'qq' at the end of the file, therefore becoming more that 140 B, break the filesize limit and invalidate itself.
When run again with the invalid version, it will tell you it's no longer a valid entry.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on September 24, 2015, 08:01:11 pm
Well, it does look interesting.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: DJ Omnimaga on September 24, 2015, 08:27:03 pm
So what is 140? The readme or the program? :P
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: Snektron on September 24, 2015, 08:33:20 pm
Nice idea :)
Are you actually allowed to release the program before it gets judged?
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: brentmaas on September 24, 2015, 08:51:26 pm
Quote from: DJ Omnimaga on September 24, 2015, 08:27:03 pm
So what is 140? The readme or the program? :P
The program is, but only if it hasn't had a single run yet :P.

Quote from: Cumred_Snektron on September 24, 2015, 08:33:20 pm
Nice idea :)
Are you actually allowed to release the program before it gets judged?
With 4x3, you weren't allowed to release source or binaries until after the contest was over. It would make sense to continue this rule.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on September 24, 2015, 08:58:13 pm
Quote from: brentmaas on September 24, 2015, 08:51:26 pm
Quote from: Cumred_Snektron on September 24, 2015, 08:33:20 pm
Nice idea :)
Are you actually allowed to release the program before it gets judged?
With 4x3, you weren't allowed to release source or binaries until after the contest was over. It would make sense to continue this rule.
It does make sense.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: DJ Omnimaga on September 25, 2015, 11:53:12 pm
Juju, you should maybe put the rules in the thread so people how to submit their stuff and what to and what not to do.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on September 26, 2015, 02:12:52 am
Yeah, I should update the rules.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: DJ Omnimaga on October 06, 2015, 12:41:18 am
How am I supposed to run this by the way? It tells me the file is invalid for the contest when I double-click it.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: brentmaas on October 06, 2015, 07:40:02 am
Quote from: DJ Omnimaga on October 06, 2015, 12:41:18 am
How am I supposed to run this by the way? It tells me the file is invalid for the contest when I double-click it.
That means you've run it at least once and it's now 142B in stead of 140B
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: DJ Omnimaga on October 06, 2015, 07:07:08 pm
Oh I see now. I'll redownload it.
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: p4nix on October 06, 2015, 07:35:16 pm
Can't you deinvalidate it opening it in a text editor or something? :o
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on October 06, 2015, 09:05:22 pm
Of course, you have to remove the last 2 bytes manually and you're good to go. The point here is that this script is self-modifying, so it's not the same output when you run it twice.
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: p4nix on October 06, 2015, 09:06:28 pm
I thought that, that's why I wondered why DJ Omnimaga redownloaded it.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on October 06, 2015, 09:07:57 pm
Well, that also works.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: DJ Omnimaga on October 07, 2015, 03:22:29 am
On a side note, did you guys know that self-modifying code is possible on calculators too? :P (eg in Axe and ASM to store highscores)
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: c4ooo on October 08, 2015, 07:31:52 pm
You generally dont want to use SMC, if you use it to store high scores or something, then you will have to do program write back, which isnt even suported in no stub programs, IIRC. Plus writing the program back will take extra time, as well as saturate your archive faster. Lastly you cant even do SMC in apps. SMC is good however for small optimization in programs - where the code modification is destroyed after the program exits (no write back)
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: Snektron on October 08, 2015, 07:33:41 pm
You can use SMC if you're writing an AI that improves itself :P
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on October 08, 2015, 07:40:42 pm
I actually considered making SMC a theme of a future contest, would it be too hard to do on calc? If so I guess I'll just do something else, I guess.
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: Snektron on October 08, 2015, 07:50:52 pm
You need some pretty high asm knowlege for that, so only like 3 people would participate...
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: Yuki on October 08, 2015, 07:56:02 pm
Figured, you'd have to find the right program in the VAT and modify it correctly, you'd need quite some knowledge. Same for PC languages to a certain extent, if you want to do something fancy, although @brentmaas' program is pretty much the simplest thing you can do in terms of SMC.
Title: Re: [CWick#1] iv.bat ~ Invalidating itself since 2015
Post by: c4ooo on October 08, 2015, 08:02:36 pm
Well.. as long as you allow the program to be destroyed after run then it wont be so hard, but its almost imposible to do (My brain auto-corrects to "do to" :P ) byte-by-byte SMC in axe. You could however swap out something like Goto XXXX with goto YYYY quiet easely if you know a thing or two about how axe works under the hood. Yet once again- not all people know that much. Further more, SMC will basicly prevent basic users from competing.
Title: Re: iv.bat ~ Invalidating itself since 2015
Post by: DJ Omnimaga on October 09, 2015, 06:06:50 am
Quote from: c4ooo on October 08, 2015, 07:31:52 pm
You generally dont want to use SMC, if you use it to store high scores or something, then you will have to do program write back, which isnt even suported in no stub programs, IIRC. Plus writing the program back will take extra time, as well as saturate your archive faster. Lastly you cant even do SMC in apps. SMC is good however for small optimization in programs - where the code modification is destroyed after the program exits (no write back)
Yeah that's the main issue. You need to make the program require a shell and I hate when it garbage-collects every three minutes because of program writeback.