Main Search
Delta Corp Forum Index
 
 
FAQ Members Groups Profile Private Messages

Important Notice: We regret to inform you that our free phpBB forum hosting service will be discontinued by the end of June 30, 2024. If you wish to migrate to our paid hosting service, please contact [email protected].
Brain Bogglers:Triangular Conundrum

 
Post new topic   Reply to topic    Delta Corp Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
kiddietron
Site Admin


Joined: 06 Feb 2008
Posts: 797
Location: On Roblox

PostPosted: Mon May 26, 2008 7:43 pm    Post subject: Brain Bogglers:Triangular Conundrum Reply with quote

Description:
Given 6 integers, with 3 being valid points, return the area of the triangle.

Doki I got owned by Anaminus the third time today I think...

Example:
Input: (These are coordinates) (1,2) , (0,0) , (3,0)
Output: 3

This was told to me by Aeacus.

People who have solved it.
1. Aeacus
2. Anaminus
3.
4.
5.
_________________
�Kiddietron
�Phailing at making a signature

Free Money here just sign up and click away.
http://bux.to/?r=kiddietron

Spam is for noobs.



Last edited by kiddietron on Tue May 27, 2008 12:02 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address
Anaminus
Beginner Poster


Joined: 08 Feb 2008
Posts: 17
Location: Location: Location: Location: Location: Location:

PostPosted: Mon May 26, 2008 9:59 pm    Post subject: Reply with quote

So that would be like area(xa,ya,xb,yb,xc,yc)?

Code:
function area(...)
   p={...}
   return math.abs((p[3]*p[6]-p[5]*p[4])+(p[1]*p[4]-p[3]*p[2])+(p[5]*p[2]-p[1]*p[6]))/2
end



?-Anaminus-?
_________________
?-Anaminus-?

^^You're probably seeing this twice because I typed in my signature >_<
Back to top
View user's profile Send private message
kiddietron
Site Admin


Joined: 06 Feb 2008
Posts: 797
Location: On Roblox

PostPosted: Mon May 26, 2008 10:04 pm    Post subject: Reply with quote

Nope nvm, I edited this. They are coordinates.
_________________
�Kiddietron
�Phailing at making a signature

Free Money here just sign up and click away.
http://bux.to/?r=kiddietron

Spam is for noobs.



Last edited by kiddietron on Mon May 26, 2008 11:05 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail AIM Address
Anaminus
Beginner Poster


Joined: 08 Feb 2008
Posts: 17
Location: Location: Location: Location: Location: Location:

PostPosted: Mon May 26, 2008 10:55 pm    Post subject: Reply with quote

I'm not quite getting it...

In your example, does it run like this:

Quote:
1,2,0,0,3,0
(1,2)
(0,0)
(3,0)

(Coordinates make a triangle, then the area can be found)
area = 3

Kiddietron here- Sorry to edit your post but use this one. But hearing from Aeacus, I hear you already have it done. 4 Cookies due to the winners in math.sqrt(-1) years. XD


Or this:

1,2,0,0,3,0
1,2,3
1*2*3 = 6
6/2 = 3 <-- area


Maybe another example would help.


?-Anaminus-?
_________________
?-Anaminus-?

^^You're probably seeing this twice because I typed in my signature >_<
Back to top
View user's profile Send private message
Aeacus
Site Admin


Joined: 05 Feb 2008
Posts: 299
Location: Canada

PostPosted: Mon May 26, 2008 11:11 pm    Post subject: Reply with quote

Yep Anaminus, you got it Smile I should have explained it a bit better though, this is the function I used;

Code:

function getArea(x1,y1,x2,y2,x3,y3)
area = (((x2*y1-x1*y2)+(x3*y2-x2*y3)+(x1*y3-x3*y1))/2)
return area
end

_________________
If you say "Plz" because it is shorter than "Please," I will say "No" beacuse it is shorter than "Yes."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Anaminus
Beginner Poster


Joined: 08 Feb 2008
Posts: 17
Location: Location: Location: Location: Location: Location:

PostPosted: Mon May 26, 2008 11:55 pm    Post subject: Reply with quote

Yay! Now I just have to wait for those kookies...


?-Anaminus-?
_________________
?-Anaminus-?

^^You're probably seeing this twice because I typed in my signature >_<
Back to top
View user's profile Send private message
Aeacus
Site Admin


Joined: 05 Feb 2008
Posts: 299
Location: Canada

PostPosted: Tue May 27, 2008 12:08 am    Post subject: Reply with quote

Face it, they are never coming. Just accept the truth, it is the only thing you can do at this point.
_________________
If you say "Plz" because it is shorter than "Please," I will say "No" beacuse it is shorter than "Yes."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Nasadaws
Delta Corp Moderator


Joined: 27 Mar 2008
Posts: 484
Location: Under you bed Where else?

PostPosted: Tue May 27, 2008 5:47 am    Post subject: Reply with quote

Mind explain what a triangle thingy is?
_________________
Nasadaws Attack Spammer: Hits 100 Damage with his Ban Hama.
Spammer: Flees.


I R NOE WELDIN ME BAN HAMAR.
Back to top
View user's profile Send private message Send e-mail
kiddietron
Site Admin


Joined: 06 Feb 2008
Posts: 797
Location: On Roblox

PostPosted: Tue May 27, 2008 6:46 pm    Post subject: Reply with quote

Lol, don't worry it's just making a function to find the area of a triangle after receiving three coordinates. I just called it the Triangular Conundrum for fun to make it sound like a real brain boggler.
_________________
�Kiddietron
�Phailing at making a signature

Free Money here just sign up and click away.
http://bux.to/?r=kiddietron

Spam is for noobs.

Back to top
View user's profile Send private message Send e-mail AIM Address
Nasadaws
Delta Corp Moderator


Joined: 27 Mar 2008
Posts: 484
Location: Under you bed Where else?

PostPosted: Tue May 27, 2008 9:49 pm    Post subject: Reply with quote

Ah ok, Could you make the next challenge something I can do? I like this game =D.
_________________
Nasadaws Attack Spammer: Hits 100 Damage with his Ban Hama.
Spammer: Flees.


I R NOE WELDIN ME BAN HAMAR.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Delta Corp Forum Index -> Script Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Back to Top              
Jenova Template © digital-delusion.com
Powered by phpBB © 2001, 2002 phpBB Group



For Support - http://forums.BizHat.com

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!