W801学习笔记二十三:语文和英语学习应用的代码汇总

2024-05-09 01:12

本文主要是介绍W801学习笔记二十三:语文和英语学习应用的代码汇总,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

前面几章,代码经过重构,可能有点乱。这里给个最终版本,以供参考。

1、应用基类:

IScean.h

enum SceanResult{SceanResult_EXIT = 1, SceanResult_Done = 2	
};class IScean {public:IScean();virtual ~IScean();// 纯虚函数virtual SceanResult tick(u32 ticks) = 0;virtual int scean_init(cJSON* param) {return 0;};virtual int scean_resume(void){return 0;};virtual int scean_pause(void){return 0;};protected:map_t iconMap = NULL;unsigned char* getImageResource(char* fn);
};

IScean.cpp

int iterate(any_t item, any_t data){psram_heap_free((unsigned char *)data);return MAP_OK;
}IScean::IScean(){iconMap = hashmap_new();
}IScean::~IScean(){any_t val;hashmap_iterate(iconMap, iterate, val);hashmap_free(iconMap);
}unsigned char* IScean::getImageResource(char* fn){int error;unsigned int w,h;unsigned char *val;error= hashmap_get(iconMap, fn, (void**)(&val));if(error == MAP_MISSING){lodepng_decode32_file(&val, &w, &h, fn);hashmap_put(iconMap, fn, val);}return val;
}

2、学习基类,继承应用基类:

StudyBase.h

class StudyBase : public IScean
{public:StudyBase(){};virtual ~StudyBase(){};
protected:u8 gameMode=0;u8 winMode=0;u8 isFinished=0;u16 correntCount =0;u16 wrongCount = 0;u32 totalTime=0;u32 lastTotalTime=0;//×○△□const char *controlInfo="EXIT: 返回     SELECT: 重新开始";const char *answerInfo="× 选择    ○ 选择    □ 选择    △ 选择";u16 answerBGColor[4] = {DBLUE, DRED, DGREEN, BROWN }; void startPrepare();void errorDelay(u8 t);u8 checkFinish();void showScore();void showTime();u8 answerTitle[4][8] = {{0x20,0xA1,0xC1,0x20,0x25,0x73,0x20, 0x0}, // × %s ,{0x20,0xA1,0xF0,0x20,0x25,0x73,0x20, 0x0},{0x20,0xA1,0xF5,0x20,0x25,0x73,0x20, 0x0},{0x20,0xA1,0xF7,0x20,0x25,0x73,0x20, 0x0}}; private:DisplayOption optionScore = {FONT_SIZE_1516, YELLOW, BLACK, 0, 0};DisplayOption optionCorrentCount = {FONT_SIZE_1516, GREEN, BLACK, 0, 0};DisplayOption optionWrongCount = {FONT_SIZE_1516, RED, BLACK, 0, 0};DisplayOption optionTime = {FONT_SIZE_1516, YELLOW, BLACK, 0, 0};DisplayOption optionDeCount = {FONT_SIZE_3232, WHITE, DRED, 1, 0};DisplayOption optionDelay = {FONT_SIZE_2424, WHITE, DRED, 0, 0};void finish();};

StudyBase.cpp


#define Prepare_LOC  240, 100void StudyBase::startPrepare(){isFinished =0;correntCount =0;wrongCount = 0;totalTime=0;lastTotalTime=0;clear_screen();optionDeCount.backColor = DRED;Display_String(Prepare_LOC, &optionDeCount, "  3  ");tls_os_time_delay(1000);optionDeCount.backColor = BROWN;Display_String(Prepare_LOC, &optionDeCount, "  2  ");tls_os_time_delay(1000);optionDeCount.backColor = DGREEN;Display_String(Prepare_LOC, &optionDeCount, "  1  ");tls_os_time_delay(1000);Display_Fill_Rectangle(0, 100, 480, 170 ,BLACK);}void StudyBase::errorDelay(u8 t){for(;t>0;t--){Display_String2(400, 50, &optionDelay,"  %d  ",t);tls_os_time_delay(1000);}Display_Fill_Rectangle2(400, 50, 80, 80, BLACK);
}u8 StudyBase::checkFinish(){switch (winMode) {case 1:if(totalTime > 180000) {finish();return 1;}break;case 2:if(correntCount+ wrongCount == 50) {finish();return 1;}break;case 3:if(wrongCount>0) {finish();return 1;}break;}return 0;
}void StudyBase::finish(){isFinished = 1;show_status_info(controlInfo);optionDeCount.backColor = DBLUE;Display_String(Prepare_LOC, &optionDeCount, "   挑 战 结 束   ");
}void StudyBase::showScore()
{int score = correntCount* 60 - wrongCount * 20;if(score<0 ) score =0;Display_String2(10, 5, &optionScore, "得分: %06d ", score);Display_String2(150, 5, &optionCorrentCount, "正确: %04d ", correntCount);Display_String2(270, 5, &optionWrongCount, "错误: %04d ", wrongCount);
}void StudyBase::showTime()
{if(lastTotalTime == totalTime/1000){return;}lastTotalTime = totalTime/1000;if(winMode == 2)Display_String2(400, 5, &optionTime, "%02d:%02d", ((180000- totalTime) / 1000) / 60, ((180000- totalTime) / 1000) % 60);elseDisplay_String2(400, 5, &optionTime, "%02d:%02d", (totalTime / 1000) / 60, (totalTime / 1000) % 60);	
}

