Register
Hello There, Guest!


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
treasure finder :D
#1
just put it in a code reader for the coding language HTML if you need a website here you go https://repl.it/languages/web_project to do it just click on it and a hint thing will pop up at the bottom the number of clicks is 25
Code:
    <!DOCTYPE html>
    <html>
    <head>
    <head>
    
    <body>
        <h1 id = "heading">Find the Treasure!</h1>
        <img id = "map" width = 400 height = 400 src =
                "https://nostarch.com/images/treasuremap.png">
        <p id = "distance"></p>
        <script src="https://code.jquery.com/jquery-2.1.0.js"></script>
        
        <script>
        function getRandomNumber(size)
        {
            return Math.floor(Math.random() * size);
        }
        
        var width = 400;
        var height = 400;
        var treasure = {x : getRandomNumber(width),
                        y : getRandomNumber(height)};
        var clicks = 0;
        var clickLimit = 25;
        function getDistance(event, treasure)
        {
            var diffX = event.offsetX - treasure.x;
            var diffY = event.offsetY - treasure.y;
            return Math.sqrt((diffX * diffX) + (diffY * diffY));
        }
        
        function getDistanceHint(distance)
        {
            if(distance < 10)
                return "Boiling hot";
            else if (distance < 20)
                return "Really hot";
            else if (distance < 40)
                return "Hot";
            else if(distance < 80)
                return "Warm"
            else if (distance < 160)
                return "Cold";
            else if (distance , 360)
                return "Really cold";
            else
                return "Freezing"
        };
        
        function clickHandler(event)
        {
            if (clicks < clickLimit)
            {
                clicks++;
                var distance = getDistance(event, treasure);
                var distanceHint = getDistanceHint(distance);
            
                $("#distance").text(distanceHint);
            
                if (distance < 8)
                alert("Found the treasure in " + clicks + " clicks");
            }
            else
                alert("You loose sucker")
        }
        
        $("#map").click(clickHandler);
        </script>
    </body>
    </html>
deal with it Cool
http://agarioforums.net/reputation.php?uid=4075

boi i am s11zilla do not underestimate my powers 

I AM THE FREAKING LOOMINATIS ARCH RIVAL I WILL SHATTER YOU TO PIECES

dont piss me off n00b i am awesomeness i will blind you if you mess with this


Reply
#2
Why remove the old thread and not just change the name? xD

Nvm, i get it
"Do you want to fly with a dragon?"

"No, I want to be a dragon flying"
Reply
#3
(07-08-2016, 07:48 PM)ℱIRE Wrote: Why remove the old thread and not just change the name? xD

Nvm, i get it

i had to change the coding real quick and for some reason i cant go into full edit
deal with it Cool
http://agarioforums.net/reputation.php?uid=4075

boi i am s11zilla do not underestimate my powers 

I AM THE FREAKING LOOMINATIS ARCH RIVAL I WILL SHATTER YOU TO PIECES

dont piss me off n00b i am awesomeness i will blind you if you mess with this


Reply
#4
(07-08-2016, 07:49 PM)s1104874 Wrote:
(07-08-2016, 07:48 PM)ℱIRE Wrote: Why remove the old thread and not just change the name? xD

Nvm, i get it

i had to change the coding real quick and for some reason i cant go into full edit

That was completely not what I thought xD lolol Big Grin   Tongue
"Do you want to fly with a dragon?"

"No, I want to be a dragon flying"
Reply
#5
I like how you went fully conventional (but your html is terrible); you could have been lazy and go for a more simpler, straightforward code. If you're looking for free hosting, you might want to take a look at fh10.net's services.
Reply
#6
(07-09-2016, 03:26 PM)Doigt Wrote: I like how you went fully conventional (but your html is terrible); you could have been lazy and go for a more simpler, straightforward code. If you're looking for free hosting, you might want to take a look at fh10.net's services.

~stares blankly~

What IS this thread?! I thought it was an Intro thread for S11 that I'd somehow missed. But clearly, it's nothing quite so simple.

HTML!

~Squirrel shudders noticeably~

Ever since I started working where I am now, I've been taking care of the companies Intranet (and now, it's Wiki).

HTML sucks!

And, like any good administrator-wanna-be, I LOATHE HTML in mail -- so when my eyes see HTML now, it's just... skip, skip, skip -- OK nothing important here.

And yet, as someone who's both taught, tutored and .. maybe even mentored? I like to stick up for people learning new things, and to encourage them.

