随笔分类 -  far语言

摘要:map 根据键,获取值 map 的key 只能是int或者string类型,在底层int 转为了string存储,但不代表在far层面可以用string去索引 number x=1; map t = ({}); t[x] = 100; println(t["1"]);//错误,拿不到值 printl 阅读全文
posted @ 2025-10-17 11:40 方东信 阅读(1) 评论(0) 推荐(0)
摘要:static map skillsConf = ({}); ///*实际伤害 = [(攻击方.str + 攻击方.combatExp / 100) * (1 + 攻击方.int / 100)] - (防御方.con / 2) // //若 攻击方.dex / 防御方.dex > 随机数(0, 1), 阅读全文
posted @ 2025-06-04 07:55 方东信 阅读(19) 评论(0) 推荐(0)
摘要:far的所有方法,静态和动态方法,包括调用原生java的方法,在far编译器生成字节码的时候,会判断这个方法是否处于取值状态,如果不是,栈顶的返回值就会被POP掉 什么是方法的取值状态 //赋值 var x = test(); //作为另一个方法的返回值 call(test()); 上面的test方 阅读全文
posted @ 2025-04-17 07:47 方东信 阅读(162) 评论(0) 推荐(0)
摘要:{ "version": "0.2.0", "configurations": [ { "type": "mock", "request": "launch", "name": "far-debug", //被调试程序的路径 "program": "${workspaceFolder}/farcs. 阅读全文
posted @ 2025-03-12 13:18 方东信 阅读(11) 评论(0) 推荐(0)
摘要:stackTraceRequest 返回的结构 { "seq": 0, "type": "response", "request_seq": 13, "command": "stackTrace", "success": true, "body": { "stackFrames": [{ "id": 阅读全文
posted @ 2025-03-04 22:21 方东信 阅读(17) 评论(0) 推荐(0)
摘要:package com.faros.core.kls;import cn.hutool.core.collection.CollectionUtil;import cn.hutool.core.io.FileUtil;import cn.hutool.core.util.CharsetUtil;im 阅读全文
posted @ 2025-02-10 20:08 方东信 阅读(19) 评论(0) 推荐(0)
摘要:{ "c2s-start" : { "type" : "startDebug", "bps" : [ { "file" : "1.c", "line" : "102", "result" : { "测试" : "result这个数据是客户端给的,服务器断点触发后又会返回给客户端" } } ], "t 阅读全文
posted @ 2025-02-07 17:23 方东信 阅读(20) 评论(0) 推荐(0)
摘要:自动移动 inherit "obj/biota.c" //执行 void heartbeat(){ scan(); } void scan(){ chat(); } //随机走动 int randomMove(){ map exits; string *dirs; if (! mapp(exits 阅读全文
posted @ 2025-01-03 08:56 方东信 阅读(36) 评论(0) 推荐(0)
摘要:far 数据类型 基本数据类型 string object number map byte 对象类型(程序员自定义类) object 混合类型 var(模糊类型) 包括了基本类型和对象类型 字典 map 数字类型 number 包括了整数,小数和大数 数组 数组定义和赋值 number *data 阅读全文
posted @ 2024-12-05 13:49 方东信 阅读(451) 评论(0) 推荐(0)