Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Salgado Sanchez Ivan_Examen1
a1:- read(X),(X='atributo'-> write(','),atributo;(X='fin'->write(''))). atributo:- read(X), write('"'), write(X), write('":'),tipoatributo(X),a1. tipoatributo(M):- read(X), (X='metodo'->metodo(M); X='numero'->numero; X='cadena'->cadena; X='objeto'->objeto; X='array'->array; write('error')). cadena:- read(X), write('"'), write(X), write('"'). numero:- read(X), write(X). metodo(M):- write('"function() {'),a2,write(' return '), write(M), write(';}"'). objeto:- write('{'),read(X), (X='atributo'->atributo),write('}'). item(X):- (X='last'->write(''); tipoatributo(X), read(N),(N='last'->write('');write(','), item(N))). array:- write('['), read(X), item(X), write(']'). a2:- read(X), (X='decision'->decision;a3(X)). a3(X):- X='asignacion' -> asignacion;(a4(X)). a4(X):- X='fin' -> write('');(write('ERROR: '),write(X)). asignacion:- read(X), write(X), write('='), read(Y), write(Y), write(';'),a2. decision:- write('if('),condicion,write(')'), verdadero, write('}'),falso,write('}'). condicion:-read(X), write(X). verdadero:- write('{'),a2. falso:- write('else {'),a2. :-objeto.
run
|
edit
|
history
|
help
0
Hangman
Super Querys Alcántara Noriega Marco Antonio
RuizRodriguezEdwinAndres-P2
Ifog-Hernandez Alonso TrIstan
Examen 2 Parte
A1-
Empresa
task5
Karol_lopez_Codificador_Arreglos_Objetos
Morales Bazan Josue Jonathan - EXAMEN - 2daparte - Bueno