3、语文学习类,继承学习基类:

YuWenTS.h

typedef struct {uint16_t question; //问题诗索引uint8_t line;  //问题句子所在的行u16 answer [4];  // 4个选项对应的行uint8_t ans;  //正确选项} TangShiQuestion;#define TangshiBoxStartX 10
#define TangshiBoxStartY 80
#define TangshiBoxWidth 280
#define TangshiBoxHeight 200
#define TangshiBoxLineHeight 20class YuWenTS : public StudyBase
{public:YuWenTS();   ~YuWenTS();  SceanResult tick(u32 ticks);int scean_init(cJSON*  param);private:void start();void createTSQuestion();void showTSQuetion();void showTSAnswer();void createSCQuestion();void showSCQuetion();void showSCAnswer();void showTangshi();void showSongCi();void correct();void wrong();TangShiQuestion *currentQuestion;int offsetY=0;u16 boxHeight =0;u16 answerX;u16 answerY;u16 answerIdx;DisplayOption optionQuetion = {FONT_SIZE_2424, LIGHTBLUE, BLACK, 0, 1};DisplayOption optionZY = {FONT_SIZE_1516, GRAYBLUE, BLACK, 0, 1};DisplayOption optionLines = {FONT_SIZE_1516, WHITE, BLACK, 0, 1};DisplayOption optionMiss = {FONT_SIZE_1516, RED, DGRAY, 0, 1};DisplayOption optionAnswer[4] = {{FONT_SIZE_1516, WHITE, answerBGColor[0], 0, 1},{FONT_SIZE_1516, WHITE, answerBGColor[1], 0, 1},{FONT_SIZE_1516, WHITE, answerBGColor[2], 0, 1},{FONT_SIZE_1516, WHITE, answerBGColor[3], 0, 1},};  u16 answerLocX = 300;u16 answerLocY[4] = {165, 200, 235, 270};unsigned char *DataBuff;unsigned char *DataBuffIndex;u16 YuWenCount;u16 YuWenItemCount;};

YuWenTS.cpp

#define YUW_Quetion_LOC_A  20, 25
#define YUW_Quetion_LOC_B  170, 55//读取数据指定行
#define dataLine(idx) ((const char*)DataBuff+((idx) * 64))
//获取索引指定诗所在数据行数
#define dataLineIdx(idx) (((u16*)DataBuffIndex)[(idx)*2+2])
//获取索引指定诗句子总数
#define dataLineCount(idx) (((u16*)DataBuffIndex)[(idx)*2+3])//获取指定诗指定句子所在行数
#define TangshiLineIdx(x,y)  (dataLineIdx(x)+ y + 2 )
//获取指定诗指定句子所在数据位置
#define TangshiLine(x,y)  (dataLine(dataLineIdx(x)+ y + 2 ))
//获取指定诗标题所在数据位置
#define TangshiLineTitle(x)  (dataLine(dataLineIdx(x)))
//获取指定诗作者所在数据位置
#define TangshiLineAuthor(x)  (dataLine(dataLineIdx(x)+ 1))YuWenTS::YuWenTS(){currentQuestion = new TangShiQuestion();
} YuWenTS::~YuWenTS(){delete currentQuestion;psram_heap_free((void*)DataBuff);}  int YuWenTS::scean_init(cJSON*  param){setKeyAdepterIntervalAll(200);setKeyAdepterInterval(KEY_GPIO_A, 65535);setKeyAdepterInterval(KEY_GPIO_B, 65535);setKeyAdepterInterval(KEY_GPIO_C, 65535);setKeyAdepterInterval(KEY_GPIO_D, 65535);winMode= cJSON_GetObjectItem(param,"w")->valueint;gameMode = cJSON_GetObjectItem(param,"m")->valueint;printf("start chinese. winMode=%d, gameMode=%d.\n", winMode, gameMode);switch (gameMode) {case 1: // 唐诗300fatfs_readFile("project/tangshi300gb.txt", &DataBuff);fatfs_readFile("project/tangshi300index.txt", &DataBuffIndex);YuWenCount = dataLineIdx(-1);YuWenItemCount= dataLineCount(-1);break;case 2: // 宋词300fatfs_readFile("project/songci300gb.txt", &DataBuff);fatfs_readFile("project/songci300index.txt", &DataBuffIndex);YuWenCount = dataLineIdx(-1);YuWenItemCount= dataLineCount(-1);break;}start();return 0;
}SceanResult YuWenTS::tick(u32 ticks){if(KEY_EXIT) {printf("goto top menu from About.\n");return SceanResult_EXIT;}if(isFinished){if(KEY_SEL) {start();return SceanResult_Done;}}else{totalTime+=ticks;showTime();if(checkFinish()){return SceanResult_Done;}if(KEY_A | KEY_B | KEY_C | KEY_D){if(KEY_A && currentQuestion->ans == 0){correct();return SceanResult_Done;}if(KEY_B && currentQuestion->ans == 1){correct();return SceanResult_Done;}if(KEY_C && currentQuestion->ans == 2){correct();return SceanResult_Done;}if(KEY_D && currentQuestion->ans == 3){correct();return SceanResult_Done;}wrong();}if(KEY_UP && boxHeight> TangshiBoxHeight){int oy = offsetY;if(offsetY<0 ){offsetY +=TangshiBoxLineHeight;}else{offsetY =0;}if(oy !=offsetY )showTangshi();}if(KEY_DOWN && boxHeight> TangshiBoxHeight){int oy = offsetY;if(offsetY > TangshiBoxHeight - boxHeight)	{offsetY -=TangshiBoxLineHeight;}else{offsetY = TangshiBoxHeight - boxHeight;}if(oy !=offsetY )showTangshi();}ran_max(10);}return SceanResult_Done;
}void YuWenTS::showTSAnswer(){Display_String(answerX, answerY, &optionMiss, dataLine(answerIdx));for(int i=0;i<4;i++)if(currentQuestion->ans !=i)Display_Fill_Rectangle2(answerLocX, answerLocY[i]-2, SCREEN_WIDTH - answerLocX, 21 ,BLACK);	
}void YuWenTS::correct(){correntCount++;showScore();if(checkFinish()==0){createTSQuestion();showTSQuetion();showTangshi();}
}void YuWenTS::wrong(){wrongCount++;showScore();showTSAnswer();errorDelay(3);if(checkFinish()==0){createTSQuestion();showTSQuetion();showTangshi();	}
}void YuWenTS::start(){startPrepare();show_status_info(answerInfo);showScore();createTSQuestion();showTSQuetion();showTangshi();
}void YuWenTS::createTSQuestion()
{u8 len=0;offsetY=0;do{currentQuestion->question = ran_max(YuWenCount);currentQuestion->line = ran_max(dataLineCount(currentQuestion->question));len = strlen(TangshiLine(currentQuestion->question, currentQuestion->line));}while(len < 15 || len > 25);currentQuestion->ans = ran_max(4);for(u8 i=0;i<4;i++){if(i == currentQuestion->ans){currentQuestion->answer[i] = TangshiLineIdx(currentQuestion->question,currentQuestion->line);}else{do{currentQuestion->answer[i] = ran_max(YuWenItemCount);}while(len != strlen(dataLine(currentQuestion->answer[i])));}}
}void YuWenTS::showTSQuetion(){Display_Fill_Rectangle(0,25, 480, 75, BLACK);Display_String(YUW_Quetion_LOC_A, &optionQuetion, TangshiLineTitle(currentQuestion->question));Display_String(YUW_Quetion_LOC_B, &optionZY, TangshiLineAuthor(currentQuestion->question));for(u8 i=0;i<4;i++){Display_Fill_Rectangle2(answerLocX, answerLocY[i]-2, SCREEN_WIDTH - answerLocX, 21 ,answerBGColor[i]);Display_String2(answerLocX, answerLocY[i], &optionAnswer[i], (const char *)answerTitle[i], dataLine(currentQuestion->answer[i]));}
}void YuWenTS::showTangshi(){Display_Fill_Rectangle2(TangshiBoxStartX,TangshiBoxStartY, TangshiBoxWidth, TangshiBoxHeight, BLACK);u16 offx = 0;int offy = offsetY;boxHeight=1;const char *sl;for(u8 i=0;i< dataLineCount(currentQuestion->question) ;i++){sl= TangshiLine(currentQuestion->question, i);u16 len = strlen(sl);if(sl[0] == 'g' ){offx = 0;offy += 20;boxHeight++;continue;}if(offx + len* 8 > TangshiBoxWidth){offx = 0;offy += 20;boxHeight++;}if(offy <0 || offy>TangshiBoxHeight-TangshiBoxLineHeight ){offx += len*8;continue;}if (i== currentQuestion->line){answerX=offx + TangshiBoxStartX;answerY=offy + TangshiBoxStartY;answerIdx = TangshiLineIdx(currentQuestion->question, i);for(u8 j=0;j< len; j++){Display_String(answerX+ j*8, answerY, &optionMiss, "_") ;}}else{Display_String(offx + TangshiBoxStartX, offy + TangshiBoxStartY, &optionLines, TangshiLine(currentQuestion->question, i));}offx += len*8;}boxHeight = boxHeight*TangshiBoxLineHeight;if(boxHeight > TangshiBoxHeight){Display_Fill_Rectangle(TangshiBoxStartX + TangshiBoxWidth - 10, TangshiBoxStartY, TangshiBoxStartX + TangshiBoxWidth -1, TangshiBoxStartY + TangshiBoxHeight, GRAY);double a = (double) (-offsetY) / boxHeight * TangshiBoxHeight;double b = (double) (-offsetY + TangshiBoxHeight) / boxHeight * TangshiBoxHeight;Display_Fill_Rectangle(TangshiBoxStartX + TangshiBoxWidth - 9,TangshiBoxStartY + a, TangshiBoxStartX + TangshiBoxWidth -2,TangshiBoxStartY + b,GREEN);}
}

4、英语学习类,继承学习基类:

YingYu.h

typedef struct {uint16_t question;uint16_t answer[4];uint8_t ans;
} EngQuestion;class YingYu : public StudyBase
{public:YingYu();   ~YingYu();  SceanResult tick(u32 ticks);int scean_init(cJSON*  param);private:EngQuestion *currentQuestion;void start();void createQuestion();void createQuestionMode3();void showQuetion();void showAnswer();void correct();void wrong();DisplayOption optionQuetion = {FONT_SIZE_2424, YELLOW, BLACK, 1, 1};DisplayOption optionZY = {FONT_SIZE_2424, WHITE, BLACK, 1, 1};DisplayOption optionAnswer[4] = {{FONT_SIZE_1516, WHITE, answerBGColor[0], 0, 1},{FONT_SIZE_1516, WHITE, answerBGColor[1], 0, 1},{FONT_SIZE_1516, WHITE, answerBGColor[2], 0, 1}, {FONT_SIZE_1516, WHITE, answerBGColor[3], 0, 1}};u16 Eng_Answer_LOC_X=20;u16 Eng_Answer_LOC_Y[4] = {195,220,245,270};char errEngWord[4][40];unsigned char *DataBuff;int YingYuCount;
};

YingYu.cpp


#define Eng_Quetion_LOC_A  240, 100
#define Eng_Quetion_LOC_B  240, 140typedef struct YingYuWord
{const char *en; //32const char *sd; //32const char *cn; //64
}YingYuWord;typedef struct YingYuDuanYu
{const char *en; //64const char *cn; //64
}YingYuDuanYu;YingYu::YingYu(){currentQuestion = new EngQuestion();
} 
YingYu::~YingYu(){delete currentQuestion;psram_heap_free((void*)DataBuff);
}  int YingYu::scean_init(cJSON*  param){setKeyAdepterIntervalAll(200);setKeyAdepterInterval(KEY_GPIO_A, 65535);setKeyAdepterInterval(KEY_GPIO_B, 65535);setKeyAdepterInterval(KEY_GPIO_C, 65535);setKeyAdepterInterval(KEY_GPIO_D, 65535);winMode= cJSON_GetObjectItem(param,"w")->valueint;gameMode = cJSON_GetObjectItem(param,"m")->valueint;printf("start chinese. winMode=%d, gameMode=%d.\n", winMode, gameMode);fatfs_readFile(cJSON_GetObjectItem(param,"f")->valuestring, &DataBuff);YingYuCount = DataBuff[12] | (DataBuff[13]<<8) | (DataBuff[14]<<16)| (DataBuff[15]<<24);start();return 0;
}
void YingYu::start(){startPrepare();show_status_info(answerInfo);showScore();createQuestion();showQuetion();
}#define dataDC(idx) ((const char*)DataBuff+((idx) * 128) + 64)
#define dataZY(idx) ((const char*)DataBuff+((idx) * 128) + 96)
#define dataCN(idx) ((const char*)DataBuff+((idx) * 128) + 128)void YingYu::showQuetion()
{u8 i;for(i=0;i<4;i++)Display_Fill_Rectangle2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i]-2, 440, 21 ,answerBGColor[i]);Display_Fill_Rectangle2(0,100, 480, 80, BLACK);printf("q=%d, a=%d, a1=%d, a2=%d, a3=%d, a4=%d\n",currentQuestion->question,currentQuestion->ans,currentQuestion->answer[0]
,currentQuestion->answer[1]
,currentQuestion->answer[2]
,currentQuestion->answer[3] );switch (gameMode) {case 1:Display_String(Eng_Quetion_LOC_A, &optionQuetion, dataDC(currentQuestion->question));Display_String2(Eng_Quetion_LOC_B, &optionZY, "[%s]", dataZY(currentQuestion->question));for(i=0;i<4;i++)Display_String2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i], &optionAnswer[i], (const char *)answerTitle[i], dataCN(currentQuestion->answer[i]));break;case 2:Display_String(Eng_Quetion_LOC_A, &optionQuetion, dataCN(currentQuestion->question));Display_String2(Eng_Quetion_LOC_B, &optionZY, "[%s]", dataZY(currentQuestion->question));for(i=0;i<4;i++)Display_String2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i], &optionAnswer[i], (const char *)answerTitle[i], dataDC(currentQuestion->answer[i]));break;case 3:Display_String(Eng_Quetion_LOC_A, &optionQuetion, dataCN(currentQuestion->question));Display_String2(Eng_Quetion_LOC_B, &optionZY, "[%s]", dataZY(currentQuestion->question));for(i=0;i<4;i++)Display_String2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i], &optionAnswer[i], (const char *)answerTitle[i], errEngWord[i]);break;case 4:Display_String(Eng_Quetion_LOC_A, &optionQuetion, dataDC(currentQuestion->question));for(i=0;i<4;i++)Display_String2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i], &optionAnswer[i], (const char *)answerTitle[i], dataCN(currentQuestion->answer[i]));break;case 5:Display_String(Eng_Quetion_LOC_A, &optionQuetion, dataCN(currentQuestion->question));for(i=0;i<4;i++)Display_String2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i], &optionAnswer[i], (const char *)answerTitle[i], dataDC(currentQuestion->answer[i]));break;}
}void YingYu::showAnswer(){for(u8 i=0;i<4;i++)if(currentQuestion->ans !=i)	Display_Fill_Rectangle2(Eng_Answer_LOC_X, Eng_Answer_LOC_Y[i]-2, 440, 21 ,BLACK);
}SceanResult YingYu::tick(u32 ticks){if(KEY_EXIT) {printf("goto top menu from About.\n");return SceanResult_EXIT;}if(isFinished){if(KEY_SEL) {start();return SceanResult_Done;}}else{totalTime+=ticks;showTime();if(checkFinish()){return SceanResult_Done;}if(KEY_A | KEY_B | KEY_C | KEY_D){if(KEY_A && currentQuestion->ans == 0){correct();return SceanResult_Done;}if(KEY_B && currentQuestion->ans == 1){correct();return SceanResult_Done;}if(KEY_C && currentQuestion->ans == 2){correct();return SceanResult_Done;}if(KEY_D && currentQuestion->ans == 3){correct();return SceanResult_Done;}wrong();}ran_max(10);}return SceanResult_Done;
}void YingYu::correct(){correntCount++;showScore();if(checkFinish()==0){createQuestion();showQuetion();}
}
void YingYu::wrong(){wrongCount++;showScore();showAnswer();errorDelay(3);if(checkFinish()==0){createQuestion();showQuetion();}
}void YingYu::createQuestion()
{currentQuestion->question = ran_max(YingYuCount);currentQuestion->ans = ran_max(4);for(u8 i=0;i<4;i++){if(i == currentQuestion->ans){currentQuestion->answer[i] = currentQuestion->question;}else{currentQuestion->answer[i] = ran_max(YingYuCount);}}if(gameMode == 3){createQuestionMode3();}}void YingYu::createQuestionMode3()
{uint8_t i,e1,e2;char ne1,ne2;u8 len = strlen(dataDC(currentQuestion->question));for(i=0; i<4; i++) {memset(errEngWord[i], 0, 40);memcpy(errEngWord[i],  dataDC(currentQuestion->question), len);}e1 = ran_max(len);while(errEngWord[0][e1] < 97 || errEngWord[0][e1] > 122) {e1 = ran_max(len);}e2 = e1;while(e2 == e1 || errEngWord[0][e2] < 97 || errEngWord[0][e2] > 122) {e2 = ran_max(len);}ne1 = errEngWord[0][e1] - ran_max(25) -1;if(ne1 < 97) {ne1 =ne1 + 26;}ne2 = errEngWord[0][e2] - ran_max(25) -1;if(ne2 < 97) {ne2 =ne2 + 26;}errEngWord[(currentQuestion->ans + 1) % 4][e1] = ne1;errEngWord[(currentQuestion->ans + 2) % 4][e1] = ne1;errEngWord[(currentQuestion->ans + 2) % 4][e2] = ne2;errEngWord[(currentQuestion->ans + 3) % 4][e2] = ne2;}

 

