Drakulix / zwreec

Twee to Z-Code Compiler in Rust
BSD 2-Clause "Simplified" License
7 stars 3 forks source link

Feature/confirm #253

Closed msaehn closed 9 years ago

msaehn commented 9 years ago

implementiert den "confirm"-teil von #238 mit 1 wird bestätigt, mit 0 nicht.

mit folgender twee-datei getestet:

::Start

text bevor confirm

<<set $var=confirm("do you want to quit this programm?")>>
<<if $var==true>>
confirmed
<<else>>
not confirmed
<<endif>>

text after confirm
pothos commented 9 years ago

ich hab mit prompt schon angefangen und das in einer funktion geschrieben, weil dann nicht immer so viele opcode generiert werden…

msaehn commented 9 years ago

heist du willst das auch lieber als funktion nochmll schreiben? fände ich auch nicht so schlimm. ich fand den code überschaubar, aber kürzer wäre es natürlich besser.

pothos commented 9 years ago

jetzt nicht sofort ;) und der Variablentyp könnte noch zu Bool gesetzt werden via SetVarType{variable: Variable::new(has_confirmed.id), vartype: Type::Bool} vor der Rückgabe

pothos commented 9 years ago

+1