index.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="js/semantic/semantic.min.css">
  5. <style>
  6. .ivprog-io-output {
  7. border: 1px solid gainsboro;
  8. width: 80%;
  9. height: 360px;
  10. overflow-y: scroll;
  11. background-color: black;
  12. color: white;
  13. }
  14. .ivprog-io-input {
  15. width: 80%;
  16. margin-top: 10px;
  17. border: 1.5px solid green;
  18. height: 3rem;
  19. color: black;
  20. font-size: 12pt;
  21. }
  22. </style>
  23. <title></title>
  24. </head>
  25. <body>
  26. <div style="padding-top: 50px;content: ''"></div>
  27. <div class="ui container grid">
  28. <div class="four wide column">
  29. <div class="row">
  30. <textarea class="ui form control" name="input" id="input" cols="100" rows="30">
  31. programa {
  32. funcao inicio() {
  33. cadeia a = "mustache"
  34. cadeia b = "mostacheh"
  35. escreva(editDist(a,b,comprimento(a), comprimento(b)))
  36. }
  37. funcao inteiro editDist(cadeia str1 , cadeia str2 , inteiro m ,inteiro n) {
  38. inteiro l = m + 1
  39. inteiro c = n + 1
  40. inteiro i, j
  41. inteiro mat[l][c]
  42. para(i = 0; i <= m; i = i + 1 ) {
  43. para(j = 0; j <= n; j = j + 1) {
  44. se (i==0) {
  45. mat[i][j] = j
  46. } senao se (j == 0) {
  47. mat[i][j] = i
  48. } senao se (char_at(str1, i-1) == char_at(str2, j-1)) {
  49. mat[i][j] = mat[i-1][j-1]
  50. } senao {
  51. mat[i][j] = 1 + Matematica.minimo({mat[i][j-1], mat[i-1][j], mat[i-1][j-1]})
  52. }
  53. }
  54. }
  55. retorne mat[m][n]
  56. }
  57. }
  58. </textarea>
  59. </div>
  60. <div class="row">
  61. <button class="ui button" id="btn">Run</button>
  62. </div>
  63. </div>
  64. <div class="six wide column">
  65. <div id="dom-out" class="ivprog-io-output">
  66. </div>
  67. <input id="dom-in" type="text" class="ivprog-io-input">
  68. </div>
  69. <div class="six wide column">
  70. <div style="overflow-y: scroll; height: 70%;">
  71. <pre id="json-renderer" class="ui right floated"></pre>
  72. </div>
  73. </div>
  74. </div>
  75. </body>
  76. <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
  77. <script type="text/javascript" src="js/jquery.json-editor.min.js"></script>
  78. <script type="text/javascript" src="build/ivprog.bundle.js"></script>
  79. </html>