这篇关于W801学习笔记二十三:语文和英语学习应用的代码汇总的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/971967

相关文章

51单片机学习记录———定时器

文章目录 前言一、定时器介绍二、STC89C52定时器资源三、定时器框图四、定时器模式五、定时器相关寄存器六、定时器练习 前言 一个学习嵌入式的小白~ 有问题评论区或私信指出~ 提示:以下是本篇文章正文内容,下面案例可供参考 一、定时器介绍 定时器介绍:51单片机的定时器属于单片机的内部资源,其电路的连接和运转均在单片机内部完成。 定时器作用: 1.用于计数系统,可

问题:第一次世界大战的起止时间是 #其他#学习方法#微信

问题:第一次世界大战的起止时间是 A.1913 ~1918 年 B.1913 ~1918 年 C.1914 ~1918 年 D.1914 ~1919 年 参考答案如图所示

[word] word设置上标快捷键 #学习方法#其他#媒体

word设置上标快捷键 办公中,少不了使用word,这个是大家必备的软件,今天给大家分享word设置上标快捷键,希望在办公中能帮到您! 1、添加上标 在录入一些公式,或者是化学产品时,需要添加上标内容,按下快捷键Ctrl+shift++就能将需要的内容设置为上标符号。 word设置上标快捷键的方法就是以上内容了,需要的小伙伴都可以试一试呢!

