随笔分类 - 算法
摘要:package main import ( "fmt" "container/list" "strings" "strconv" //"reflect" ) func main(){ opList := list.New() valList := list.New() fmt.Println("") var ex...
阅读全文
摘要:最近写一个无限来回翻页UI, 从第一页向后翻页就到达最后一页. 写了一个函数输入一个数字转换成”页区间之间的数字” using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleA...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 洗扑克牌 { class Program { static void Main(string[] args)...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 约瑟夫环算法 { class Program { const int Num = 41; c...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 矩阵运算 { class Program { static void Main(string[] args)...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 二分查询 { class Program { static void Main(string[] args)...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 换瓶子 { class Program { //2元钱1瓶子 //4个瓶盖换...
阅读全文
摘要:仿造>里面对的算法,使用C#实现了一遍. 理论知识我就不讲解了,在这本书里面已经写的非常完美! 代码如何下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 图结构 { pub...
阅读全文
摘要:二叉堆数据结构讲解: http://www.cnblogs.com/yc_sunniwell/archive/2010/06/28/1766751.html C#代码实现 using System; using System.Collections.Generic; namespace 二叉堆 { //从小到大 public class BinaryHeap ...
阅读全文
摘要:using System; enum Move { walk, run } class Program { static float[] speedAry = { 50.0f, 200.0f }; public static Move move = ...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace StateMachine { class Program { static void Main(string...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication2 { class Program { static void Main...
阅读全文
摘要:穷举算法的基本思想就是从所有可能的情况中搜索正确的答案,在使用穷举算法时,需要明确问题的答案的范围,在范围中搜索出每一种答案,得到你最想要的答案 1. 对于一种可能的情况,计算出结果 2. 判断结果是否满足,不满足就继续搜索下一个答案,满足要求则表示找到一个正确答案 穷举算法实例: 鸡兔同笼,共有35个头,94条腿,鸡兔各有多少只? (答案范围有两个, 小鸡假设有...
阅读全文
摘要:没有采用二叉堆算法优化, 学习了几天终于搞除了一个demo, 这个列子如果点击按钮生成的方块大小不正确,可以先设置下预设调成相应的大小 只能上下左右走 using UnityEngine; using System.Collections; using System.Collections.Generic; using System; public class AStar...
阅读全文
摘要:练习下矩阵的基本运算:O(∩_∩)O~ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace ConsoleApplication4
{ class MyMatrix3 { ...
阅读全文
摘要:using UnityEngine;
using System.Collections; public class ProjectileTest : MonoBehaviour
{ public GameObject target; public float speed = 10; private float distanceToTarget; priv...
阅读全文
摘要:自己在做游戏的忘记了Unity帮我们提供计算两点之间的距离,在百度搜索了下。 原来有一个公式自己就写了一个方法O(∩_∩)O~,到僵尸到达某一个点之后就向另一个奔跑过去 /// /// 3维中如何计算两点之间的距离 /// /// /// /// private float TwoPointDistance3D(Vector3 ...
阅读全文
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace ConsoleA...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ class...
阅读全文
浙公网安备 33010602011771号