Graal Forums Programming Exercise #3
 User Name Remember Me? Password
 FAQ Members List Calendar Search Today's Posts Mark Forums Read

 Thread Tools Search this Thread Display Modes
#46
04-06-2008, 02:35 PM
 Chompy ¯\(º_o)/¯ Join Date: Sep 2006 Location: Norway Posts: 2,815
Quote:
 Originally Posted by Horrified Pffft! PHP Code: ``` 3/0  ``` Dumb noobs.
o.o hmm?

oh, and when is exercise 4 coming? And could 4 have two difficults? One simplier and one harder?
 __________________
#47
04-11-2008, 01:59 PM
 Mark Sir Link Kevin Azite Join Date: Sep 2005 Posts: 1,489
Quote:
 Originally Posted by Tolnaftate2004 Give us pseudocode, then.
I got it working O(1) but forget sharing with you guys!

the previous is a lie but I'm tempted to make something ridiculous like O(n!) and declare it O(1) and laugh @ noobs who believe it
#48
04-22-2008, 09:53 AM
 Tolnaftate2004 penguin. Join Date: Jul 2004 Location: Berkeley, CA Posts: 534
 Okay, well this thread has been dead for sufficiently long time. Here is what I came up with; it takes quadratic time. PHP Code: ``` function onCreated() {  temp.p = getpatterns("THISISATESTSTRING");  for (temp.s: temp.p) {    if (this.(@"h_"@temp.s) >= 2)      echo(temp.s @ ": "@ this.(@"h_"@temp.s));    this.(@"h_"@temp.s) = 0; /* clean-up */  }}function getpatterns(s) {  temp.l = s.length();  for (temp.i=0; temp.i
 __________________ ◕‿‿◕ · pfa · check yer syntax! · src Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 04-23-2008 at 11:45 PM..
#49
04-22-2008, 10:35 AM
 Inverness Incubator Join Date: Aug 2004 Location: Houston, Texas Posts: 3,613
 Maybe try doing it in a language that doesn't allow you to dynamically create new variables.
 __________________
#50
04-22-2008, 06:35 PM
 Tolnaftate2004 penguin. Join Date: Jul 2004 Location: Berkeley, CA Posts: 534
Quote:
 Originally Posted by Inverness Maybe try doing it in a language that doesn't allow you to dynamically create new variables.
So I would use a hash, and it would still run in quadratic time. Also, the instructions say we're making this as efficient as possible in graal script.
 __________________ ◕‿‿◕ · pfa · check yer syntax! · src Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
#51
04-22-2008, 10:04 PM
 cbk1994 the fake one Join Date: Mar 2003 Location: San Francisco Posts: 10,718
Quote:
 Originally Posted by Tolnaftate2004 Okay, well this thread has been dead for sufficiently long time. Here is what I came up with; it takes quadratic time. PHP Code: ``` function onCreated() {   temp.p = getpatterns("THISISATESTSTRING");   for (temp.s: temp.p) {     if (this.(@"h_"@temp.s) >= 2)       echo(temp.s @ ": "@ this.(@"h_"@temp.s));     this.(@"h_"@temp.s) = 0; /* clean-up */   } } function getpatterns(s) {   temp.l = s.length();   temp.pat.clear();   for (temp.i=0; temp.i
There are always improvements to be made, unless Stefan makes it, in which case it must be perfect.
 __________________
#52
04-22-2008, 10:28 PM
 Programmer Coder Join Date: Jan 2008 Location: -78.464422, 106.837328 Posts: 449
Quote:
 Originally Posted by cbkbud There are always improvements to be made, unless Stefan makes it, in which case it must be perfect.
Even Stefan makes mistakes. You should see Kingdoms Debug and Zone Debug xD
 __________________ - Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
#53
04-23-2008, 02:12 AM
 Tolnaftate2004 penguin. Join Date: Jul 2004 Location: Berkeley, CA Posts: 534
Quote:
 Originally Posted by cbkbud There are always improvements to be made...
This can be disproved.
 __________________ ◕‿‿◕ · pfa · check yer syntax! · src Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
#54
04-23-2008, 07:28 AM
 Inverness Incubator Join Date: Aug 2004 Location: Houston, Texas Posts: 3,613
Quote:
 Originally Posted by cbkbud There are always improvements to be made
Maybe for you, considering your level of skill, but the same does not go for others.
 __________________
#55
04-23-2008, 01:08 PM
 cbk1994 the fake one Join Date: Mar 2003 Location: San Francisco Posts: 10,718
Quote:
 Originally Posted by Inverness Maybe for you, considering your level of skill, but the same does not go for others.
Yes, I have so much skill, it cannot be controlled.

THE POWER OF THE SUN IN THE CHRIS.
 __________________
#56
04-23-2008, 11:56 PM
 Tolnaftate2004 penguin. Join Date: Jul 2004 Location: Berkeley, CA Posts: 534
 I think it is feasible to shrink time to ~ aN + O(N log N). How might we go about doing this? How do we get a logarithmic factor in our order? How can this help us speed up our algorithm? This post points out a pitfall in computing the algorithm efficiency. The questions above and this problem are related. How can we minimize the effects of substring()?
 __________________ ◕‿‿◕ · pfa · check yer syntax! · src Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 04-24-2008 at 12:16 AM..

 Tags pattern-matching, programming-exercise

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General Forums     Graal Main Forum (English)         Hello and Goodbyes         Birthday Forum         Guild Life         Job Forum             Global Scripting Team             Playerworld Administration Team             Forum moderation Team             Graal Kingdoms Team             Graal Zone Team             Wiki Administration Team         Server Maintenance         Discussions en Francais (Français)         Diskussionsforum (Deutsch)     Forum Rules and documentation     Non-Graal-related threads Graal V6 forums     Announcements     Your opinion     Questions about V6     Feature request     Bug Report Gold Servers     Graal Kingdoms         Markets         Kingdoms             Dustari             Forest             Crescent Pirates             Samurai             Zormite Republic         Graal Kingdoms Events         Information             Gods         GK Suggestions         GK Bugs     Zone         Gfx submissions         Information         Zone Suggestions.         Zone Bugs         Zone News         Zone PC PlayerWorlds     PlayerWorlds Main Forum         Playerworld Related Information     Playerworld Staff Openings     Bomy Island Main Forum         Kingdoms Main Forum         Events and Activities         Bugs and Future Improvements             New Races     Classic Main Forum         Classic News         Classic Bugs and suggestions         Hiring for Classic     Delteria Main Forum         Delteria News         Delteria Bugs and suggestions         Hiring for Delteria     Era Main Forum         Era News         Era Bugs and improvements         Hiring for Era         Era Wiki     N-Pulse Main Forum         N-Pulse News         N-Pulse Bugs and suggestions         Hiring for N-Pulse     Unholy Nation Main Forum         Unholy Nation News         Unholy Nation Bugs and improvements         Hiring for Unholy Nation     Valikorlia Main Forum         Valikorlia News         Valikorlia Bugs and suggestions         Hiring for Valikorlia     Zodiac Main Forum         Zodiac News         Zodiac Bugs and suggestions         Hiring for Zodiac Development Forums     Level Design     Graphic Design     Sounds & Music     Gani Construction     Videos     NPC Scripting         New Scripting Engine (GS2)         Old Scripting Engine (GS1)         Code Gallery     Tech Support         Bug Reports (No posting)     Future Improvements Private forums

All times are GMT +2. The time now is 02:44 AM.

 -- Graal Forums - Author on top -- Mobile -- Graal Forums - Old Layout Contact Us - Graal - Archive - Privacy Statement - Top