Tolua使用笔记(上)

目录   1.准备工作 2.运行例子 01.HelloWorld:在C#中,创建和销毁Lua虚拟机 和 简单调用。 02.ScriptsFromFile:在C#中,对一个lua文件的执行调用 03.CallLuaFunction:在C#中,对lua函数的操作 04.AccessingLuaVariables:在C#中,对lua变量的操作 05.LuaCoroutine:在Lua中,

AssetBundle学习笔记

AssetBundle是unity自定义的资源格式,通过调用引擎的资源打包接口对资源进行打包成.assetbundle格式的资源包。本文介绍了AssetBundle的生成,使用,加载,卸载以及Unity资源更新的一个基本步骤。 目录 1.定义: 2.AssetBundle的生成: 1)设置AssetBundle包的属性——通过编辑器界面 补充:分组策略 2)调用引擎接口API

C++工程编译链接错误汇总VisualStudio

目录 一些小的知识点 make工具 可以使用windows下的事件查看器崩溃的地方 dumpbin工具查看dll是32位还是64位的 _MSC_VER .cc 和.cpp 【VC++目录中的包含目录】 vs 【C/C++常规中的附加包含目录】——头文件所在目录如何怎么添加,添加了以后搜索头文件就会到这些个路径下搜索了 include<> 和 include"" WinMain 和

