Coder Social home page Coder Social logo

Eimi Okuno's Projects

big-pocket-to-ip icon big-pocket-to-ip

If you have too many things in your reading list and you get a 413 from instapaper...

helloworld icon helloworld

public class VirtualChess { /* Hint: enums are used to express fixed sets of constants throughout your program, and because they are constants, we type-set them in UPPER CASE. Similarly, you could have enum for days of week ( MONDAY, TUESDAY...), compass directions (NORTH, WEST...) etc. */ public static void main (String [] args) { // create a chessboard matrix. //It is an array of arrays (hence matrix) of size 8 * 8 Chessmen[][] chessboard = new Chessmen[8][8]; //use 2 nested for loops to populate the chessboard with pieces and empty spaces //if...else statements should help to set the pieces where they belong. //chessboard[i][j] = Chessmen.EMPTY int i = 0; int j = 0; chessboard[i][j] = Chessmen.EMPTY; /*Chessmen.WHITE_KING "wK"; Chessmen.WHITE_QUEEN Chessmen.WHITE_ROOK, Chessmen.WHITE_BISHOP, Chessmen.WHITE_KNIGHT, Chessmen.WHITE_PAWN, Chessmen.BLACK_KING, Chessmen.BLACK_QUEEN, Chessmen.BLACK_ROOK, Chessmen.BLACK_BISHOP, Chessmen.BLACK_KNIGHT, Chessmen.BLACK_PAWN, Chessmen.EMPTY, */ for (i = 0; i <= 8; i++) { //assign chessboard [1][i] = Chessmen.BLACK_PAWN; chessboard[7][i] = Chessmen.WHITE_PAWN; for (j = 0; j <= 8; j++) { if (i == 0){ chessboard[i][0] = Chessmen.BLACK_ROOK; chessboard[i][1] = Chessmen.BLACK_KNIGHT; chessboard[i][2] = Chessmen.BLACK_BISHOP; chessboard[i][3] = Chessmen.BLACK_KING; chessboard[i][4] = Chessmen.BLACK_QUEEN; chessboard[i][5] = Chessmen.BLACK_BISHOP; chessboard[i][6] = Chessmen.BLACK_KNIGHT; chessboard[i][7] = Chessmen.BLACK_ROOK; } else if (i == 8) { chessboard[i][0] = Chessmen.WHITE_ROOK; chessboard[i][1] = Chessmen.WHITE_KNIGHT; chessboard[i][2] = Chessmen.WHITE_BISHOP; chessboard[i][3] = Chessmen.WHITE_KING; chessboard[i][4] = Chessmen.WHITE_QUEEN; chessboard[i][5] = Chessmen.WHITE_BISHOP; chessboard[i][6] = Chessmen.WHITE_KNIGHT; chessboard[i][7] = Chessmen.WHITE_ROOK; } } } } public enum Chessmen { WHITE_KING, WHITE_QUEEN, WHITE_ROOK, WHITE_BISHOP, WHITE_KNIGHT, WHITE_PAWN, BLACK_KING, BLACK_QUEEN, BLACK_ROOK, BLACK_BISHOP, BLACK_KNIGHT, BLACK_PAWN, EMPTY, } public static void printBoard (Chessmen[][] chessboard) { /*Use "\t" for placing tabs in strings. This will help you align individual columns in your chessboard.*/ // for i rows for (i = 0; i <= 8; i++){ chessboard[][] = new int [][]{ } // for j columns // switch(chessboard[i][j]) // case WHITE_KING : ... // ... //end for j //print new line //end for i } } first repository

keybr.com icon keybr.com

The smartest way to learn touch typing and improve your typing speed.

notify-slack-action icon notify-slack-action

🔔 Send a Slack Notification from Github Actions regarding failure, warnings, or even success.

pdf-redactor icon pdf-redactor

A general purpose PDF text-layer redaction tool for Python 2/3.

schemaorg-java icon schemaorg-java

Java utilities for working with Schema.org data in JSON-LD format

troposphere icon troposphere

troposphere - Python library to create AWS CloudFormation descriptions

visa_irl icon visa_irl

Indefinite Leave to Remain Calculation in Jupyter Notebook

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.