fork download
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title> Algoritmo DDA en HTML5 Canvas </title>
  5. <SCRIPT TYPE="text/javascript" src="js/dda.js"></SCRIPT>
  6. <SCRIPT TYPE="text/javascript" src="js/drawing.js"></SCRIPT>
  7. <SCRIPT TYPE="text/javascript" src="js/jquery-1.7.2.js"></SCRIPT>
  8. <SCRIPT TYPE="text/javascript" src="js/custom.js"></SCRIPT>
  9. <SCRIPT TYPE="text/javascript" src="js/dynamictable.js"></SCRIPT>
  10. <link rel="stylesheet" href="css/bootstrap.css"></link>
  11. <link rel="stylesheet" href="css/custom.css"></link>
  12. <SCRIPT TYPE="text/javascript">
  13. var canvas;
  14. var context;
  15. var width;
  16. var height;
  17. var data;
  18. var points=[];
  19. var table;
  20. $(document).ready(function(){
  21. table= $("#pointtable");
  22. canvas=document.getElementById("canvas");
  23. context=canvas.getContext("2d");
  24. width=parseInt(canvas.getAttribute("width"));
  25. height=parseInt(canvas.getAttribute("height"));
  26. initializecanvas(context);
  27. validateall();
  28. table= $("#tablebody");
  29. $("#x1").blur(function(){
  30. validateall();
  31. });
  32. $("#x1").keyup(function(){
  33. validateall();
  34. });
  35. $("#x2").blur(function(){
  36. validateall();
  37. });
  38. $("#x2").keyup(function(){
  39. validateall();
  40. });
  41. $("#y1").blur(function(){
  42. validateall();
  43. });
  44. $("#y1").keyup(function(){
  45. validateall();
  46. });
  47. $("#y2").blur(function(){
  48. validateall();
  49. });
  50. $("#y2").keyup(function(){
  51. validateall();
  52. });
  53. $("#erasebutton").click(function(){
  54. initializecanvas(context);
  55. initializeTable(table);
  56. return false;
  57. })
  58. $("#submitbutton").click(function(){
  59. x1=parseInt($("#x1").val());
  60. x2=parseInt($("#x2").val());
  61. y1=parseInt($("#y1").val());
  62. y2=parseInt($("#y2").val());
  63. point1= new point(x1,y1);
  64. point2= new point(x2,y2);
  65. console.log(x1);
  66. points = dda(point1,point2);
  67. draw(points,context);
  68. initializeTable(table);
  69. addToTable(table,points);
  70. });
  71. });
  72. </SCRIPT>
  73. </head>
  74. <body>
  75. <header class="navbar navbar-fixed-top">
  76. <div class="navbar-inner">
  77. <div class="container">
  78. <H1>Algoritmo DDA</H1>
  79. </div>
  80. </div>
  81. </header>
  82. <div class="container" id="container">
  83. <div class="row">
  84. <div class="span6" id="canvasdiv">
  85. <canvas width=400 height=280 id="canvas" class="well">
  86. </canvas>
  87. </div>
  88. <div class="span6">
  89. <div class="well">
  90. <h2 style="text-align:center;"> Introducir Coordenadas</h2>
  91. <label>Ingrese la coordenada X del primer punto</label>
  92. <input type="text" id="x1" class="span3 control-group" placeholder="Introduzca un numero"></input>
  93. <label>Ingrese la coordenada Y del primer punto</label>
  94. <input type="text" id="y1" class="span3" placeholder="Introduzca un numero"></input>
  95. <label>Ingrese la coordenada X del segundo punto</label>
  96. <input type="text" id="x2" class="span3" placeholder="Introduzca un numero"></input>
  97. <label>Ingrese la coordenada Y del segundo punto</label>
  98. <input type="text" id="y2" class="span3" placeholder="Introduzca un numero"></input>
  99. <button id="submitbutton" class="btn btn-primary"><i class="icon-pencil icon-white"></i> Dibujar</button>
  100. <button id="erasebutton" class="btn btn-danger"><i class="icon-trash icon-white"></i> Borrar</button>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="row">
  105. <div class="span6 offset3 well" style="text-align:center;">
  106. <h2 class="center">Puntos Calculados</h2>
  107. <table class="table">
  108. <thead>
  109. <tr>
  110. <th>#</th>
  111. <th>X</th>
  112. <th>Y</th>
  113. </tr>
  114. </thead>
  115. <tbody id="tablebody">
  116. <!-- Aqui va el contenido de la tabla -->
  117. </tbody>
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. </body>
  123. </html>
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,0): error CS1525: Unexpected symbol `<'
prog.cs(20,2): error CS1056: Unexpected character `$'
prog.cs(21,10): error CS1056: Unexpected character `$'
prog.cs(28,10): error CS1056: Unexpected character `$'
prog.cs(29,3): error CS1056: Unexpected character `$'
prog.cs(32,3): error CS1056: Unexpected character `$'
prog.cs(35,3): error CS1056: Unexpected character `$'
prog.cs(38,3): error CS1056: Unexpected character `$'
prog.cs(41,3): error CS1056: Unexpected character `$'
prog.cs(44,3): error CS1056: Unexpected character `$'
prog.cs(47,3): error CS1056: Unexpected character `$'
prog.cs(50,3): error CS1056: Unexpected character `$'
prog.cs(53,3): error CS1056: Unexpected character `$'
prog.cs(58,3): error CS1056: Unexpected character `$'
prog.cs(59,15): error CS1056: Unexpected character `$'
prog.cs(60,15): error CS1056: Unexpected character `$'
prog.cs(61,15): error CS1056: Unexpected character `$'
prog.cs(62,15): error CS1056: Unexpected character `$'
prog.cs(110,11): error CS1040: Preprocessor directives must appear as the first non-whitespace character on a line
Compilation failed: 19 error(s), 0 warnings
stdout
Standard output is empty