首页 \ 问答 \ java连连看程序中的一部分,请求牛人帮忙注释一下

java连连看程序中的一部分,请求牛人帮忙注释一下

private void delete(Point p1,final Point p2 , boolean bDelete){   
  ArrayList points=new ArrayList();
  if(corner1==null){
   points.add(p1);
   points.add(p2);
  }
  else if(corner2==null){
   points.add(p1);
   points.add(corner1);
   points.add(p2);
  }
  else{
   if(p1.x!=corner1.x&&p1.y!=corner1.y){
    Point pt=corner1;
    corner1=corner2;
    corner2=pt;
   }
   points.add(p1);
   points.add(corner1);
   points.add(corner2);
   points.add(p2);
  }
  if(bDelete){
   delete(p1); delete(p2); 
  }
  notifyEffect(points);
 }
 public int getCols() {
  return cols;
 }

 private ArrayList getHSpaces(Point p,Point pg){
  ArrayList ps=new ArrayList();
  //左
  for(int dif=1; ;dif++){
   int col=p.y-dif;
   int row=p.x;
   if(col<0||(data[row][col]!=0&&!pg.equals(new Point(row,col)))) break;
   ps.add(new Point(row,col));
  }
  //右
  for(int dif=1; ;dif++){
   int col=p.y+dif;
   int row=p.x;
   if(col>=cols||(data[row][col]!=0&&!pg.equals(new Point(row,col)))) break;
   ps.add(new Point(row,col));
  }
  return ps;
 }

 public int[][] getMaps(){
  return data;
 }

 public int getRows() {
  return rows;
 }

 public Point getSltMatrix() {
  return sltMatrix;
 }

 /*
  * p 原点
  *纵向空白点(包括与原点等值的点)
  */
 private ArrayList getVSpaces(Point p,Point pg)//获得脚步
 {
  ArrayList ps=new ArrayList();
  //左
  for(int dif=1; ;dif++){
   int col=p.y;
   int row=p.x-dif;
   if(row<0||(data[row][col]!=0&&!pg.equals(new Point(row,col)))) break;
   ps.add(new Point(row,col));
  }
  //右
  for(int dif=1; ;dif++){
   int col=p.y;
   int row=p.x+dif;
   if(row>=rows||(data[row][col]!=0&&!pg.equals(new Point(row,col)))) break;

   ps.add(new Point(row,col));
  }
  return ps;
 }
更新时间:2021-07-02 22:07

最满意答案

需注意的是要将jacob.dll放到path中,而且我程序例子中使用的是一个具有宏定义的word文件。如果你使用我的程序访问不存在该宏的word文件,会出错的。

其他回答

pdftowordconverter

与其同类软件相比,该转换软件最大的优点在于能够保持原来的pdf版面布局,不会出现转换之后的word文档版面混乱情况。软件无须注册安装,下载解压直接使用。

下载地址: http://www.cngr.cn/dir/211/275/2007090822547.html

相关问答

更多
  • WORD转换到PDF WORD转换到PDF的 步骤就相对简单了,我们只需要安装一款虚拟打印机软件“Virtual Pdf Printer”即可,它可以将你编辑好的WORD文档直接输出为PDF文件格式。(下载地址: http:// www.newhua.com/soft/21190.htm) 安装后在WORD中点击“打开”→“打印”,在“打印机名称”中会看到多了一个“Virtual Printer”选项,选中它,点击确定后(未注册版本有10秒的等待时间),弹出“保存PDF文件”对话框,先选择文件的保存 路径, ...
  • 需注意的是要将jacob.dll放到path中,而且我程序例子中使用的是一个具有宏定义的word文件。如果你使用我的程序访问不存在该宏的word文件,会出错的。
  • WORD转换到PDF WORD转换到PDF的步骤就相对简单了,我们只需要安装一款虚拟打印机软件“Virtual Pdf Printer”即可,它可以将你编辑好的WORD文档直接输出为PDF文件格式。(下载地址: http://www.newhua.com/soft/21190.htm) 安装后在WORD中点击“打开”→“打印”,在“打印机名称”中会看到多了一个“Virtual Printer”选项,选中它,点击确定后(未注册版本有10秒的等待时间),弹出“保存PDF文件”对话框,先选择文件的保存路径,再点击 ...
  • 推荐下面免费的方法转成PDF试试: 方法一:使用虚拟打印机pdf factory即可,而且其他格式文件只要是能够打印,选择这个虚拟打印机,都可以做成PDF文件,很简单实用; 方法二:使用专门的转换软件,把文件转成PDF文件; 方法三:用其他虚拟打印机转成PDF文件。 方法四:用WPS本身自带的转换功能转成PDF文件。
  • 电子书阅览器一般都支持txt格式,好的智能手机也支持office和pdf打开。你的这种情况,可以自己建立txt文件,然后复制word和pdf文件就可以在手机上看了。
  • 需要用到 插件jacob,自己去下载吧。 import com.jacob.activeX.ActiveXComponent; import com.jacob.com.ComThread; import com.jacob.com.Dispatch; import com.jacob.com.Variant; public class D2P { private ActiveXComponent wordCom = null; private Object wordDoc = null; private ...
  • 这是一项相当艰巨的任务,如果你想要完美的结果(不使用Word就不可能实现),那就更难了,就像在纯Java中为你完成所有这些工作的API数量一样,并且开源代码为零我相信( 更新:我错了,见下文 )。 您的基本选项如下: 使用JNI / C#web服务/ etc脚本MS Office(只有100%完美结果的选项) 使用可用的API脚本Open Office(90%完美) 使用Apache POI&iText(非常大的工作,永远不会完美)。 更新 - 2016-02-11这是一篇关于这个主题的博客文章的简化副本, ...
  • 答案取决于你想要完成什么,以及它是否需要成为纯粹的Perl。 如果您的意图是从Web应用程序即时转换为PDF,这是因为进入PDF的内容是被动态生成或修改的? 换句话说,Word文档是否是从其他数据动态生成的? 如果是这样,您可能希望避开生成Word文档并将数据直接转换为PDF。 如果您只是将Word转换为PDF以将现有静态Word文档转换为PDF,并且大多数Word文档需要也被视为PDF,并且您的磁盘空间很便宜,那么最好将所有文档将Word文档预先提交给PDF。 但是,如果您预计PDF需要不经常生成,那么现 ...
  • 您可以尝试在Word中打开文档,然后另存为。 我不确定Acrobat API有什么(如果有的话)可用,但Word对于打开符合PDF ISO标准的PDF文档非常明智,该标准在Adobe认为2006年成为标准时提交。 这不是你的问题! $filePath = "C:\Temp\MyPdfDocument.pdf" $wd = New-Object -ComObject Word.Application $wd.Visible = $true $txt = $wd.Documents.Open( ...
  • 尝试PDFBOX public class PDFTextReader { static String pdftoText(String fileName) { PDFParser parser; String parsedText = null; PDFTextStripper pdfStripper = null; PDDocument pdDoc = null; COSDocument cosDoc = null; ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)