hugosoftdev / logicadecomputacao Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Voce nao fez a entrega intermediaria da linguagem
Versão testada: v2.4.1
Status: Erro - Incompleto
Seu programa apresentou defeito(s) com as seguinte(s) entrada(s):
test1.vbs
Sub test()
Dim a as integer
a = 5
print a
End Sub
Sub main()
' hello world
Call test()
End Sub
test2.vbs
Sub test(a as integer)
print a
End Sub
Sub main()
' hello world
Dim top as integer
top = 5
Call test(top)
End Sub
test3.vbs
Function test(a as integer, c as integer) as integer
print a
Dim b as integer
b = a * 5
if b < c then
test = b
else
test = a
end if
End Function
Sub main()
' hello world
Dim top as integer
top = input
print test(top, 100)
End Sub
test4.vbs
Sub check(n as integer)
dim tres as integer
dim cinco as integer
dim flag as boolean
tres = (n - (n / 3 * 3))
cinco = (n - (n / 5 * 5))
flag = True
if (tres = 0) and (cinco = 0) then
print 00001111
flag = False
end if
if (tres = 0) and (flag = True) then
print 0000
flag = False
end if
if (cinco = 0) and (flag = True) then
print 1111
end if
End Sub
Sub fizzBuzz()
' adaptado da sabrina
Dim n as integer
n = input
while n > 0
Call check(n)
n = n - 1
wend
End Sub
Sub main()
Call fizzBuzz()
end sub
test5.vbs
Function fibonacci(n as integer) as integer
' codigo do raphael costa
dim flag as boolean
flag = false
if n = 0 then
fibonacci = 1
flag = true
end if
if n = 1 then
fibonacci = 1
flag = true
end if
if flag = false then
fibonacci = fibonacci(n-2) + fibonacci(n-1)
end if
End Function
Sub Main()
print fibonacci(5)
End Sub
Comentários:
Nenhum dos testes criados funciona. Para todos tenho o seguinte erro: Entrada inválida, a cadeia terminou sem um EOF;
Seu DS e EBNF estão desatualizados, portanto sua entrega ficará como incompleta;
Corrija os erros de código/EBNF/DS apontados nesta issue.
Abraços!
Versão testada: v2.2
Status: Erro de execução
Seu programa apresentou defeito(s) com as seguinte(s) entrada(s):
test1.vbs
a = 3
b = 5
print a * (b --1)
if a < b then
print a
end if
if a > b then
print b
end if
test2.vbs
a = 3
b = 5
print a * (b --1)
if a < b then
print a
end if
if a > b then
print b
else
print a
end if
test3.vbs
a = 10
b = 20
c = 30
if a < b then
if b < c then
' test comment
while a > 0
' hello
print a
a = a-5
wend
end if
end if
test4.vbs
a = 10
b = input
print b * a
test5.vbs
a = 10
b = 20
c = input
if a < b then
if b < c then
' test comment
while c > 0
' hello
print c
c = c-5
wend
end if
end if
Comentários:
Corrija o que foi apontado nesta issue para o próximo release.
Abraços!
Versão: 0.1
Situação: OK
Seu código rodou com sucesso todos os testes, parabéns!
PS: Tive que aprender um pouco de c# por sua causa! rs
Versão testada: v2.1
Status: erro de execucao
Seu programa apresentou defeito(s) com as seguinte(s) entrada(s):
test1.vbs
begin
x = 2
print x
end
test3.vbs
begin
x = -(2 + 3)/5
y = x + 5
print x*y+3- -2/4
end
test6.vbs
begin
' hello world
x = 2
z = x + 3
z = z - 3
begin
print (z+1)*2
end
end
Comentários:
Por favor corrija estes problemas na proxima release, e responda esta issue quando tiver corrrigido.
Abraços!
Se está tudo certo, feche as Issues. Ainda, a ideia era manter os releases em v2.4.X e v3.0.X e não uma entrega_final (não precisa corrigir isso).
Versão testada: v2.0
Status: OK
Comentários:
No seu diagrama sintático (foto) está faltando o diagrama do factor;
Comece também a fazer a ebnf do seu compilador a partir desta release.
Seu código roda corretamente, mas faltou implementar o input via arquivo ".vbs". Sem ele, também não foi possível testar a feature de comentário de código. Não sei como funciona pra C#, mas tenta receber o nome do arquivo como argumento de chamada do seu programa. Senão, use o input do terminal para receber o nome do arquivo
Por favor corrija estes problemas nesta release (v2.0.1), e responda esta issue quando tiver corrrigido.
Abraços!
Versão testada: v2.3.1
Status: Erro
Seu programa apresentou defeito(s) com as seguinte(s) entrada(s):
test1.vbs
Sub main()
' hello world
Dim a as integer
a = 5
print a
End Sub
test2.vbs
Sub main()
Dim tb as boolean
Dim ti as integer
tb = TRUE
ti = 10
if tb then
print ti + 10
end if
End Sub
test3.vbs
Sub main()
Dim teste_bool as boolean
Dim teste_int as integer
teste_bool = True
teste_int = 10
if teste_bool then
print teste_int + 10
end if
while (teste_int > 0) and teste_bool = True
print teste_int
teste_int = teste_int - 1
wend
teste_int = input
print_teste_int
End Sub
test4.vbs
Sub main()
' adaptado da sabrina
dim fizz as integer
dim buzz as integer
dim fizzbuzz as integer
dim n as integer
dim tres as integer
dim cinco as integer
dim flag as boolean
n = INPUT
fizz = 0000
buzz = 1111
fizzbuzz = 00001111
flag = True
while n > 0
tres = (n - (n / 3 * 3))
cinco = (n - (n / 5 * 5))
print n
if (tres = 0) and (cinco = 0) then
print fizzbuzz
flag = False
end if
if (tres = 0) and (flag = True) then
print fizz
flag = False
end if
if (cinco = 0) and (flag = True) then
print buzz
flag = False
end if
flag = True
n = n - 1
wend
end sub
test5.vbs
Sub main()
' bool ops
Dim bt as boolean
Dim bf as boolean
bt = True
bf = False
print bf and bt
print bf or bt
print not(not(bf))
print not((bt and bf) or bf)
end sub
Comentários:
Corrija o que foi apontado nesta issue para a próxima release. Não se esqueça de manter a EBNF e o DS atualizados, eles são a documentação da linguagem de seu compilador.
Abraços!
Versão testada: v0.1.4
Status: erro de execução
seu programa apresentou defeito(s) com as seguinte(s) entrada(s):
' bla \n 1+1
2 + 3 * ' bla \n 5
Parece que seu código nao aceita comentarios no meio do calculo, nem antes. Cheque por favor se o seu codigo aceita quebra de linha no input do terminal (de o replace de "\\n" por "\n" no seu input). Por favor corrija estes problemas até a próxima release, e responda esta issue quando tiver corrrigido.
Favor tambem começar a utilizar o nome de versao sugerida no roteiro da aula. Fica dificil saber qual versao pegar se nao tiver identificada corretamente.
Abraços!
Versão testada: v3.0.0
Status: erro
Seu programa apresentou defeito(s) com as seguinte(s) entrada(s):
test1.vbs
Sub main()
' hello world
Dim a as integer
a = 5
print a
End Sub
test2.vbs
Sub main()
Dim tb as boolean
Dim ti as integer
tb = TRUE
ti = 10
if tb then
print ti + 10
end if
End Sub
test3.vbs
Sub main()
Dim teste_bool as boolean
Dim teste_int as integer
teste_bool = True
teste_int = 10
if teste_bool then
print teste_int + 10
end if
while (teste_int > 0) and teste_bool
print teste_int
teste_int = teste_int - 1
wend
teste_int = input
print teste_int
End Sub
test4.vbs
Sub main()
' adaptado da sabrina
dim fizz as integer
dim buzz as integer
dim fizzbuzz as integer
dim n as integer
dim tres as integer
dim cinco as integer
dim flag as boolean
n = INPUT
fizz = 0000
buzz = 1111
fizzbuzz = 00001111
flag = True
while n > 0
tres = (n - (n / 3 * 3))
cinco = (n - (n / 5 * 5))
print n
if (tres = 0) and (cinco = 0) then
print fizzbuzz
flag = False
end if
if (tres = 0) and (flag = True) then
print fizz
flag = False
end if
if (cinco = 0) and (flag = True) then
print buzz
flag = False
end if
flag = True
n = n - 1
wend
end sub
test5.vbs
Sub main()
' bool ops
Dim bt as boolean
Dim bf as boolean
bt = True
bf = False
print bf and bt
print bf or bt
print not(not(bf))
print not((bt and bf) or bf)
end sub
Comentários:
Corrija o que foi apontado nesta issue para a próxima release. Não se esqueça de manter a EBNF e o DS atualizados, eles são a documentação da linguagem de seu compilador.
Abraços!
Versão: v0.1.3
Situação: OK (observações)
Oi Hugo,
Seu código funciona conforme especificado para a versão 1.0 do compilador, porém esta sua release está com a tag v0.1.3. Por favor certifique-se de versionar corretamente na próxima entrega, para eu não ter que ficar caçando qual é a release certa de seu código.
Abraços!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.