Author Topic: Ocu  (Read 1210 times)

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Ocu
« on: August 10, 2014, 09:10:37 AM »
I decided to write my own focusing line, mostly because I can't make head or tail of Oculus, and I don't really like using code I don't understand. As it turns out, it's a lot shorter than Oculus 2 and does almost the same thing. The only difference I can see is that, if the highest value in an eye is tied between several, it picks the one with the highest eye number, e.g. if it's a tie between eye5 and eye6, it will pick eye6. Does that make sense? Anyway, here's the code.

*.eye1 *.eye2 floor *.eye3 floor *.eye4 floor *.eye5 floor *.eye6 floor *.eye7 floor *.eye8 floor *.eye9 floor *.eye1 over sub ++ sgn 0 floor swap *.eye2 over sub ++ sgn 0 floor 2 mult swap *.eye3 over sub ++ sgn 0 floor 3 mult swap *.eye4 over sub ++ sgn 0 floor 4 mult swap *.eye5 over sub ++ sgn 0 floor 5 mult swap *.eye6 over sub ++ sgn 0 floor 6 mult swap *.eye7 over sub ++ sgn 0 floor 7 mult swap *.eye8 over sub ++ sgn 0 floor 8 mult swap *.eye9 swap sub ++ sgn 0 floor 9 mult floor floor floor floor floor floor floor floor 5 sub .focuseye store

Not as efficient as Ashton's Oculus III, but more compact, and I think it would also execute faster. It's not thoroughly tested, but as far as I can tell, it seems to work. Let me know what you think of it, and feel free to use it if you like.

EDIT: Ocul, longer but behaves exactly like Oculus II as far as I can tell.

*.eye1 *.eye2 floor *.eye3 floor *.eye4 floor *.eye5 floor *.eye6 floor *.eye7 floor *.eye8 floor *.eye9 floor *.eye1 over sub ++ sgn 0 floor swap *.eye2 over sub ++ sgn 0 floor 3 mult swap *.eye3 over sub ++ sgn 0 floor 5 mult swap *.eye4 over sub ++ sgn 0 floor 7 mult swap *.eye5 over sub ++ sgn 0 floor 9 mult swap *.eye6 over sub ++ sgn 0 floor 8 mult swap *.eye7 over sub ++ sgn 0 floor 6 mult swap *.eye8 over sub ++ sgn 0 floor 4 mult swap *.eye9 swap sub ++ sgn 0 floor 2 mult floor floor floor floor floor floor floor floor dup - 2 add 0 floor -4 mult swap dup 2 sub abs - ++ 0 floor 4 mult swap dup 3 sub abs - ++ 0 floor -3 mult swap dup 4 sub abs - ++ 0 floor 3 mult swap dup 5 sub abs - ++ 0 floor -2 mult swap dup 6 sub abs - ++ 0 floor 2 mult swap dup 7 sub abs - ++ 0 floor - swap 8 sub abs - ++ 0 floor add add add add add add add .focuseye store
« Last Edit: August 11, 2014, 08:50:07 AM by Billy »
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Ocu
« Reply #1 on: August 10, 2014, 11:54:40 AM »
Agree, the only thing missing from the SS guide that will make it more 'official' is handling cases as described above.

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Ocu
« Reply #2 on: August 10, 2014, 01:15:24 PM »
Agree, the only thing missing from the SS guide that will make it more 'official' is handling cases as described above.

What? Did you post this in the wrong thread?
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Ocu
« Reply #3 on: August 10, 2014, 01:38:57 PM »
A little confusion here, sorry.

Looks like you where using the SS guide as far as I can tell in you code.
If the SS guide was (I infer) correctly written, you should have been able to avoid the problem you are having.
The problem you are having is that it picks an eye of the highest number if the highest value in an eye is tied between several.

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Ocu
« Reply #4 on: August 10, 2014, 02:05:38 PM »
Oh, I see. I was not, in fact, using the SS guide. I have, over time, developed my method of conditionless DNA writing pretty much from scratch, because when I started learning it, none of the guides made sense to me. If my code looks similar to that detailed in the SS guide, that is purely by chance.

I can see a way to fix the problem, but it makes the code longer, and for little benefit IMO, so I left it as it is. I think that the reason Ocu is so much shorter than Oculus is my extensive use of the "floor" operator in finding the highest value in a stack.
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Ocu
« Reply #5 on: August 10, 2014, 02:52:36 PM »
Here's the way I think would fix the problem. I haven't tested this code yet, so it's probably broken, but you can get an idea of what I'm trying to do. Unfortunately, it makes it much longer, but oh well. Still shorter than Oculus II, IIRC. I'll call this one "Ocul".

*.eye1 *.eye2 floor *.eye3 floor *.eye4 floor *.eye5 floor *.eye6 floor *.eye7 floor *.eye8 floor *.eye9 floor *.eye1 over sub ++ sgn 0 floor swap *.eye2 over sub ++ sgn 0 floor 3 mult swap *.eye3 over sub ++ sgn 0 floor 5 mult swap *.eye4 over sub ++ sgn 0 floor 7 mult swap *.eye5 over sub ++ sgn 0 floor 9 mult swap *.eye6 over sub ++ sgn 0 floor 8 mult swap *.eye7 over sub ++ sgn 0 floor 6 mult swap *.eye8 over sub ++ sgn 0 floor 4 mult swap *.eye9 swap sub ++ sgn 0 floor 2 mult floor floor floor floor floor floor floor floor dup - 2 add 0 floor -4 mult swap dup 2 sub abs - ++ 0 floor 4 mult swap dup 3 sub abs - ++ 0 floor -3 mult swap dup 4 sub abs - ++ 0 floor 3 mult swap dup 5 sub abs - ++ 0 floor -2 mult swap dup 6 sub abs - ++ 0 floor 2 mult swap dup 7 sub abs - ++ 0 floor - swap 8 sub abs - ++ 0 floor add add add add add add add .focuseye store
« Last Edit: August 10, 2014, 05:29:10 PM by Billy »
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Ocu
« Reply #6 on: August 10, 2014, 03:26:20 PM »
 8)

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Ocu
« Reply #7 on: August 10, 2014, 05:30:06 PM »
Yep, there were some errors in Ocul. I've fixed them now, it seems to work. I've edited my post with the fixed version.
« Last Edit: August 10, 2014, 05:31:43 PM by Billy »
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Ocu
« Reply #8 on: August 10, 2014, 10:09:39 PM »
awesome! sorry, not a bot dev. directly, can not offer further insight.