So... ~bends @Doigt over & smacks his bottom~ ...even though @Doigt may be right, YOU GO GIRL! Get your code on. I guess you're now exploring JavaScript, which should be more exciting.

I don't suppose you'll get to do any PHP in your short time, but that would be a first step into server-side stuff, whereas what you've been playing with lately (JavaScript), is mostly on the end-user side.

Have fun with it! You can get quite creative, once you know the ropes. Smile


PS: OK, well this is comical! When I saw this post, I was reading through the Introductions section? So how did I get from there to Tech Talk?

I have no clue. But something smells... lol. Maybe it was me, somehow. But I don't see how I accomplished it. :|
Fight the Good Fight
(Listen with lyrics here!)
Make it worth the price we pay!
All your life you've been waiting for your chance,
Pray you'll fit into the Plan.
But you're the master of your own destiny,
So give and take the best that you can!
[-] The following 1 user Likes Squirrel 's post:
  • Doigt
Reply
#7
(07-09-2016, 03:53 PM)Squirrel Wrote:
(07-09-2016, 03:26 PM)Doigt Wrote: I like how you went fully conventional (but your html is terrible); you could have been lazy and go for a more simpler, straightforward code. If you're looking for free hosting, you might want to take a look at fh10.net's services.

~stares blankly~

What IS this thread?! I thought it was an Intro thread for S11 that I'd somehow missed. But clearly, it's nothing quite so simple.

HTML!

~Squirrel shudders noticeably~

Ever since I started working where I am now, I've been taking care of the companies Intranet (and now, it's Wiki).

HTML sucks!

And, like any good administrator-wanna-be, I LOATHE HTML in mail -- so when my eyes see HTML now, it's just... skip, skip, skip -- OK nothing important here.

And yet, as someone who's both taught, tutored and .. maybe even mentored? I like to stick up for people learning new things, and to encourage them.

So... ~bends @Doigt over & smacks his bottom~ ...even though @Doigt may be right, YOU GO GIRL! Get your code on. I guess you're now exploring JavaScript, which should be more exciting.

I don't suppose you'll get to do any PHP in your short time, but that would be a first step into server-side stuff, whereas what you've been playing with lately (JavaScript), is mostly on the end-user side.

Have fun with it! You can get quite creative, once you know the ropes. Smile


PS: OK, well this is comical! When I saw this post, I was reading through the Introductions section? So how did I get from there to Tech Talk?

I have no clue. But something smells... lol. Maybe it was me, somehow. But I don't see how I accomplished it. :|

Why go so harsh on HTML? It's the most important thing on the web! When you are this mean it will probably go away! Sad

Oh, and why are you still here when you skip threw HTML? (wich doesnt make sense at all btw Big Grin)

Forgot about the Thread lol... found the treasure in 12 clicks!
[Image: Voakie.png]
Reply
#8
If you hate html so much, squirrel , you might as well just do everything in xml, styled with xsl and css. Oh wait, xsl is actually html in disguise, my mistake.
[-] The following 1 user Likes Doigt's post:
  • Squirrel
Reply
#9
Hmmm I'm not going for the best coding ever done I got bored and didn't know what to do with it @Doigt its something I did in thirty minutes soooo I wasn't exactly thinking about convenience
deal with it Cool
http://agarioforums.net/reputation.php?uid=4075

boi i am s11zilla do not underestimate my powers 

I AM THE FREAKING LOOMINATIS ARCH RIVAL I WILL SHATTER YOU TO PIECES

dont piss me off n00b i am awesomeness i will blind you if you mess with this


Reply
#10
Haha, don't worry about it. I may seem harsh, but I don't put into practice what I preach; I deliberately avoid clean and efficient code, I tend to use obsolete attributes and elements when I don't want to toy with css (and some of the resources I use are only compatible with specific browsers). I think your js is top notch, do not let what I posted get to your head.
Reply
#11
(07-10-2016, 12:02 AM)Doigt Wrote: Haha, don't worry about it. I may seem harsh, but I don't put into practice what I preach; I deliberately avoid clean and efficient code, I tend to use obsolete attributes and elements when I don't want to toy with css (and some of the resources I use are only compatible with specific browsers). I think your js is top notch, do not let what I posted get to your head.

nah js is my main language as of recent Wink its cool it cool  Tongue Big Grin
deal with it Cool
http://agarioforums.net/reputation.php?uid=4075

boi i am s11zilla do not underestimate my powers 

I AM THE FREAKING LOOMINATIS ARCH RIVAL I WILL SHATTER YOU TO PIECES

dont piss me off n00b i am awesomeness i will blind you if you mess with this


