Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK code challenge

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Oct 2016 20:13
Thaks for testing BlinkOK. I didn't reset the array after generating. Fixed version:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 25th Oct 2016 20:43
Quote: " I live in Yorkshire, where our accent is so broad most of the UK don't understand a word we say."


Nope. Not a word.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 25th Oct 2016 23:12 Edited at: 25th Oct 2016 23:15
Entry 1 (winner's one)

AGK v1, v2


AGK v2 (same algorithm, different arrays initialization)


I have no idea about next challenge theme though.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 25th Oct 2016 23:24
BatVink, I've just tried your fixed version with "2222.001" and got "twenty two Million twenty two Thousand and one".
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 25th Oct 2016 23:35
Phaelax, I've checked your one with same "2222.001" and got "two million two hundred twenty two thousand one".
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 25th Oct 2016 23:41
damothegreat, I've checked your one too with same "2222.001" and got "twenty two million two hundred and twenty thousand hundred and zero one hundred".
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Oct 2016 23:49
None of us look for the decimal :p

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 26th Oct 2016 00:32
Glad to see a coding challenge with no media!

I would like to contribute you a code ported from DBP,
so you can create sound effects with code!

Raise the bar



[/url]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Oct 2016 09:12
@Scary Little Rabbit - yes, I didn't have time to implement decimals. negative points for me
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
damothegreat
User Banned
Posted: 26th Oct 2016 11:38 Edited at: 19th Jan 2017 19:19
....
damothegreat
User Banned
Posted: 26th Oct 2016 12:40 Edited at: 19th Jan 2017 19:19
....
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 26th Oct 2016 13:17
@Damo
I just tried it - it failed!

71.5 returns:
Quote: "Higher1 = 7 = 1
seven thousand one"
AGK V2 user - Tier 1 (mostly)
damothegreat
User Banned
Posted: 26th Oct 2016 13:35 Edited at: 19th Jan 2017 19:19
...
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Oct 2016 21:45
I'll be testing entries first thing in the morning, because I don't stay up past 10 anymore. I'm getting old.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 27th Oct 2016 04:42 Edited at: 27th Oct 2016 04:58
Well, I had picked up AppGameKit last year maybe during one of the big sales, but didn't have it installed and hadn't ever really used it so I wasn't planning on entering. I did play along using DBpro then decided to get set up and convert it over at the last minute.

If entries haven't been cut off yet, here is mine:



It handles negatives, commas, and zero. I haven't had time to convert right of the decimal, so it will simply drop the decimal and keep the left hand integer.

Only uses 2 arrays, and the function weighs in at 45 lines with 1 command per line.

Tested against the following:



A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 27th Oct 2016 07:59
what's I've missed is plain zero case. if it's possible I would move slightly modified line 42 of my function four lines down.

cut line 42
42 wrote: "if i = 1 or val(mid(req, 1, 1)) = 0 then exitfunction 'zero' + spaces(res <> '') + res"


paste right after "next", line 45 (previous 46)
46 wrote: "if i = 1 or val(mid(req, 1, l)) = 0 then exitfunction 'zero' + spaces(res <> '') + res"


and thereby
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Oct 2016 13:02
Technically, your submission is 4 hours late, but I'll take it. I just purchased AGK2, waiting for it to show up in my products list so I can download it. I have an appointment to get to this morning anyway.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 27th Oct 2016 14:25
It's no biggie, keep it fair, if I'm late I'm late


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 27th Oct 2016 15:55
Phaelax wrote: "Technically, your submission is 4 hours late, but I'll take it."

oh, I don't insist on that. only if one purpose of the challenge is to get the job done.

without the fix my function returns an empty string on '0' input (my bad, don't know how I missed it). on any other correct input data it produces correct output.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Oct 2016 16:38 Edited at: 28th Oct 2016 22:56
Scary Little Rabbit, I tested your version 1 entry. I've attached a pdf containing my test results. Here's an explanation of what "questionable grammar" means. I had always been taught "and" is only used to represent a decimal place. Some of you used it within the integer part of the numbers. Since different parts of the world have variations on how the say things (incorrectly like britain ) I did not count this against anyone, as we had some debate about this. I merely noted it. I included myself in the same tests and reviewed my own code as I did everyone else.

Tests were done in AGK2. I also ran my code through the speed test in AppGameKit 1 just for comparison. It was faster in AGK1. AppGameKit 2 also made it difficult to get an average time because it appears way more inconsistent. There would always be at least one huge spike in the 10 samples I used for average. (the steam popup every time I ran an app wasn't very appreciated either, cmon tgc)

Ortu
Roughly 45 lines of code with only 2 arrays. Translations were accurate, handles negatives but no decimals.

damothegreat
Function had 38 lines of code and used 4 arrays. Translations were 50% accurate with 1 fatal crash. Speed was good but high numbers saw a huge spike in time.

Scary Little Rabbit
57 line function with 4 arrays. Had a few issues with accuracy but it did pass the decimal test, though I flagged it as "questionable grammar" due to the dash in "twenty-three". I did have to alter your funny little man text, as it caused a crash due to utf-8 conversion or some bs (but no points deducted for it).

BatVink
49 line function with 4 arrays. Speed was very good and the most consistent with higher numbers. However, the translation accuracy is what hurt this one.

Phaelax
Function written in under 40 lines but used an additional helper function that would've put it closer to 45. Four arrays used. Speed seemed linearly consistent with the length of the number, but ultimately proved to be one of the slowest overall.

MadBit
Two functions for roughly 68 lines and utilizing 4 arrays, this one is one of the faster routines. Accuracy-wise, it only failed on zero, passing the decimal test.

And the winner is......

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 28th Oct 2016 17:26
And what is with me ?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Oct 2016 17:46
Congrats Ortu.
Thank you Phaelax for organising.
Well done to all who submitted an entry.

I think you tested an older version of mine but no worries, I would have failed anyway if BlinkOK hadn't pointed out my fatal error.

This was a good start to the challenges, a couple of minor hiccups to be expected. My suggestion is to put the final entries for each challenge in a separate thread. Only one post per person in the thread, if an update is required then your original post must be edited. This will make sure the latest version is picked up and nobody is missed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
damothegreat
User Banned
Posted: 28th Oct 2016 17:50 Edited at: 19th Jan 2017 19:19
...
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 28th Oct 2016 20:01 Edited at: 28th Oct 2016 20:04
great! congratulations to Ortu, thanks to the host and the competitors! it was pretty funny for me.

OK,Phaelax, what if you were took my second entry and also have uncommented that line to strip commas from input — was my function most accurate then?

btw, English is not my native language obviously. I've used this guide to learn how to spell numbers. can you guys explain to me the rule for '23' to write it 'twenty three' and not 'twenty-three'? as like for 6 years old kid, I'm not really smart actually.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 28th Oct 2016 20:27
Phaelax wrote: "I did have to alter your funny little man text, as it caused a crash due to utf-8 conversion or some bs (but no points deducted for it)"

I have all my source files encoded in UTF-8. you know it's nice of course to have no points deducted while the source altered, although I'm just curious why did you not make the next step in altering and didn't uncomment the only one fully commented line at the very beginning of the function with clear note "uncomment if it's comma separated numbers like '123,345,789'"? yes, I've missed "please" in it but still…
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
damothegreat
User Banned
Posted: 28th Oct 2016 21:35 Edited at: 19th Jan 2017 19:19
...
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 28th Oct 2016 22:08
damothegreat wrote: "Here a link to provide some useful results for your interest

http://www.calculatorsoup.com/calculators/conversions/numberstowords.php"

nice. exactly same results with my stuff, even for "-23.0001".
Quote: "negative twenty-three and one ten-thousandth"

or "-23.0123"
Quote: "negative twenty-three and one hundred twenty-three ten-thousandths"

note the endings like "ths".
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 28th Oct 2016 22:14
I agree I failed here. technically. I want to make sure you grok the way I failed.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Oct 2016 23:06
Quote: "although I'm just curious why did you not make the next step in altering and didn't uncomment the only one fully commented line at the very beginning of the function with clear note "uncomment if it's comma separated numbers like '123,345,789'"? yes, I've missed "please" in it but still…"


I only made a small edit so your code would run. Whatever characters you used in this: 'too much... ¯\\_(ツ)_/¯' would not compile for me. Other than that, I take everyone's code as-is. I shouldn't need to alter code (comment or uncomment) depending on the type of input. I can test your latest version to see how it compares.


MadBit, super sorry! I somehow missed your post. I've updated the spreadsheet with your results. I've already chosen Ortu as the winner this time. But to be honest, after testing yours I think I would have chosen you as the winner.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 28th Oct 2016 23:18
for your interest: Ortu's entry has a significant issue (for me, but surely I'm not so good in the Queen's English) — there's no need to say "zero thousand", "zero million", etc if there's zeros only in the thousandfold 3-digit places of a number. now try "1000123" or "1000000123" or "1000123456".
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 28th Oct 2016 23:34 Edited at: 28th Oct 2016 23:34
and same point for MadBit's one but it's even more worse since there's no "zero" added. eg "1000000123":
Quote: " one billion million thousand one hundred twenty three "
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
damothegreat
User Banned
Posted: 28th Oct 2016 23:39 Edited at: 19th Jan 2017 19:19
...
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 29th Oct 2016 01:46
Hey thanks guys, was fun.

I'll get the next challenge posted up tomorrow I've got a couple of ideas in mind


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 29th Oct 2016 04:22
Quote: "
MadBit, super sorry! I somehow missed your post. I've updated the spreadsheet with your results. I've already chosen Ortu as the winner this time. But to be honest, after testing yours I think I would have chosen you as the winner.
"


After looking at the updated results, I'd have to agree, speeds are similar in the lower ranges, madbit edges me out in the larger numbers, though I use a shorter single function and less array memory. This could arguably go either way, but the biggest point in my mind is the handling of the decimal, I'd have a fail on 0 win out over a fail on decimals.

I don't mind stepping down as runner up, his entry was certainly valid and should be considered.

Quote: "
for your interest: Ortu's entry has a significant issue (for me, but surely I'm not so good in the Queen's English) — there's no need to say "zero thousand", "zero million", etc if there's zeros only in the thousandfold 3-digit places of a number. now try "1000123" or "1000000123" or "1000123456".
"


Doh! I hadn't considered a case for a set of 000 within a group, good catch.


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Oct 2016 06:40
Quote: "Doh! I hadn't considered a case for a set of 000 within a group, good catch."

Me either. And it appears that most, if not all, of us would've failed that test!

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 29th Oct 2016 09:48
Phaelax wrote: "And it appears that most, if not all, of us would've failed that test!"

certainly not all.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 29th Oct 2016 13:13
wrote: "MadBit, super sorry! I somehow missed your post. I've updated the spreadsheet with your results. I've already chosen Ortu as the winner this time. But to be honest, after testing yours I think I would have chosen you as the winner."


Wow, that surprised me a bit.
I will probably have to skip the next competition, because I came to the hospital tonight.
Otherwise, I can only say congratulations to all participants.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 30th Oct 2016 15:32
also… (I'm just warming up, heh) did you know what is the right way to write the spelling of number 40 in English? it's actually "forty" and never "fourty". yep.

so bad luck Ortu, MadBit, BatVink… and me too. now I'm going to take my words back. my function officially does not produce correct output on any other besides zero correct input data. damned copy-paste.

what's especially funny damothegreat previously told about "fourty severn" as one of spelling mistakes.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 30th Oct 2016 18:15
Well, let's keep it moving.

Inspired by this thread

Challenge 2
Title: Solar System
Deadline: Sunday, Nov 6
Description:
Give us your take on our solar system be it 3d, 2d, or even text. As per standard rules, all media must be generated within the code. The sun and planets should be present and identifiable in some manner. Bonus points for animation and inclusion of additional bodies such as moons. I still consider Pluto to be a planet , but for the purposes of this challenge, it will be considered an additional body.


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
damothegreat
User Banned
Posted: 30th Oct 2016 18:34 Edited at: 19th Jan 2017 19:20
...
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Oct 2016 21:42
Quote: " I still consider Pluto to be a planet "

You're darn skippy it's a planet! But did you know, the planet they now consider to be our ninth is so massive that it causes the sun to tilt?

This could be quite a challenge, as AppGameKit I feel has less to work with in terms of generating media than DB did.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 30th Oct 2016 23:08 Edited at: 30th Oct 2016 23:09
I'm still feeling out agk's capabilities to be honest, but for this I think it's doable to get something basic up and running without making it too complicated.

The challenge here will be completing the basics while keeping a good grip on scope. It's easy to get carried away with cool ideas to add, but knowing when and what to cut/limit is important too


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
damothegreat
User Banned
Posted: 31st Oct 2016 00:29 Edited at: 19th Jan 2017 19:20
...
damothegreat
User Banned
Posted: 1st Nov 2016 19:37 Edited at: 19th Jan 2017 19:20
...

Attachments

Login to view attachments
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 1st Nov 2016 21:32
Hard to say considering it was only posted Sunday, then Monday was a holiday.

I'm wrapping up a simple 2d entry, with a todo list of improvements I'd like to get to by the end of the week


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Nov 2016 21:51
This one is a little too ambitious for me this week with the time I have available. I will be back for the next one.

I would reiterate my suggestion that this thread is the primary one for setting and discussing, but a separate thread is created for each challenge to post the entries, one post per entrant.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 2nd Nov 2016 05:23 Edited at: 2nd Nov 2016 06:19
Bah where's that TGC 'can-do' attitude?!

It really doesn't need to be too complicated, here is a simple one I did in a few hours today



It's about 200 lines (including blanks and comments)

The differences between min and max size and distance gets too massive to easily display on screen all at once. I got a little creative in these scales but hopefully kept the essence of feeling for diameter, orbital distance, and orbital speed. The outer bodies only show for a portion of the orbit due to the non-square screen space, but they will come into view at times.




Edit*

Quote: "
I would reiterate my suggestion that this thread is the primary one for setting and discussing, but a separate thread is created for each challenge to post the entries, one post per entrant.
"


That's fine, and the post can still be edited/updated up until the deadline


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.

Attachments

Login to view attachments
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 2nd Nov 2016 05:59 Edited at: 2nd Nov 2016 06:09
@damothegreat

I like the info display at the bottom and the tilt control is a nice touch, but you are reporting the same value for radius and area.

I'm not sure that simply embedding images as giant arrays of pre-processed data is entirely in the spirit of 'code generated, no external' media.

You've got appropriate orbital speeds, but the orbital distances are just evenly stepped out and not to scale. Some of the planetary size scales seem off as well.

Also, the orbits should run counter-clockwise

the program is generally impressive for the quick turn around time.


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 2nd Nov 2016 07:02
Quote: "Also, the orbits should run counter-clockwise "

Nope.
That entirely depends on where you are viewing the solar system from.
AGK V2 user - Tier 1 (mostly)
damothegreat
User Banned
Posted: 2nd Nov 2016 09:28 Edited at: 19th Jan 2017 19:21
...

Login to post a reply

Server time is: 2024-04-25 17:19:38
Your offset time is: 2024-04-25 17:19:38