Javascript高级程序设计(第四版)--学习记录之变量、内存

原始值与引用值 原始值:简单的数据即基础数据类型,按值访问。 引用值:由多个值构成的对象即复杂数据类型,按引用访问。 动态属性 对于引用值而言,可以随时添加、修改和删除其属性和方法。 let person = new Object();person.name = 'Jason';person.age = 42;console.log(person.name,person.age);//'J

大学湖北中医药大学法医学试题及答案,分享几个实用搜题和学习工具 #微信#学习方法#职场发展

今天分享拥有拍照搜题、文字搜题、语音搜题、多重搜题等搜题模式,可以快速查找问题解析,加深对题目答案的理解。 1.快练题 这是一个网站 找题的网站海量题库,在线搜题,快速刷题~为您提供百万优质题库,直接搜索题库名称,支持多种刷题模式:顺序练习、语音听题、本地搜题、顺序阅读、模拟考试、组卷考试、赶快下载吧! 2.彩虹搜题 这是个老公众号了 支持手写输入,截图搜题,详细步骤,解题必备

uniapp接入微信小程序原生代码配置方案(优化版)

uniapp项目需要把微信小程序原生语法的功能代码嵌套过来,无需把原生代码转换为uniapp,可以配置拷贝的方式集成过来 1、拷贝代码包到src目录 2、vue.config.js中配置原生代码包直接拷贝到编译目录中 3、pages.json中配置分包目录,原生入口组件的路径 4、manifest.json中配置分包,使用原生组件 5、需要把原生代码包里的页面修改成组件的方

公共筛选组件(二次封装antd)支持代码提示

如果项目是基于antd组件库为基础搭建,可使用此公共筛选组件 使用到的库 npm i antdnpm i lodash-esnpm i @types/lodash-es -D /components/CommonSearch index.tsx import React from 'react';import { Button, Card, Form } from 'antd'