Skip to content

Commit

Permalink
chore: 注释掉若干代码的 debug 输出
Browse files Browse the repository at this point in the history
  • Loading branch information
cutekibry committed Feb 8, 2024
1 parent 7026a7a commit aa5a627
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bg/dynamic_bg/dynamic_bg.gd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func _ready():
x_offset += $Timer.wait_time * VELOCITY.x
x_offset -= int(x_offset / W_STEP) * W_STEP
y_offset += $Timer.wait_time * VELOCITY.y
print(y_offset)
# print(y_offset)

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
Expand Down
2 changes: 1 addition & 1 deletion levels/chapter_menu/chapter_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func init() -> void:


func _ready():
print("ready")
# print("ready")
init()
#print(BaseLevel.instantiate().DATA[chapter_id])
# print(chapter_num)
Expand Down
4 changes: 2 additions & 2 deletions levels/chapter_menu/level_menu/level_button/level_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func init(chapter_id: int, level_id : int, pos : Vector2, type : int) -> void :
button_type = type

func _on_pressed():
print("choose: ",chap_id,"-",lvl_id)
print("! ")
# print("choose: ",chap_id,"-",lvl_id)
# print("! ")
$SFXButtonDown.play()
if button_type == 1:
enter_level.emit(chap_id, lvl_id)
Expand Down
17 changes: 9 additions & 8 deletions objects/calculator/calculator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func infix_to_suffix(expr: String) -> String:



print("ch=", ch, " stk=", opt_stack, " res=", res)
#print("ch=", ch, " stk=", opt_stack, " res=", res)
if get_char_type(ch) == VAL:
res += ch
elif ch == "(":
Expand All @@ -119,8 +119,8 @@ func infix_to_suffix(expr: String) -> String:

if get_char_type(res[len(res) - 1]) == COMP:
res += "@"
#prints(expr, res)

prints(expr, res)
return res


Expand Down Expand Up @@ -192,12 +192,13 @@ func check_valid(expr: String) -> Array:

## 判断表达式 expr 是否满足笑脸要求。
##
## 合法返回 -1,否则返回不为笑脸的最小字符下标。
func check_smile(expr: String, req_pos: Array) -> int:
## 合法返回 [],否则返回不为笑脸的字符下标列表。
func check_smile(expr: String, req_pos: Array) -> Array:
var res := []
for i in req_pos:
if (i == 0 or not is_smile(expr.substr(i - 1, 2))) and (i == len(expr) - 1 or not is_smile(expr.substr(i, 2))):
return i
return -1
res.append(i)
return res


## 判断表达式 expr 是否恒为真(不检查是否合法)。
Expand All @@ -209,7 +210,7 @@ func check_always_true(expr: String) -> Dictionary:

# 中缀转后缀
expr = infix_to_suffix(expr)
print(expr)
#print(expr)

for ch in expr:
if is_alpha(ch) and not var_names.has(ch):
Expand Down Expand Up @@ -243,7 +244,7 @@ func check(expr: String, req_pos: Array) -> Array:

# 判断笑脸要求
tmp = check_smile(expr, req_pos)
if tmp != -1:
if tmp != []:
return ["SMILE_UNSATISFIED", tmp]

# 判断是否恒为正
Expand Down

0 comments on commit aa5a627

Please sign in to comment.