Eiffel Tower in 3D

5

2

This challenge asks you to draw the Eiffel Tower in 3D using different ASCII characters to represent the different sides, similar to this cube:

      @@@
   @@@@@@@@@
@@@@@@@@@@@@@@@
x@@@@@@@@@@@@&&
xxx@@@@@@@@&&&&
xxxxx@@@&&&&&&&
xxxxxx&&&&&&&&&
 xxxxx&&&&&&&
   xxx&&&&
     x&&

Here is a picture of the Eiffel Tower for you to base your art on:

enter image description here

Your program will input a rotational angle of the side view, then print the Tower as if you were looking at it from that angle. The up/down angle does not need to be accounted for.

Score will be calculated as 1.25*votes - 0.25*length as a . Highest score wins.

user10766

Posted 2014-03-09T18:30:57.410

Reputation:

Accounting for the view angle is going to be a vexing/fun challenge. – Jonathan Van Matre – 2014-03-09T19:47:07.067

Answers

4

BBC BASIC, 66 chars

Emulator at bbcbasic.co.uk

A=PI/6FORJ=0TO83PRINTTAB(9+EXP(J/40)*SIN(A+J*PI/2),J/4);J MOD4:NEXT

With white space for clarity:

A=PI/6
FOR J=0 TO 83
  PRINT TAB(9+EXP(J/40)*SIN(A+J*PI/2),J/4);J MOD4
NEXT

Input is hard coded in radians. Taking user input would add one character, but user would have to input in radians. Removing the MOD4 from the end would still produce a recognisable tower, but might violate the rule regarding character per side.

Basically plots a string of zeros at exp(J/40)*sin(A) vs J/4. Additional values of the sin are added for the remaining three legs.

enter image description here

Level River St

Posted 2014-03-09T18:30:57.410

Reputation: 22 049

I hesitated to post this as I thought it was perhaps a little lazy. Then I saw the "500km away" answer and thought, why not! – Level River St – 2014-03-09T20:42:40.960

Not bad, a lot better than "500km away" answer. At least you can tell what it is! – None – 2014-03-09T20:53:57.577

Looks more like a rocket. – Mukul Kumar – 2014-03-10T04:26:59.307

6

PHP, 364 * 0.25 = 91

Accepts a viewing angle as a query string parameter of the form ?a=0, ?a=45, ?a=90, etc.

<pre><?php
$a=45*floor(.5+intval(@$_GET['a'])/45);
$e=array(array(".","|","==","X|","X|","X/","==|","^||","-./","__//","=====","^^-. /","   |__|"),
array(".","|","==","X|","X|","X/","|=|","|^|","|./"," ///",":====",":|-. /","_|  |_|"));
echo "Angle: {$a}°\n\n";
foreach($e[$a&1] as $s){$p=str_pad($s,7);echo strrev($p).substr(strtr($p,'/','\\'),1)."\n";} ?>
</pre>

Examples:

a=135

Angle: 135°

      .      
      |      
     ===     
     |X|     
     |X|     
     /X\     
    |=|=|    
    |^|^|    
    /.|.\    
   /// \\\   
  ====:====  
 / .-|:|-. \ 
|_|  |_|  |_|

a=200 (rounded to nearest increment = 180°)

Angle: 180°

      .      
      |      
     ===     
     |X|     
     |X|     
     /X\     
    |===|    
    ||^||    
    /.-.\    
   //___\\   
  =========  
 / .-^^^-. \ 
|__|     |__|

(Yes I know, the angular resolution isn't brilliant. I'll improve on that if I have time.)

r3mainer

Posted 2014-03-09T18:30:57.410

Reputation: 19 135

1

C# - 64 bytes

namespace System{class m{static void h(){Console.Write(".");}}}

Prints the Eiffel Tower viewed from 500 26.5 kilometers away. Takes the rotational angle as an argument.

Example usage:

eiffel.exe 90

EDIT

I've made an approximation, and it should be about 26.5 kilometers away.

Let's consider the image below, taken from OP and edited to add a "." using the font Monospace 12 without anti-aliasing. enter image description here

The "." is 2 pixels long and 1 pixels wide whereas the tower is 400 pixels long and 663 pixels wide(approximately).

Let's assume the tower is viewed from 100 meters away.

If we want to make it look like a 2x1 box, we would need to make it (again, approximately) 265.5 times smaller(200 times smaller for the height and 531 times smaller for the width).

If we multiply 265.5 with 100 meters, we get 26550 meters, which is 26.5 kilometers.

user3188175

Posted 2014-03-09T18:30:57.410

Reputation: 329

3There's a bug in your code. The output should be " " when viewed from 500km. – Comintern – 2014-03-09T20:21:28.817

10This is not funny. – John Dvorak – 2014-03-09T20:25:13.310

@Comintern Actually no, it would be smaller than a . but bigger than an empty space. – user3188175 – 2014-03-09T20:37:45.973

@user3188175 It depends on OP monitor I guess – Antonio Ragagnin – 2014-03-10T14:04:31.157

2I'm less than 500km from the Eiffel Tower, but there's not a single pixel in view here :-D – r3mainer – 2014-03-10T15:26:49.013

1@squeamishossifrage Think of it as a view from space. Or even, assume it's in space. – user3188175 – 2014-03-10T15:49:39.137