srand() moved from crossgen.hpp to wxCrossGen/main.cpp

This commit is contained in:
2015-06-13 08:29:32 +03:00
parent 11cd066c8c
commit 5b68f01e62
6 changed files with 18 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CodeLite_Workspace Name="CrossGen" Database=""> <CodeLite_Workspace Name="CrossGen" Database="">
<Project Name="wxCrossGen" Path="wxCrossGen/wxCrossGen.project" Active="No"/> <Project Name="wxCrossGen" Path="wxCrossGen/wxCrossGen.project" Active="Yes"/>
<Project Name="CrossBench" Path="CrossBench/CrossBench.project" Active="Yes"/> <Project Name="CrossBench" Path="CrossBench/CrossBench.project" Active="No"/>
<BuildMatrix> <BuildMatrix>
<WorkspaceConfiguration Name="Debug" Selected="yes"> <WorkspaceConfiguration Name="Debug" Selected="yes">
<Project Name="wxCrossGen" ConfigName="Debug"/> <Project Name="wxCrossGen" ConfigName="Debug"/>

View File

@@ -1,8 +1,8 @@
.PHONY: clean All .PHONY: clean All
All: All:
@echo "----------Building project:[ CrossBench - Debug ]----------" @echo "----------Building project:[ wxCrossGen - Release ]----------"
@cd "CrossBench" && $(MAKE) -f "CrossBench.mk" @cd "wxCrossGen" && $(MAKE) -f "wxCrossGen.mk"
clean: clean:
@echo "----------Cleaning project:[ CrossBench - Debug ]----------" @echo "----------Cleaning project:[ wxCrossGen - Release ]----------"
@cd "CrossBench" && $(MAKE) -f "CrossBench.mk" clean @cd "wxCrossGen" && $(MAKE) -f "wxCrossGen.mk" clean

View File

@@ -187,7 +187,6 @@ void generateCross(GridType &grid, const DictType &dict, std::vector<wxString> &
winfos.at(i).x,winfos.at(i).y,winfos.at(i).len, winfos.at(i).ind, int(winfos.at(i).direct)); winfos.at(i).x,winfos.at(i).y,winfos.at(i).len, winfos.at(i).ind, int(winfos.at(i).direct));
UsedWords t_used; UsedWords t_used;
srand(time(NULL));
procCross(t_used, words, grid, winfos, 0, words_out); procCross(t_used, words, grid, winfos, 0, words_out);
std::reverse(words_out.begin(), words_out.end()); std::reverse(words_out.begin(), words_out.end());
} }

View File

@@ -29,6 +29,7 @@ MainFrame::MainFrame(wxWindow* parent, int id, const wxString& title, const wxPo
do_layout(); do_layout();
_isDictLoaded = false; _isDictLoaded = false;
srand(time(NULL));
} }

View File

@@ -2,18 +2,18 @@
## Auto Generated makefile by CodeLite IDE ## Auto Generated makefile by CodeLite IDE
## any manual changes will be erased ## any manual changes will be erased
## ##
## Debug ## Release
ProjectName :=wxCrossGen ProjectName :=wxCrossGen
ConfigurationName :=Debug ConfigurationName :=Release
WorkspacePath := "/data/Sync/SyncProjects/CrossGen" WorkspacePath := "/data/Sync/SyncProjects/CrossGen"
ProjectPath := "/data/Sync/SyncProjects/CrossGen/wxCrossGen" ProjectPath := "/data/Sync/SyncProjects/CrossGen/wxCrossGen"
IntermediateDirectory :=./Debug IntermediateDirectory :=../Release
OutDir := $(IntermediateDirectory) OutDir := $(IntermediateDirectory)
CurrentFileName := CurrentFileName :=
CurrentFilePath := CurrentFilePath :=
CurrentFileFullPath := CurrentFileFullPath :=
User :=Aleksey Lobanov User :=Aleksey Lobanov
Date :=12/06/15 Date :=13/06/15
CodeLitePath :="/home/alex/.codelite" CodeLitePath :="/home/alex/.codelite"
LinkerName :=/usr/bin/g++-4.8 LinkerName :=/usr/bin/g++-4.8
SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC
@@ -28,14 +28,14 @@ LibraryPathSwitch :=-L
PreprocessorSwitch :=-D PreprocessorSwitch :=-D
SourceSwitch :=-c SourceSwitch :=-c
OutputFile :=$(IntermediateDirectory)/$(ProjectName).out OutputFile :=$(IntermediateDirectory)/$(ProjectName).out
Preprocessors := Preprocessors :=$(PreprocessorSwitch)NDEBUG
ObjectSwitch :=-o ObjectSwitch :=-o
ArchiveOutputSwitch := ArchiveOutputSwitch :=
PreprocessOnlySwitch :=-E PreprocessOnlySwitch :=-E
ObjectsFileList :="wxCrossGen.txt" ObjectsFileList :="wxCrossGen.txt"
PCHCompileFlags := PCHCompileFlags :=
MakeDirCommand :=mkdir -p MakeDirCommand :=mkdir -p
LinkOptions := $(shell wx-config --debug=yes --libs --unicode=yes) LinkOptions := -s $(shell wx-config --debug=no --libs --unicode=yes)
IncludePath := $(IncludeSwitch). $(IncludeSwitch)../src IncludePath := $(IncludeSwitch). $(IncludeSwitch)../src
IncludePCH := IncludePCH :=
RcIncludePath := RcIncludePath :=
@@ -50,8 +50,8 @@ LibPath := $(LibraryPathSwitch).
AR := /usr/bin/ar rcu AR := /usr/bin/ar rcu
CXX := /usr/bin/g++-4.8 CXX := /usr/bin/g++-4.8
CC := /usr/bin/gcc-4.8 CC := /usr/bin/gcc-4.8
CXXFLAGS := -std=c++11 -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) CXXFLAGS := -std=c++11 -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors)
CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors)
ASFLAGS := ASFLAGS :=
AS := /usr/bin/as AS := /usr/bin/as
@@ -79,7 +79,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects)
$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)
$(IntermediateDirectory)/.d: $(IntermediateDirectory)/.d:
@test -d ./Debug || $(MakeDirCommand) ./Debug @test -d ../Release || $(MakeDirCommand) ../Release
PreBuild: PreBuild:
@@ -101,6 +101,6 @@ $(IntermediateDirectory)/main.cpp$(PreprocessSuffix): main.cpp
## Clean ## Clean
## ##
clean: clean:
$(RM) -r ./Debug/ $(RM) -r ../Release/

View File

@@ -1 +1 @@
./Debug/main.cpp.o ../Release/main.cpp.o