3705

积分

好友

主题

[CSE 14X] 代码插入测试

发表于 2012-4-25 21:05:16 | 查看: 1902| 回复: 6
  1. // CSE 143 Homework 7: 20 Questions

  2. /**
  3. * Interface describing abstract user interaction operations.
  4. * This interface is implemented by the graphical and text UIs for the game.
  5. * Your QuestionTree interacts with the UI through this interface.
  6. * @author Marty Stepp
  7. * @version 2010/02/20
  8. */
  9. public interface UserInterface {
  10.     /**
  11.      * Waits for the user to input a yes/no answer (by typing, clicking, etc.),
  12.      * and returns that answer as a boolean value.
  13.      * @return the answer typed by the user as a boolean (yes is true, no is false)
  14.      */
  15.     boolean nextBoolean();

  16.     /**
  17.      * Waits for the user to input a text value, and returns that answer as a String.
  18.      * @return the answer typed by the user as a String (empty string if no answer typed)
  19.      */
  20.     String nextLine();
  21.    
  22.     /**
  23.      * Displays the given output message to the user.
  24.      * @param message The message to display.  Assumes not null.
  25.      */
  26.     void print(String message);
  27.    
  28.     /**
  29.      * Displays the given output message to the user.
  30.      * If the UI is a text UI, also inserts a line break (\n).
  31.      * @param message The message to display.  Assumes not null.
  32.      */
  33.     void println(String message);

  34.     // various messages that are output by the user interface
  35.     // (your QuestionTree does not need to refer to these messages)
  36.     final String PLAY_AGAIN_MESSAGE = "Challenge me again?";
  37.     final String SAVE_MESSAGE = "Shall I remember these games?";
  38.     final String LOAD_MESSAGE = "Shall I recall our previous games?";
  39.     final String SAVE_LOAD_FILENAME_MESSAGE = "What is the file name?";
  40.     final String STATUS_MESSAGE = "Games played: %d\nI won: %d";
  41.     final String BANNER_MESSAGE = "Think of an item, and I will guess it.";
  42. }
复制代码
发表于 2012-4-26 02:41:36
[math]\\frac{2xc}{9e^2}[/math]

回复 显示全部楼层 道具 举报

发表于 2012-8-18 18:59:18
[code=java]public class Permutations{

  public static void main(String[] args){
  
    System.out.println(sumTo(2));
   
  }


  public static double sumTo(int n){
      double r = 0.0;
      if (n <= 0){
          throw new IllegalArgumentException();
      }else if(n == 1){
          return 1.0;
      }else{
          r = sumTo(n-1) + 1.0/n;
      }
      return r;
  }
}[/code]

回复 显示全部楼层 道具 举报

发表于 2012-10-17 00:08:57
这是........

回复 显示全部楼层 道具 举报

发表于 2012-10-17 00:30:55
boris9297 发表于 2012-10-17 01:08
这是........

测试的是代码染色功能,就比如把 public return什么的高亮。
代码是我随便找的

回复 显示全部楼层 道具 举报

发表于 2012-10-17 00:31:47
admin 发表于 2012-10-17 01:30
测试的是代码染色功能,就比如把 public return什么的高亮。
代码是我随便找的 ...

二楼是还没弄好的数学公式编辑器

回复 显示全部楼层 道具 举报

发表于 2012-11-10 12:54:55
wow,好赞

回复 显示全部楼层 道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|Copyright|CSUW

GMT-8, 2019-5-23 02:40 , Processed in 0.276441 second(s), 18 queries .

Powered by CSUW

© 2001-2012 CSUW.ORG

返回顶部