Reply
#12
(07-09-2016, 05:53 PM)Voakie Wrote: Why go so harsh on HTML? It's the most important thing on the web! When you are this mean it will probably go away! Sad

Oh, and why are you still here when you skip threw HTML? (wich doesnt make sense at all btw Big Grin)

Forgot about the Thread lol... found the treasure in 12 clicks!

LOL, that's an easy answer.  For a time, some other dude took care of the Intranet and he used that bogus-BS MS PoS 'authoring' software, that I've forgotten oh-so-thank,...... NoooOooOoO!!! FK. I just remembered. "FrontPage"

What a PoS! And the guy who kept highlighting text selecting bold... or changing the font, or resizing... or changing the colour. FK!!!!!

Then you go look at the source, and its 347K long,... for a FK'n MENU PAGE!

And then my ignorant-boss/owner comes along, starts yelling at me for being slow, asks me what 'authoring tool' I'm using.

I look at him blankly, and answer very slowly, "It's called.... 'Notepad'..."

I finally get rid of him by promising to switch to something else... and continue removing BS tags, and cussing at the name of a former employee.

Oh. And 2 yrs later, he finds out I disobeyed him. So then we go talk to one of the admins, and he asks her what she'd use. "Oh, no need to 'use' anything. It's cleanest if you just use 'Notepad'..."  "What?!  Boss, are you okay?! Your face went all red!"

Aren't you sorry that you asked now, Goat-@Voakie ? :| (C'mon! You HAD to know a story like this was comin'!)
Fight the Good Fight
(Listen with lyrics here!)
Make it worth the price we pay!
All your life you've been waiting for your chance,
Pray you'll fit into the Plan.
But you're the master of your own destiny,
So give and take the best that you can!
[-] The following 2 users Like Squirrel 's post:
  • Doigt, Voakie
Reply
#13
(07-10-2016, 02:38 AM)Squirrel Wrote:
(07-09-2016, 05:53 PM)Voakie Wrote: Why go so harsh on HTML? It's the most important thing on the web! When you are this mean it will probably go away! Sad

Oh, and why are you still here when you skip threw HTML? (wich doesnt make sense at all btw Big Grin)

Forgot about the Thread lol... found the treasure in 12 clicks!

LOL, that's an easy answer.  For a time, some other dude took care of the Intranet and he used that bogus-BS MS PoS 'authoring' software, that I've forgotten oh-so-thank,...... NoooOooOoO!!! FK. I just remembered. "FrontPage"

What a PoS! And the guy who kept highlighting text selecting bold... or changing the font, or resising... or changing the colour. FK!!!!!

Then you go look at the source, and its 347K long,... for a FK'n MENU PAGE!

And then my ignorant-boss/owner comes along, starts yelling at me for being slow, asks me what 'authoring tool' I'm using.

I look at him blankly, and answer very slowly, "It's called.... 'Notepad'..."

I finally get rid of him by promising to switch to something else... and continue removing BS tags, and cussing at the name of a former employee.

Oh. And 2 yrs later, he finds out I disobeyed him. So then we go talk to one of the admins, and he asks her what she'd use. "Oh, no need to 'use' anything. It's cleanest if you just use 'Notepad'..."  "What?!  Boss, are you okay?! Your face went all red!"

Aren't you sorry that you asked now, Goat-@Voakie ? :| (C'mon! You HAD to know a story like this was comin'!)

DAYUM Exclamation
deal with it Cool
http://agarioforums.net/reputation.php?uid=4075

boi i am s11zilla do not underestimate my powers 

I AM THE FREAKING LOOMINATIS ARCH RIVAL I WILL SHATTER YOU TO PIECES

dont piss me off n00b i am awesomeness i will blind you if you mess with this


Reply
#14
(07-10-2016, 01:22 AM)Relaxm9 Wrote: If someone wanted to learn, how would you recommend for the, to start?





Could help me be staff ya know  Smile

If you thought you'd put me in a Catch-22, nope-nope! Learn it right here, my man:

http://www.w3schools.com/html/
Fight the Good Fight
(Listen with lyrics here!)
Make it worth the price we pay!
All your life you've been waiting for your chance,
Pray you'll fit into the Plan.
But you're the master of your own destiny,
So give and take the best that you can!
[-] The following 1 user Likes Squirrel 's post:
  • Relax
Reply
#15
haha! An authoring tool eh? Never heard of that, I used to use notepad as well and there is nothing better than that, with the exception of notepad++.
[-] The following 2 users Like Doigt's post:
  • s1104874, Squirrel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)