Author Topic: [CHALLENGE]Logic and Optimization  (Read 31969 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #15 on: November 20, 2010, 12:54:21 pm »
Where do you find this code ?
I made it :D It took me about 17 minutes, but I made it :D

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #16 on: November 20, 2010, 12:57:55 pm »
Code: [Select]
:Prompt E,N
:If E=2 and N=1
:Disp "NRML
:If E != 2 or N!=1
:Then
:If E=2 or N=1
:Then
:Disp "ALMST NRML
:Else
:Disp "WEIRD
80bytes, for the first challenge

This is missing two end statements plus it could be optimized to this:
Code: [Select]
Prompt E,N
If N(E=2
Disp "NRML
If E=2 or N=1
Disp "ALMST NRML
If ((N!=1)E!=2
Disp "WEIRD
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #17 on: November 20, 2010, 01:03:17 pm »
Where do you find this code ?
I made it :D It took me about 17 minutes, but I made it :D

Ok, sorry, there is some difference with my code :
Code: [Select]
:Input "Number :",Str1
:Input "From Base :",C
:Input "to Base :",D
:"123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str2
:length(Str1→A
:0
:For(Ɵ,1,A
:Ans+C^(A-Ɵ)inString(Str2,sub(Str1,Ɵ,1
:End
:Ans→B
:"0"+Str2→Str2
:While B
:int(B/D→C
:sub(Str2,B-DC+1,1)+Str1→Str1
:C→B
:End
sub(Str1,1,length(Str1)-A

200 bytes, 36 bases.
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #18 on: November 20, 2010, 01:08:57 pm »
New challenge!
make the smallest program possible with the final "e" rule for english.  (I had to make this yesterday, shows how you can use calcs in english too, XD)
I have 331 bytes with an 8 letter title

bascically, it lets you enter the root word, and the suffix, and combines it for you.  ;)
« Last Edit: November 20, 2010, 01:09:20 pm by yunhua98 »

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline MRide

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 711
  • Rating: +14/-0
  • You can't see this.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #19 on: November 20, 2010, 01:09:50 pm »
What do you mean? I don't understand.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #20 on: November 20, 2010, 01:11:15 pm »
New challenge!
make the smallest program possible with the final "e" rule for english.  (I had to make this yesterday, shows how you can use calcs in english too, XD)
I have 331 bytes with an 8 letter title

bascically, it lets you enter the root word, and the suffix, and combines it for you.  ;)

I'm not getting it either 'e-rule'?

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #21 on: November 20, 2010, 01:11:59 pm »
the rule:  A word ending in "e" plus a suffix starting with a consonent, the final "e" isn't dropped, if the suffix starts with a vowel, it is dropped, unless the root word's "e" is precede by a "c" or a "g" and the suffix starts with an "a" or "o"

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #22 on: November 20, 2010, 01:13:41 pm »
the rule:  A word ending in "e" plus a suffix starting with a consonent, the final "e" isn't dropped, if the suffix starts with a vowel, it is dropped, unless the root word's "e" is precede by a "c" or a "g" and the suffix starts with an "a" or "o"

Example?

Mode ---> Modable?
Name ---> Namable?

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #23 on: November 20, 2010, 01:14:52 pm »
kinda, Lone + ly = Lonely
Notice + able = noticeable
Bride + al = Bridal

but the final words gotta make sense, obviously.  XD

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #24 on: November 20, 2010, 01:15:59 pm »
Code: [Select]
:Prompt E,N
:If E=2 and N=1
:Disp "NRML
:If E != 2 or N!=1
:Then
:If E=2 or N=1
:Then
:Disp "ALMST NRML
:Else
:Disp "WEIRD
80bytes, for the first challenge

This is missing two end statements plus it could be optimized to this:
Code: [Select]
Prompt E,N
If N(E=2
Disp "NRML
If E=2 or N=1
Disp "ALMST NRML
If ((N!=1)E!=2
Disp "WEIRD

Yours uses 6 bytes more, and mine is not missing two end statements. It is the end of a program so it does not need them.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #25 on: November 20, 2010, 01:33:04 pm »
Code: [Select]
Prompt E,N
If N(E=2
Disp "NRML
If E=2 or N=1
Disp "ALMST NRML
If ((N!=1)E!=2
Disp "WEIRD

I had no idea of this tricks though :P

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #26 on: November 20, 2010, 01:34:51 pm »
Code: [Select]
Prompt E,N
If N(E=2
Disp "NRML
If E=2 or N=1
Disp "ALMST NRML
If ((N!=1)E!=2
Disp "WEIRD

I had no idea of this tricks though :P
Ah, well, it didn't work for me... It just displayed all three phrases.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #27 on: November 20, 2010, 01:35:56 pm »
Code: [Select]
Prompt E,N
If N(E=2
Disp "NRML
If E=2 or N=1
Disp "ALMST NRML
If ((N!=1)E!=2
Disp "WEIRD

I had no idea of this tricks though :P
Ah, well, it didn't work for me... It just displayed all three phrases.

How stupid of me, trust you!


Hhaha, just kidding, but the code makes sense even without trying it LOL

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #28 on: November 20, 2010, 01:37:36 pm »
What? It wasn't MY code! :D

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: [CHALLENGE]Logic and Optimization
« Reply #29 on: November 20, 2010, 01:38:47 pm »
What? It wasn't MY code! :D

:O!!! Sorry!

Now I see, it was mathias code, SORRY!