Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.7

#by default, source code is not obfuscated
ARG OBF=false

COPY pyarmor-regcode-1.txt ./pyarmor-regcode-1.txt

RUN pip install pyarmor
RUN pyarmor register pyarmor-regcode-1.txt

ADD /src /src
# obfuscate the source code ("src" folder). It creates "dist" folder with obfuscated source code that is copied again to "src" folder.
RUN if [ "$OBF" = "true" ]; then pyarmor obfuscate -r --src="src" sunfish.py;cp -R /dist/. /src; fi;

# remove file license python obfuscator
RUN find pyarmor-regcode-1.txt -delete

CMD python -u /src/sunfish.py "e2e4"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![Sunfish logo](https://raw.github.com/thomasahle/sunfish/master/logo/sunfish_large.png)

## Introduction
Sunfish is a simple, but strong chess engine, written in Python, mostly for teaching purposes. Without tables and its simple interface, it takes up just 111 lines of code! (see [`compressed.py`](https://github.com/thomasahle/sunfish/blob/master/compressed.py)) Yet [it plays at ratings above 2000 at Lichess](https://lichess.org/@/sunfish-engine).

Expand Down Expand Up @@ -64,3 +64,4 @@ In terms of Heritage, Sunfish borrows much more from [Micro-Max by Geert Muller]
# License

[GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html)

36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id 'com.bmuschko.docker-remote-api' version '6.4.0'
}

version='0.1'

repositories {
mavenCentral()
}


// Import task types
import com.bmuschko.gradle.docker.tasks.image.*


task buildImage(type: DockerBuildImage) {
inputDir = file('.')
images.add("docker.io/sebastianrevuelta/sunfish:${project.version}")
}


task pushImage(type: DockerPushImage, dependsOn: buildImage){
images.add("docker.io/sebastianrevuelta/sunfish:${project.version}")
}

task buildImageObf(type: DockerBuildImage) {
inputDir = file('.')
buildArgs = ['OBF':'true']
images.add("docker.io/sebastianrevuelta/sunfish:obf-${project.version}")

}

task pushImageObf(type: DockerPushImage, dependsOn: buildImageObf) {
dependsOn buildImageObf
images.add("docker.io/sebastianrevuelta/sunfish:obf-${project.version}")
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.6.1/userguide/multi_project_builds.html
*/

rootProject.name = 'sunfish'
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Loading