Skip to content

Instantly share code, notes, and snippets.

@gnmearacaun
Created April 14, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnmearacaun/231db9dfea63f5f216b3ff79914caccb to your computer and use it in GitHub Desktop.
Save gnmearacaun/231db9dfea63f5f216b3ff79914caccb to your computer and use it in GitHub Desktop.
a test
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectKey">
<option name="state" value="project://63537948-39a4-48a0-9c97-34259a0fa913" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Wsproject.iml" filepath="$PROJECT_DIR$/Wsproject.iml" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>
import java.util.*;
//import java.util.ArrayList;
//import java.util.Arrays;
class Main {
public static void main (String[] args){
WordSearch wpuzzle = new WordSearch (new ArrayList<>(Arrays.asList( "this", "that","these",
"those", "i", "you",
"them","us","it","is",
"on", "off", "up",
"down", "whatever")));
System.out.println("these are the words" + wpuzzle);
System.out.println(wpuzzle<>);
}
}
import java.util.ArrayList;
import java.util.Map;
/**
* Created by briain on 06/04/17.
*/
public class WordSearch {
private char[][] grid;
private ArrayList<String> words;
private int dimension;
//
WordSearch (ArrayList<String> aList){
words= aList;
dimension= getDimension();
System.out.print(dimension);
createGrid();
}
int getDimension(){
double result =0;
for( int i=0; i<words.size(); i++){
result+= words.get(i).length();
}
result*=1.75;
result=Math.sqrt(result);
result= Math.ceil(result);
return (int)result;
}
void createGrid(){
//create a 2d grid fixed size that reference 'grid'
//
//loop through each row
/// fill
}
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment