• [ENDED] (Results Soon) Code Golf - The Reboot #2 4 4
Currently:  

Author Topic: [ENDED] (Results Soon) Code Golf - The Reboot #2  (Read 42248 times)

0 Members and 1 Guest are viewing this topic.

Offline pimathbrainiac

  • Occasionally I make projects
  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
[ENDED] (Results Soon) Code Golf - The Reboot #2
« on: June 08, 2015, 04:56:49 pm »
Challenge #2: Motion Commotion
The challenge: Make a program that moves a pixel around the screen.

Inputs:
You may either use the arrow keys or wasd for input.

Outputs:
Each time a key is pressed, a pixel moves around the screen as follows:
up/w: up 1 pixel
down/s: down 1 pixel
left/a: left 1 pixel
right/d: right 1 pixel
If a key is held, it doesn't matter. 1 pixel of movement per press.

Scoring:
All non-calculator programs will be scored through this counter: http://juju2143.ca/golf/
Assembly programs will be scored on binary size (excluding the header), and Basic/Axe programs will be scored bn on-calc source size (once again, excluding the header).
Good luck, and may this contest move you!

Rankings
1) lirtosiast - 27 Bytes (TI-Basic)
2) ben_g - 47 Bytes (TI-Basic)
3) Siapran - 139 Bytes (PICO-8)
4) Juju - 144 Bytes (PICO-8)
5) LDStudios - 153 Bytes (PICO-8)
6) Scipi - 154 Bytes (GBA C)
7) alberhrocks - 253 Bytes (Pygame)
8 ) alberthrocks - 397 Bytes (SDL C)

Language Ranking
1) TI-Basic (27 Bytes)
2) PICO-8 (139 Bytes)
3) GBA C (154 Bytes)
4) Pygame (253 Bytes)
5) SDL C (397 Bytes)
« Last Edit: June 15, 2015, 12:41:59 am by pimathbrainiac »
I am Bach.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Code Golf - The Reboot #2
« Reply #1 on: June 08, 2015, 05:27:11 pm »
Sounds fun. What do you mean by pixel, at least on PC? An actual pixel? Or it can be a *?

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline pimathbrainiac

  • Occasionally I make projects
  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #2 on: June 08, 2015, 05:28:30 pm »
Sounds fun. What do you mean by pixel, at least on PC? An actual pixel? Or it can be a *?

An actual pixel, preferably black.
I am Bach.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Code Golf - The Reboot #2
« Reply #3 on: June 08, 2015, 05:32:17 pm »
Sounds fun. What do you mean by pixel, at least on PC? An actual pixel? Or it can be a *?

An actual pixel, preferably black.
In a window or on the whole screen? Anyway, sounds like it requires a few graphic libraries.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline pimathbrainiac

  • Occasionally I make projects
  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #4 on: June 08, 2015, 05:33:04 pm »
Sounds fun. What do you mean by pixel, at least on PC? An actual pixel? Or it can be a *?

An actual pixel, preferably black.
In a window or on the whole screen? Anyway, sounds like it requires a few graphic libraries.

Either works, and yeah, that's the point. This one gives advantages to calcs.
I am Bach.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Code Golf - The Reboot #2
« Reply #5 on: June 08, 2015, 05:48:01 pm »
Yeah, I see, or any language with integrated graphics :P

Also some more questions: I have to erase the pixel before moving it, right? Also can I allow it to go out of bounds?

EDIT: pimath says yes and no no and yes, respectively. Sorry for all the questions, I think I'm done :P
« Last Edit: June 08, 2015, 05:56:25 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Code Golf - The Reboot #2
« Reply #6 on: June 08, 2015, 07:03:16 pm »
I've taken a stab at it in C again and my first attempt is 155 bytes. I've targeted the GBA to make things much shorter.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline ordelore

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +7/-0
  • Genius and Friend
    • View Profile
    • ordelore8x
Re: Code Golf - The Reboot #2
« Reply #7 on: June 09, 2015, 11:09:01 am »
Is there any specific size the window should be if we are making a computer program?
I am a friend.
I mine Bitcoins.

Offline pimathbrainiac

  • Occasionally I make projects
  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #8 on: June 09, 2015, 11:24:46 am »
Is there any specific size the window should be if we are making a computer program?

No. That is not a restriction.
I am Bach.

Offline lirtosiast

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +1/-0
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #9 on: June 09, 2015, 03:09:14 pm »
Do we need to initialize the cursor at any specific location, do we need to clear the screen first, and can we assume that the only pressed keys will be up, down, left, and right?

Offline pimathbrainiac

  • Occasionally I make projects
  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #10 on: June 09, 2015, 03:45:30 pm »
no, no, and yes.
I am Bach.

Offline lirtosiast

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +1/-0
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #11 on: June 09, 2015, 04:04:00 pm »
Okay, I have 34 bytes in TI-BASIC, and that includes clearing the screen and starting the cursor at (0,0).

30 bytes if we don't need to initialize the cursor and it only works for a few seconds :P
« Last Edit: June 09, 2015, 04:17:48 pm by lirtosiast »

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: Code Golf - The Reboot #2
« Reply #12 on: June 09, 2015, 04:24:02 pm »
11 bytes in TI-BASIC :p
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

Offline lirtosiast

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +1/-0
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #13 on: June 09, 2015, 05:22:32 pm »
I fixed my solution; now it doesn't repeat keys.
« Last Edit: June 11, 2015, 11:52:05 pm by lirtosiast »

Offline pimathbrainiac

  • Occasionally I make projects
  • Project Author
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Code Golf - The Reboot #2
« Reply #14 on: June 09, 2015, 05:23:39 pm »
Ivoah: Wow! (assuming your solution is correct)

My answer is actually wrong because the keys repeat, and it will cost about 5 bytes to fix.

Well he was wrong. Don't worry :P Same thing with the key repeat and also a perceived loophole that wasn't actually there
I am Bach.