diff --git a/build.gradle b/build.gradle index e801c87..55e393f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'org.algo4j' -version '1.0' +version '1.0.5' apply plugin: 'java' apply plugin: 'kotlin' @@ -9,7 +9,6 @@ apply plugin: 'maven' sourceCompatibility = 1.8 targetCompatibility = 1.8 - repositories { jcenter() mavenCentral() @@ -31,8 +30,10 @@ buildscript { sourceSets { main.kotlin.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/java' -// main.kotlin.testDirs += 'src/test/kotlin' -// main.java.testDirs += 'src/test/java' + test.kotlin.srcDirs += 'src/test/kotlin' + test.java.srcDirs += 'src/test/java' + test.kotlin.srcDirs += 'demos' + test.java.srcDirs += 'demos' } dependencies { diff --git "a/demos/src/\346\236\201\344\271\220\345\207\200\345\234\237.java" "b/demos/src/\346\236\201\344\271\220\345\207\200\345\234\237.java" new file mode 100644 index 0000000..dfab746 --- /dev/null +++ "b/demos/src/\346\236\201\344\271\220\345\207\200\345\234\237.java" @@ -0,0 +1,532 @@ +package src; + +import org.algo4j.util.Loader; +import org.algo4j.win.WinAPI; + +/** + * Created by ice1000 on 2017/4/28. + * + * @author ice1000 + */ +public class ζžδΉε‡€εœŸ { + public static void main(String[] args) { + Loader.loadJni(); + // By ice1000 + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 500); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 500); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(523, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(330, 250); + WinAPI.beep(0, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 500); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 500); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(523, 250); + WinAPI.beep(578, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 500); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 500); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(523, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(262, 250); + WinAPI.beep(294, 250); + WinAPI.beep(330, 500); + WinAPI.beep(523, 500); + WinAPI.beep(440, 500); + WinAPI.beep(659, 500); + WinAPI.beep(578, 250); + WinAPI.beep(659, 125); + WinAPI.beep(578, 125); + WinAPI.beep(523, 250); + WinAPI.beep(578, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 250); + WinAPI.beep(698, 250); + WinAPI.beep(698, 250); + WinAPI.beep(659, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(880, 750); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 750); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 125); + WinAPI.beep(392, 125); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 125); + WinAPI.beep(330, 125); + WinAPI.beep(330, 500); + WinAPI.beep(0, 500); + WinAPI.beep(0, 750); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(494, 250); + WinAPI.beep(523, 500); + WinAPI.beep(494, 500); + WinAPI.beep(440, 250); + WinAPI.beep(494, 125); + WinAPI.beep(440, 125); + WinAPI.beep(392, 250); + WinAPI.beep(0, 750); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 125); + WinAPI.beep(392, 125); + WinAPI.beep(392, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 125); + WinAPI.beep(330, 125); + WinAPI.beep(330, 500); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(440, 125); + WinAPI.beep(494, 125); + WinAPI.beep(523, 500); + WinAPI.beep(578, 500); + WinAPI.beep(440, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 500); + WinAPI.beep(0, 250); + WinAPI.beep(578, 250); + WinAPI.beep(578, 250); + WinAPI.beep(554, 250); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(440, 125); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 500); + WinAPI.beep(0, 250); + WinAPI.beep(578, 250); + WinAPI.beep(578, 250); + WinAPI.beep(554, 250); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(440, 125); + WinAPI.beep(440, 125); + WinAPI.beep(330, 125); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 250); + WinAPI.beep(330, 125); + WinAPI.beep(392, 125); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(659, 500); + WinAPI.beep(0, 250); + WinAPI.beep(494, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 250); + WinAPI.beep(392, 125); + WinAPI.beep(392, 125); + WinAPI.beep(440, 500); + WinAPI.beep(659, 375); + WinAPI.beep(659, 125); + WinAPI.beep(578, 250); + WinAPI.beep(523, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 375); + WinAPI.beep(440, 125); + WinAPI.beep(440, 250); + WinAPI.beep(523, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 500); + WinAPI.beep(440, 250); + WinAPI.beep(440, 125); + WinAPI.beep(440, 125); + WinAPI.beep(440, 250); + WinAPI.beep(392, 125); + WinAPI.beep(392, 125); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(0, 250); + WinAPI.beep(523, 250); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 250); + WinAPI.beep(659, 500); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(523, 250); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(0, 250); + WinAPI.beep(659, 125); + WinAPI.beep(578, 125); + WinAPI.beep(523, 250); + WinAPI.beep(494, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 250); + WinAPI.beep(698, 250); + WinAPI.beep(698, 250); + WinAPI.beep(659, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 500); + WinAPI.beep(440, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 125); + WinAPI.beep(880, 750); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 750); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 125); + WinAPI.beep(392, 125); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 125); + WinAPI.beep(330, 125); + WinAPI.beep(330, 500); + WinAPI.beep(0, 500); + WinAPI.beep(0, 750); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(494, 250); + WinAPI.beep(523, 500); + WinAPI.beep(494, 500); + WinAPI.beep(440, 250); + WinAPI.beep(494, 125); + WinAPI.beep(440, 125); + WinAPI.beep(392, 250); + WinAPI.beep(0, 750); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 125); + WinAPI.beep(392, 125); + WinAPI.beep(392, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 125); + WinAPI.beep(330, 125); + WinAPI.beep(330, 500); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(440, 125); + WinAPI.beep(494, 125); + WinAPI.beep(523, 500); + WinAPI.beep(578, 500); + WinAPI.beep(440, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 500); + WinAPI.beep(0, 250); + WinAPI.beep(578, 250); + WinAPI.beep(578, 250); + WinAPI.beep(554, 250); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(440, 125); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(330, 250); + WinAPI.beep(330, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(0, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 500); + WinAPI.beep(0, 250); + WinAPI.beep(578, 250); + WinAPI.beep(578, 250); + WinAPI.beep(554, 250); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(440, 125); + WinAPI.beep(440, 125); + WinAPI.beep(330, 125); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 250); + WinAPI.beep(330, 125); + WinAPI.beep(392, 125); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(659, 500); + WinAPI.beep(0, 250); + WinAPI.beep(494, 125); + WinAPI.beep(523, 125); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 250); + WinAPI.beep(392, 125); + WinAPI.beep(392, 125); + WinAPI.beep(440, 500); + WinAPI.beep(659, 375); + WinAPI.beep(659, 125); + WinAPI.beep(578, 250); + WinAPI.beep(523, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 375); + WinAPI.beep(440, 125); + WinAPI.beep(440, 250); + WinAPI.beep(523, 250); + WinAPI.beep(578, 500); + WinAPI.beep(0, 500); + WinAPI.beep(440, 250); + WinAPI.beep(440, 125); + WinAPI.beep(440, 125); + WinAPI.beep(440, 250); + WinAPI.beep(392, 125); + WinAPI.beep(392, 125); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(0, 250); + WinAPI.beep(523, 250); + WinAPI.beep(578, 250); + WinAPI.beep(523, 125); + WinAPI.beep(578, 125); + WinAPI.beep(659, 250); + WinAPI.beep(659, 500); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(523, 250); + WinAPI.beep(0, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 250); + WinAPI.beep(659, 250); + WinAPI.beep(0, 250); + WinAPI.beep(659, 125); + WinAPI.beep(578, 125); + WinAPI.beep(523, 250); + WinAPI.beep(494, 250); + WinAPI.beep(440, 250); + WinAPI.beep(392, 250); + WinAPI.beep(392, 250); + WinAPI.beep(440, 500); + WinAPI.beep(0, 250); + + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index deedc7f..d6e2637 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 40515d2..28e0b34 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Aug 15 19:00:22 MSK 2016 +#Fri Mar 24 05:31:35 MSK 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip diff --git a/jni/cpp-test/message_box.cpp b/jni/cpp-test/message_box.cpp index 3a74784..633bfd2 100644 --- a/jni/cpp-test/message_box.cpp +++ b/jni/cpp-test/message_box.cpp @@ -7,6 +7,11 @@ //} #include #include +#include + +using std::cout; +using std::endl; +using std::cin; enum fy { d1 = 262, @@ -46,13 +51,388 @@ enum fy { g7 = 1976, yaya = 0 }; +// 356 56 568563 356 56 560896 356 56 56 + +void beeping(int in, int dur) { + switch (in) { + case 1: + Beep(d1, dur); + break; + case 2: + Beep(d2, dur); + break; + case 3: + Beep(d3, dur); + break; + case 4: + Beep(d4, dur); + break; + case 5: + Beep(d5, dur); + break; + case 6: + Beep(d6, dur); + break; + case 7: + Beep(d7, dur); + break; + case 8: + Beep(z1, dur); + break; + case 9: + Beep(z2, dur); + break; + case 0: + Beep(z3, dur); + break; + } +} +void B(int a, int b) { + cout << "WinAPI.beep(" << a << ", " << b * 125 << ")" << endl; + // Beep(a, b * 125); +} +int main() { + cout << "// By ice1000" << endl; + + B(d3,2); + B(d5,2); + + B(d6,2); + B(0 ,4); + B(d5,2); + B(d6,2); + B(0 ,4); + B(d5,2); + + B(d6,2); + B(z1,2); + B(d5,2); + B(d6,2); + B(d3,2); + B(0 ,2); + B(d3,2); + B(d5,2); + + B(d6,2); + B(0 ,4); + B(d5,2); + B(d6,2); + B(0 ,4); + B(d5,2); + B(d6,2); + + B(z3,2); + B(z1,2); + B(z2,2); + B(d6,2); + B(0 ,2); + B(d3,2); + B(d5,2); + + B(d6,2); + B(0 ,4); + B(d5,2); + B(d6,2); + B(0 ,4); + B(d5,2); + + B(d6,2); + B(z1,2); + B(d5,2); + B(d6,2); + B(d3,2); + B(d5,2); + B(d1,2); + B(d2,2); + + B(d3,4); + B(z1,4); + B(d6,4); + B(z3,4); + + B(z2,2); + B(z3,1); + B(z2,1); + B(z1,2); + B(z2,2); + B(d6,4); + B(0 ,4); + + for (auto i = 0; i < 2; ++i) { + B(d6,4); + B(d6,4); + B(d6,4); + B(d6,1); + B(z1,1); + B(z2,1); + B(z3,1); + + B(d6,4); + B(d6,4); + B(d6,2); + B(d5,2); + B(d5,2); + B(d6,2); + + B(d6,4); + B(d6,4); + B(d6,4); + B(d6,1); + B(z1,1); + B(z2,1); + B(z3,1); + + B(d6,4); + B(d6,4); + B(d6,2); + B(z4,2); + B(z4,2); + B(z3,2); + + B(d6,4); + B(d6,4); + B(d6,4); + B(d6,1); + B(z1,1); + B(z2,1); + B(z3,1); + + B(d6,4); + B(d6,4); + B(d6,2); + B(d5,2); + B(d5,2); + B(d6,2); + + B(d6,4); + B(d6,4); + B(d6,4); + B(d6,1); + B(z1,1); + B(z2,1); + B(z3,1); + + B(z6,6); + B(d5,2); + B(d5,2); + B(d6,2); + B(d6,4); + + B(0 ,6); + B(d6,2); + B(d6,2); + B(d5,1); + B(d5,1); + B(d5,2); + B(d6,2); + + B(d5,2); + B(d3,2); + B(d3,2); + B(d5,1); + B(d3,1); + B(d3,4); + B(0 ,4); + + B(0 ,6); + B(d6,2); + B(d6,2); + B(d5,2); + B(d6,2); + B(d7,2); + + B(z1,4); + B(d7,4); + B(d6,2); + B(d7,1); + B(d6,1); + B(d5,2); + + B(0 ,6); + B(d6,2); + B(d6,2); + B(d5,2); + B(d5,2); + B(d6,1); + B(d5,1); + + B(d5,2); + B(d3,2); + B(d3,2); + B(d5,1); + B(d3,1); + B(d3,4); + B(0 ,2); + B(d5,2); + + B(d5,2); + B(d6,2); + B(0 ,2); + B(d5,2); + B(d5,2); + B(d6,2); + B(0 ,2); + B(d6,1); + B(d7,1); + + B(z1,4); + B(z2,4); + B(d6,2); + B(d3,2); + B(d3,2); + B(d5,2); + + B(d5,2); + B(d6,2); + B(0 ,2); + B(z3,2); + B(z2,4); + B(0 ,2); + B(d6,2); + + B(0 ,2); + B(d6,2); + B(d6,2); + B(z3,2); + B(z2,4); + B(0 ,4); + + B(0 ,2); + B(z2,2); + B(z2,2); + B(z1_,2); + B(z2,2); + B(z1,1); + B(d6,1); + B(d6,2); + B(d5,2); + + B(d5,2); + B(d5,2); + B(d5,2); + B(d6,2); + B(d6,2); + B(d3,2); + B(d3,2); + B(d5,2); + + + B(d5,2); + B(d6,2); + B(0 ,2); + B(z3,2); + B(z2,4); + B(0 ,2); + B(d6,2); + + B(0 ,2); + B(d6,2); + B(d6,2); + B(z3,2); + B(z2,4); + B(0 ,4); + + B(0 ,2); + B(z2,2); + B(z2,2); + B(z1_,2); + B(z2,2); + B(z1,1); + B(d6,1); + B(d6,1); + B(d3,1); + B(d5,2); + + B(d5,2); + B(d6,2); + B(d6,2); + B(d5,2); + B(d6,4); + B(0 ,2); + B(d3,1); + B(d5,1); + + B(d6,2); + B(d6,2); + B(d6,2); + B(z3,2); + B(z3,4); + B(0 ,2); + B(d7,1); + B(z1,1); + + B(z2,2); + B(z1,1); + B(z2,1); + B(z3,2); + B(d6,4); + B(0 ,2); + B(d5,1); + B(d5,1); + + B(d6,4); + B(z3,3); + B(z3,1); + B(z2,2); + B(z1,2); + B(d6,2); + B(d5,2); + + B(d6,3); + B(d6,1); + B(d6,2); + B(z1,2); + B(z2,4); + B(0 ,4); + + B(d6,2); + B(d6,1); + B(d6,1); + B(d6,2); + B(d5,1); + B(d5,1); + B(d6,2); + B(z3,2); + B(0 ,2); + B(z1,2); + + B(z2,2); + B(z1,1); + B(z2,1); + B(z3,2); + B(z3,4); + B(0 ,2); + B(d5,2); + + B(d5,2); + B(z1,2); + B(0 ,2); + B(d5,2); + B(d6,2); + B(z3,2); + B(0 ,2); + B(z3,1); + B(z2,1); + + B(z1,2); + B(d7,2); + B(d6,2); + B(d5,2); + B(d5,2); + B(d6,4); + B(0 ,2); + } + + Sleep(300); + return 0; +} struct yf { enum fy s; int t; }; -int main(int argc, char* argv[]) { +int main2(int argc, char* argv[]) { int n = 0; struct yf a[1000]= {{z3,125},{z3,50},{z4,100},{z3,50},{z2,50}, //5 @@ -97,7 +477,7 @@ int main(int argc, char* argv[]) { while(n--) { Beep(atop->s,atop->t*5); - std::cout << "Pair(" << atop->s << ", " << atop->t*5 << ")," << std::endl; + cout << "Pair(" << atop->s << ", " << atop->t*5 << ")," << endl; atop++; } return 0; diff --git a/src/main/java/org/algo4j/win/WinAPI.java b/src/main/java/org/algo4j/win/WinAPI.java index bd17eb0..5445f55 100644 --- a/src/main/java/org/algo4j/win/WinAPI.java +++ b/src/main/java/org/algo4j/win/WinAPI.java @@ -55,6 +55,44 @@ public static class MessageBoxType { public static final int MB_MISCMASK = 0x0000C000; } + public static class BeepUtils { + public static final int d1 = 262; + public static final int d1_ = 277; + public static final int d2 = 294; + public static final int d2_ = 311; + public static final int d3 = 330; + public static final int d4 = 349; + public static final int d5 = 392; + public static final int d5_ = 415; + public static final int d6 = 440; + public static final int d6_ = 466; + public static final int d7 = 494; + public static final int z1 = 523; + public static final int z1_ = 554; + public static final int z2 = 578; + public static final int z2_ = 622; + public static final int z3 = 659; + public static final int z4 = 698; + public static final int z4_ = 740; + public static final int z5 = 784; + public static final int z5_ = 831; + public static final int z6 = 880; + public static final int z6_ = 932; + public static final int z7 = 988; + public static final int g1 = 1046; + public static final int g1_ = 1109; + public static final int g2 = 1175; + public static final int g2_ = 1245; + public static final int g3 = 1318; + public static final int g4 = 1397; + public static final int g4_ = 1480; + public static final int g5 = 1568; + public static final int g5_ = 1661; + public static final int g6 = 1760; + public static final int g6_ = 1865; + public static final int g7 = 1976; + } + /** * beep * Win32API: Beep(DWORD, DWORD)