Giter VIP home page Giter VIP logo

renju's Introduction

Renju

最后一次更新

What is this & Some Thoughts

这是C程序设计的五子棋大作业项目。

这个小程序的定位:

本人Graphics壬,对AI和算法的研究兴趣只能说很有限,花在AI上的时间也很有限,肯定卷不过大家的肝帝,大家不用慌。

Graphics人的关注重点是如何写好的UI,毕竟Graphics是不一定用得上AI的,但是图形系统早晚是得造的(

学AI的这么多,我何必抢你们饭碗呢

UPD:写完五子棋AI以后更加坚定了不走AI路的决心,还是Graphics好

这一次强迫自己不用C++,用C从底层开始把轮子造好,也不是什么难事儿,就是没泛型有点蛋疼,然后性能跟STL容器和算法都肯定没法比就是了。

How to build

目前只在Arch Linux下进行了简单的测试。安装前请确保你的系统安装了CMake且版本不低于3.23。

尚未兼容Windows...

Linux:

在项目根目录下使用如下命令:

mkdir build
cd build
cmake ..
make

在build目录下找到Renju文件,运行即可

Windows:

在项目根目录下使用如下命令:

mkdir build
cd build
cmake .. -G "Unix Makefiles"
make

其中cmake命令与Linux下不同,避免CMake默认生成Visual Studio项目。

在build目录下找到Renju文件,运行即可。

可能的问题:

如果发现界面全角字符显示错误,建议修改为UTF-8编码再运行。

Something about Document

额,虽然你也注意到了源码的注释有些是用doxygen格式写的。

但是显然它写得不全面也很丑,我也没试过它到底能不能构建成文档,凑合着看吧(

How to Control

用键盘的上下方向键切换选项,对于可以自定义的选项,使用左右方向键来切换。

使用回车键确认。

About Code

自己编写了简易的文本用户界面(TUI)控件,组了个挺草率的UI,如果觉得默认主题不好看可以自己换。

目前还没有实现这些自定义设置的功能,来不及做了(

TUI比较多地用了OOP的想法,因为对效率要求不高所以封装抽象都尽可能做了,个人感觉可读性应该还不错。

但是控制AI的代码丑得很不人性,为了尽可能减少重复的运算和频繁的函数调用刻意避免了许多封装和复用

我当然知道很多东西能封装很多东西能复用啊,但是显而易见的它们会降低程序运行效率

当然在这些细枝末节的地方对效率吹毛求疵是没啥卵用的。。。

Many More Things to be Improved:

因为考试周赶紧,只能做到如此了,设置界面,存档和载入界面,悔棋功能,暂时都还没做完。

更新结束了,AI也做成这样了,不再大改了。这个项目封盘。 剩下的再做不完也不做了,都是体力活儿。寒假有更加重要更加有趣有意义的事情要做, 如果你对这个丑东西感兴趣随便拿来自己玩自己改都行,如果你把我没做完的东西做完了那我实在非常感谢。

renju's People

Contributors

clv-iclucia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.